Search Postgresql Archives

Re: plpgsql/rule question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Ed L." <pgsql@xxxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux