Re: default value dosen't get applyed in this situation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aliouii Ali <aliouii(dot)ali(at)aol(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: default value dosen't get applyed in this situation
Date: 2015-05-10 21:33:52
Message-ID: 4724.1431293632@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aliouii Ali <aliouii(dot)ali(at)aol(dot)fr> writes:
> this a test case :

This is not supposed to insert a default. Attach a default expression
to the view column, if you want inserts on the view to have defaults.
ALTER VIEW ... ALTER COLUMN ... SET DEFAULT is the way.

(Note that in recent versions of PG, that view would be auto-insertable
so you would not need to bother with the trigger. But the situation
with defaults hasn't changed, and won't because it would be a backwards
compatibility break with no real value-add.)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2015-05-10 21:34:16 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Previous Message Robert Haas 2015-05-10 21:30:58 Re: Parallel Seq Scan