Re: referencing other INSERT VALUES columns inside the insert

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: referencing other INSERT VALUES columns inside the insert
Дата
Msg-id 564B5407.9090407@BlueTreble.com
обсуждение исходный текст
Ответ на Re: referencing other INSERT VALUES columns inside the insert  (Geoff Winkless <pgsqladmin@geoff.dj>)
Список pgsql-general
On 11/17/15 8:53 AM, Geoff Winkless wrote:
> It takes the column's default value, since it's not explicit in the
> first INSERT.

Not sure if it would help or not, but you can use pg_get_expr(adbin,
adrelid) against pg_attrdef to get the default for a column. That would
let you dynamically insert the expression that generates the default
value into the VALUES clause.

start psql with the -E option and do \d on a table with e default to see
this in action.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Querying same lookup table with multiple columns based on another view
Следующее
От: Willy-Bas Loos
Дата:
Сообщение: Re: database corrupt