Re: [GENERAL] CREATE TABLE & composite type
От | gmb |
---|---|
Тема | Re: [GENERAL] CREATE TABLE & composite type |
Дата | |
Msg-id | 1498657918877-5969045.post@n3.nabble.com обсуждение исходный текст |
Ответ на | Re: [GENERAL] CREATE TABLE & composite type (Adrian Klaver <adrian.klaver@aklaver.com>) |
Список | pgsql-general |
Adrian Klaver-4 wrote > > CREATE TABLE inventory_item_table AS ( SELECT some_func( ) limit 0); Thanks Adrian My concern is that this will have to execute all code in the function only to return a empty dataset - his may be ineffective. A possible workaround will be to have a dedicated param which will determine whether or not to exit at the start of the function. I also just realised that a possible workaround will be to create tables instead of composite types ("Whenever you create a table, a composite type is also automatically created"). I.e. instead of doing: CREATE TYPE inventory_item AS ( name text, supplier_id integer, price numeric ); create an actual table (which will never be used): CREATE TABLE inventory_item AS ( name text, supplier_id integer, price numeric ); However, having unused tables in the schema kind of goes against the grain... Regards -- View this message in context: http://www.postgresql-archive.org/CREATE-TABLE-composite-type-tp5969032p5969045.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
В списке pgsql-general по дате отправления: