Re: NOT NULL violation and error-message

Поиск
Список
Период
Сортировка
Искать
От
Andreas Joseph Krogh
Тема
Re: NOT NULL violation and error-message
Дата
Msg-id
201001121118.52357.andreak@officenet.no
Ответ на
Список
Дерево обсуждения
NOT NULL violation and error-message Andreas Joseph Krogh <andreak@officenet.no>
Re: NOT NULL violation and error-message Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
Re: NOT NULL violation and error-message Andreas Joseph Krogh <andreak@officenet.no>
Re: NOT NULL violation and error-message Tom Lane <tgl@sss.pgh.pa.us>
Re: NOT NULL violation and error-message Robert Haas <robertmhaas@gmail.com>
Re: NOT NULL violation and error-message Tom Lane <tgl@sss.pgh.pa.us>
Re: NOT NULL violation and error-message "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
On Tuesday 12. January 2010 11.10.09 Takahiro Itagaki wrote:
> 
> Andreas Joseph Krogh  wrote:
> 
> > ERROR: null value in column "created" violates not-null constraint
> 
> It is easy to add the table name to the message, but ...
> 
> > ERROR: null value in column "public"."mytable"."created" violates not-null constraint
> > Oracle does this btw...
> 
> Do we have any guideline about the message for identifier names? We've
> already had serveral "table.column" messages, but "schema.table.column"
> might be preferred if there are tables with the same name in different
> schema. In addition, separated quotes ("schema"."table"."column") are
> more SQL-ish than single outer quotes. Which should we use?
> 
> At any rate, we need to adjust many regression test and .po files
> if we change such kinds of messages.
> 
> 
> Index: src/backend/executor/execMain.c
> ===================================================================
> --- src/backend/executor/execMain.c	(HEAD)
> +++ src/backend/executor/execMain.c	(fixed)
> @@ -1316,7 +1316,8 @@
>  				slot_attisnull(slot, attrChk))
>  				ereport(ERROR,
>  						(errcode(ERRCODE_NOT_NULL_VIOLATION),
> -						 errmsg("null value in column \"%s\" violates not-null constraint",
> +						 errmsg("null value in column \"%s.%s\" violates not-null constraint",
> +						RelationGetRelationName(rel),
>  						NameStr(rel->rd_att->attrs[attrChk - 1]->attname))));
>  		}
>  	}

+1

-- 
Andreas Joseph Krogh 
Senior Software Developer / CTO
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Rosenholmveien 25       | know how to do a thing and to watch         |
1414 Trollåsen          | somebody else doing it wrong, without       |
NORWAY                  | comment.                                    |                       |                                             |
Tlf:    +47 24 15 38 90 |                                             |
Fax:    +47 24 15 38 91 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+

В списке pgsql-hackers по дате отправления
От: Magnus Hagander
Дата:
От: Tsutomu Yamada
Дата:
FAQ