Re: plpgsql/rule question

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: plpgsql/rule question
Дата
Msg-id
6573.1105501214@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
plpgsql/rule question "Ed L." <pgsql@bluepolka.net>
Re: plpgsql/rule question Michael Fuhr <mike@fuhr.org>
Re: plpgsql/rule question Tom Lane <tgl@sss.pgh.pa.us>
Re: plpgsql/rule question "Ed L." <pgsql@bluepolka.net>
Re: plpgsql/rule question Tom Lane <tgl@sss.pgh.pa.us>
Re: plpgsql/rule question "Ed L." <pgsql@bluepolka.net>
"Ed L."  writes:
> For example, if I have the following table:

> 	create table foo(id serial, msg varchar)

> Is it possible to distinguish within plpgsql between these two queries?

> 	insert into foo (msg) values ('Hello')
> 	insert into foo (id, msg) values (NULL, 'Hello')

Well, yes, because the default value in the former case will not be
NULL.  But in general a trigger function cannot tell whether a field
value that happens to equal the default was explicitly specified or
defaulted.  All it can see is the proposed field value; not how that
value was arrived at.

			regards, tom lane
В списке pgsql-general по дате отправления
От: Ed L.
Дата:
Сообщение: plpgsql/rule question
От: Tom Lane
Дата:
Сообщение: Re: Bug in pg_dump in 7.4.6?
FAQ