From: | "Wm(dot) G(dot) Urquhart" <wgu(at)wurquhart(dot)co(dot)uk> |
---|---|
To: | PostgreSQL General Forum <pgsql-general(at)postgresql(dot)org> |
Subject: | Violation of NOT NULL |
Date: | 2002-05-23 08:48:11 |
Message-ID: | Pine.LNX.4.44.0205230931040.16744-100000@mailer.wurquhart.co.uk |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Wm. G. Urquhart | 2002-05-23 08:58:59 | Addendum to Violation of NOT NULL |
Previous Message | Martijn van Oosterhout | 2002-05-23 08:28:21 | Re: How to select rows with values set to NULL |