From: | Chamath Sajeewa <csgsajeewa(at)gmail(dot)com> |
---|---|
To: | Didier Gasser-Morlay <didiergm(at)gmail(dot)com> |
Cc: | pgsql-novice(at)lists(dot)postgresql(dot)org |
Subject: | Re: Not null constraint in postgre |
Date: | 2020-07-27 06:55:25 |
Message-ID: | CACpofeja5pXdY=d62Eukto+iH36eZq21k+CJUKg0PxeKP-OKnQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Yes Thank You!!
On Mon, 27 Jul 2020, 11:31 Didier Gasser-Morlay, <didiergm(at)gmail(dot)com> wrote:
> In order to get the default value to kick in in an insert statement (which
> I assume you're trying to do), you can either omit that column name from
> the insert list or set that column value to DEFAULT (no quotes)
>
> Didier
>
> On Mon, 27 Jul 2020 at 07:45, Chamath Sajeewa <csgsajeewa(at)gmail(dot)com>
> wrote:
>
>> Hi,
>> There is a column in my table with not null constraint. Default value is
>> set to 0 for that column. In my query, column value is set to null. When i
>> try to execute that query in pgsql, it is getting failed due to constraint
>> violation. Any idea? This is working in oracle.
>> Thank You!
>>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Chamath Sajeewa | 2020-07-27 16:51:17 | Pgsql error in coalesce |
Previous Message | Chamath Sajeewa | 2020-07-27 06:55:09 | PGSQL equivalent to oracle DEFAULT ON NULL |