Re: Error defining composite types and returning ROWTYPEs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Error defining composite types and returning ROWTYPEs
Дата
Msg-id 12512.1119103118@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Error defining composite types and returning ROWTYPEs  (Geoffrey Giesemann <geoffwa@iinet.net.au>)
Список pgsql-general
Geoffrey Giesemann <geoffwa@iinet.net.au> writes:
> CREATE TYPE test_type as (
>    some_type test_table.some_column%TYPE
> );

> Gives me:
> ERROR:  syntax error at or near "%" at character 62
> LINE 2:   some_type test_table.some_column%TYPE

> I also can't define rowtypes as return types on functions:
> CREATE OR REPLACE FUNCTION get_test_table_single()
> RETURNS test_table%ROWTYPE AS $$

%ROWTYPE is a plpgsql-ism, not a SQL construct.  %TYPE isn't a SQL
construct either --- AFAIR we only support it in the very limited
context of CREATE FUNCTION's argument and result type declarators.

            regards, tom lane

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

Предыдущее
От:
Дата:
Сообщение: Replication
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Replication