Altering array(composite-types) without breaking code when inserting them and similar questions

Поиск
Список
Период
Сортировка
От Dorian Hoxha
Тема Altering array(composite-types) without breaking code when inserting them and similar questions
Дата
Msg-id CANsFX06HwC5YNLxs=Ov7+yzicZ8x9E1YG_fb0M-FE=kFkbmV2A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Altering array(composite-types) without breaking code when inserting them and similar questions  (David G Johnston <david.g.johnston@gmail.com>)
Re: Altering array(composite-types) without breaking code when inserting them and similar questions  (Fede Martinez <federicoemartinez@gmail.com>)
Список pgsql-general
Hi list,

I have a
create type thetype(width integer, height integer);
create table mytable(thetype thetype[]);

How can i make an insert statement so if i later add fields to the composite type, the code/query doesn't break ?
Maybe by specifying the fields of the composite type in the query ?

This can be done for normal inserts(non arrays):
CREATE TABLE mytable (t thetype);
INSERT INTO mytable(t.width, t.height) VALUES (11,22);


Also how to update an whole element of an array of composites ?
Also, how to update an attribute in a specific element in an array of composites?

(so when i add columns later to the composite, my old code doesn't break)

How much overhead have the composite types beside the values and nulls?

Thanks

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

Предыдущее
От: Torsten Förtsch
Дата:
Сообщение: Re: Disable an index temporarily
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Altering array(composite-types) without breaking code when inserting them and similar questions