HELP Check constraint

Поиск
Список
Период
Сортировка
От Anand Surelia
Тема HELP Check constraint
Дата
Msg-id 3600DCEA.3F54C617@bytekinc.com
обсуждение исходный текст
Список pgsql-general
Hi,
Could someone please help me? I am running version 6.3.2.

I have created a function "int fname(void)" in C. When I create this
function in Postgres as returning int4 and then do a
" create table dummy (level int4 check(fname() > 4));"
the creation fails saying that :
ERROR:  There is no operator '>' for types 'bool' and 'int4'
        You will either have to retype this query using an explicit
cast,
        or you will have to define the operator using CREATE OPERATOR

I've tried this for different operators and it comes up with the same
error even though I know the operators exist.

However, when I create fname as returning int2 and then create the
table, it says:
NOTICE:  PortalHeapMemoryFree: 0x8178389 not in alloc set!
CREATE

Which means that the table has been created.
Now when I do a insert into the table it fails saying:
PQexec() -- Request was sent to backend, but backend closed the channel
before r
esponding.
        This probably means the backend terminated abnormally before or
while pr
ocessing the request.

Could someone please explain what is going on?

Do the Check constraints do not take functions?

Thanks,
Anand

В списке pgsql-general по дате отправления:

Предыдущее
От: "Wim Ceulemans"
Дата:
Сообщение: Re: [GENERAL] PostgreSQL capacity ?
Следующее
От: Brian
Дата:
Сообщение: Backup up database