Search Postgresql Archives

Re: referencing other INSERT VALUES columns inside the insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux