Обсуждение: How to check constraints before call of simple_heap_insert()?

Поиск
Список
Период
Сортировка

How to check constraints before call of simple_heap_insert()?

От
"Vanyel"
Дата:
Hi all.
I'm writting some trigger i C, and I use simple_heap_insert() function
to insert HeapTuple to a table. But unfortunatelly that function does
not check constraints before inserting values to the table. Does anyone
know there is some function that checks constraints while inserting
HeapTuple structure?
Thanks in advice

Best regards.
Vanyel


Re: How to check constraints before call of simple_heap_insert()?

От
Alvaro Herrera
Дата:
Vanyel wrote:
> Hi all.
> I'm writting some trigger i C, and I use simple_heap_insert() function
> to insert HeapTuple to a table. But unfortunatelly that function does
> not check constraints before inserting values to the table. Does anyone
> know there is some function that checks constraints while inserting
> HeapTuple structure?

Use SPI_exec() instead.


Re: How to check constraints before call of simple_heap_insert()?

От
"Vanyel"
Дата:
But SPI_exec() takes string containing an SQL command :-(
I need to pass previously prepared HeapTuple variable.
Best regards :-)