public inbox for [email protected]  
help / color / mirror / Atom feed
From: Wiwwo Staff <[email protected]>
To: [email protected]
Subject: On enforcing default column value, AKA "Bloody nulls"
Date: Thu, 16 Jan 2025 12:14:54 +0000
Message-ID: <CAD1W9HW=PZMZMN7GmPWVUW8BSnvzCYJn=W8nmRXqTaUntSaTdg@mail.gmail.com> (raw)

Hi all!
In a scenario like this:

> =# create table tab1(text1 text default 'from table');
>
> =# create procedure ins_tab1(p_text1 text default 'from proc') language
sql as
> -# $$
> $# insert into tab1(text1) values (p_text1);
> $# $$;
>
> =# call ins_tab1 (null);
>
> =#  select * from tab1 ;
>  text1
> --------
>  [nUlL]

Is there a way (apart from triggers) to force at least one of the default
values?

Thanks!


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: On enforcing default column value, AKA "Bloody nulls"
  In-Reply-To: <CAD1W9HW=PZMZMN7GmPWVUW8BSnvzCYJn=W8nmRXqTaUntSaTdg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox