create type with %type or %rowtype

From: Post Gresql <postgresql(at)taljaren(dot)se>
To: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: create type with %type or %rowtype
Date: 2020-11-17 22:12:45
Message-ID: 4fb49f43-6753-b692-9ca7-61052f63a929@taljaren.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello.

It seems that I can not create a type with

create type my_type as my_table%rowtype;

or

create type my_type as my_table.my_column%type;

Correct? It seems to be a feature for plpgsql programing only, right?

But wouldn't that be a good thing to be able to do? Or would it cause
too many problems?

Best regards

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim Gündüz 2020-11-17 22:17:40 Re: pg_upgrade from 12 to 13 failes with plpython2
Previous Message Olivier Gautherot 2020-11-17 21:52:41 Re: autovacuum recommendations for Large tables