Violation of NOT NULL

Поиск
Список
Период
Сортировка
От Wm. G. Urquhart
Тема Violation of NOT NULL
Дата
Msg-id Pine.LNX.4.44.0205230931040.16744-100000@mailer.wurquhart.co.uk
обсуждение исходный текст
Ответы Re: Violation of NOT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: How to select rows with values set to NULL
Следующее
От: "Wm. G. Urquhart"
Дата:
Сообщение: Addendum to Violation of NOT NULL