Re: what is null

From: Darko Prenosil <darko(dot)prenosil(at)finteh(dot)hr>
To: John Harrold <jmh17(at)pitt(dot)edu>, posgresql hotline <pgsql-general(at)postgresql(dot)org>
Subject: Re: what is null
Date: 2003-08-05 10:33:54
Message-ID: 200308051233.54748.darko.prenosil@finteh.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 04 August 2003 22:54, John Harrold wrote:
> i'm trying to alter a table call it 'my_table' and i'm trying to set the
> field 'my_id' to prevent null values from being inserted. when i run the
> following:
>
> ALTER TABLE my_table ALTER my_id SET NOT NULL;
>
> i get:
>
> ERROR: ALTER TABLE: Attribute "my_id" contains NULL values
>
> so i want to find out which rows have null values so i run:
>
> my=# select my_id from my_table where my_id=NULL;
> my_id
> ---------
> (0 rows)
>
>
> so this would indicate to me that there are no rows in which my_id is NULL.
> so what is preventing me from altering the table? or am i just doing
> something wrong?

select my_id from my_table where my_id IS NULL;
or
change configuration parameter "transform_null_equals" to yes in
postgresql.conf, restart server and you can try with :
select my_id from my_table where my_id=NULL;

Regards !

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yudha Setiawan 2003-08-05 10:47:20 Dump Customizing
Previous Message Jean-Christian Imbeault 2003-08-05 07:31:12 Re: Fatal error: Call to undefined function: pg_connect()