Re: Tablename.columnname%TYPE in Types On PostgreSQL 9.2

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Adrien Besson *EXTERN*" <a(dot)besson04(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Tablename.columnname%TYPE in Types On PostgreSQL 9.2
Date: 2013-04-09 11:27:04
Message-ID: A737B7A37273E048B164557ADEF4A58B057DAE9C@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christian Hammers 2013-04-09 11:28:10 Re: Queries seldomly take >4s while normally take <1ms?
Previous Message News Subsystem 2013-04-09 11:23:04