Tablename.columnname%TYPE in Types On PostgreSQL 9.2

Started by Adrien Bessonabout 13 years ago2 messagesgeneral
Jump to latest
#1Adrien Besson
a.besson04@gmail.com

Hello Everyone,

Trying to create a type using %Type seems not to work on PostgreSQL 9.2:

CREATE TYPE type1 AS (tvar_1 TABLE1. COL1%TYPE , tvar_2 INTEGER);

Returns

XX ERROR: syntax error at or near "%"

Where am I wrong ? Someone has an idea ?

Thanks a lot !

BESSON Adrien

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Adrien Besson (#1)
Re: Tablename.columnname%TYPE in Types On PostgreSQL 9.2

Adrien Besson wrote:

Trying to create a type using %Type seems not to work on PostgreSQL 9.2:

CREATE TYPE type1 AS (tvar_1 TABLE1. COL1%TYPE , tvar_2 INTEGER);

Returns

XX ERROR: syntax error at or near "%"

Where am I wrong ? Someone has an idea ?

I think that the %TYPE syntax is PL/pgSQL only.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general