Re: create type with %type or %rowtype

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: create type with %type or %rowtype
Дата
Msg-id 95489fe2-2beb-2816-bad9-7acc725cfec3@aklaver.com
обсуждение исходный текст
Ответ на create type with %type or %rowtype  (Post Gresql <postgresql@taljaren.se>)
Список pgsql-general
On 11/17/20 2:12 PM, Post Gresql wrote:
> Hello.
> 
> It seems that I can not create a type with
> 
> create type my_type as my_table%rowtype;

To me that is redundant as a table has a composite type already.

> 
> or
> 
> create type my_type as my_table.my_column%type;

In plpgsql %type is effectively a placeholder, not sure how well that 
would work in a created 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
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_upgrade from 12 to 13 failes with plpython2
Следующее
От: Rich Shepard
Дата:
Сообщение: PK issue: serial sequence needs updating