Violation of NOT NULL - Mailing list pgsql-general

From Wm. G. Urquhart
Subject Violation of NOT NULL
Date
Msg-id Pine.LNX.4.44.0205230931040.16744-100000@mailer.wurquhart.co.uk
Whole thread Raw
Responses Re: Violation of NOT NULL
List pgsql-general
Hi all,

I have a table where I've set two of the columns (varchar()) to be NOT
NULL. However, PostgreSQL allows me to enter rows without valid data for
these columns when I use a Stored Function. Using a std INSERT from psql
generates (as expected) an error.

I don't accept for a minute that PostgreSQL is broken, so can someone tell
me where I'm doing wrong. Here is an excerpt from the script in question:

...

INSERT INTO nhsgps (titleid, forename, surname, surgery, addr1, addr2,
addr3, town, postcode, telno1, telno2, email, url)
VALUES ($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) ;
GET_DIAGNOSTICS (nRowCount = ROW_COUNT) ;
IF (nRowCount = 0) THEN
    RAISE NOTICE \'Error Message\' ;
END IF ;

...

Thanks.

--
Regards,


Wm. G. Urquhart
Custom Software Solutions
http://www.wurquhart.co.uk



pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: How to select rows with values set to NULL
Next
From: "Wm. G. Urquhart"
Date:
Subject: Addendum to Violation of NOT NULL