Re: create type with %type or %rowtype

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: create type with %type or %rowtype
Дата
Msg-id CAKFQuwYSNf4g0_QHwbMnX6LAcmaQJJKG_Qd0yBkSutPQYafMqQ@mail.gmail.com
обсуждение исходный текст
Ответ на create type with %type or %rowtype  (Post Gresql <postgresql@taljaren.se>)
Ответы Re: create type with %type or %rowtype  (Post Gresql <postgresql@taljaren.se>)
Список pgsql-general
(resending to include the list)

On Tue, Nov 17, 2020 at 3:12 PM Post Gresql <postgresql@taljaren.se> wrote:
create type my_type as my_table%rowtype;

This would be redundant with existing behavior - all tables have a corresponding type already

create type my_type as my_table.my_column%type;

What does the indirection get us?
 
Correct? It seems to be a feature for plpgsql programing only, right?

Correct

But wouldn't that be a good thing to be able to do?

You are the one proposing it - why would it be a good thing to do?

Or would it cause
too many problems?

If it doesn't have value it wouldn't matter whether it would be problematic.

David J.


On Tue, Nov 17, 2020 at 3:12 PM Post Gresql <postgresql@taljaren.se> wrote:
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




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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: PK issue: serial sequence needs updating [RESOLVED]
Следующее
От: Yi Sun
Дата:
Сообщение: received immediate shutdown request caused cluster failover