Re: Function Returning SETOF RECORD: Trouble With Char Type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function Returning SETOF RECORD: Trouble With Char Type
Дата
Msg-id 28960.1205350376@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function Returning SETOF RECORD: Trouble With Char Type  ("Angus B. Atkins-Trimnell" <trimnell@uic.edu>)
Ответы Re: Function Returning SETOF RECORD: Trouble With Char Type  ("Angus B. Atkins-Trimnell" <trimnell@uic.edu>)
Список pgsql-general
"Angus B. Atkins-Trimnell" <trimnell@uic.edu> writes:
> I am having trouble with a function designed to return all column
> constraints on a table.

I think the problem is that you're declaring the contype return column
as char (ie, character(1)) when pg_constraint.contype is actually "char"
(a historical PG datatype that's really just a single byte).  The naming
confusion is unfortunate but we've never bitten the bullet to rename
"char" to something else.

Use quotes, or explicitly cast the catalog column to regular char
in the function's query.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: postgre vs MySQL
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: pain of postgres upgrade with extensions