Search Postgresql Archives

Re: Error defining composite types and returning ROWTYPEs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Geoffrey Giesemann <geoffwa@xxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux