Search Postgresql Archives

Re: can you give me a sql example to explain this?

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

 



On Tue, Oct 25, 2022 at 7:54 AM jacktby@xxxxxxxxx <jacktby@xxxxxxxxx> wrote:
/*
 * In a "leaf" node representing a VALUES list, the above fields are all
 * null, and instead this field is set.  Note that the elements of the
 * sublists are just expressions, without ResTarget decoration. Also note
 * that a list element can be DEFAULT (represented as a SetToDefault
 * node), regardless of the context of the VALUES list. It's up to parse
 * analysis to reject that where not valid.
 */
List    *valuesLists; /* untransformed list of _expression_ lists */

I need to understand what this is used for?

That's a fairly broad question...does this help?

In the SQL command:

VALUES ('one', 'two', 1+2, DEFAULT)

The valuesLists List will effectively contain three elements, {'one'}, {'two'}, {1+2}, and {DEFAULT}.

Though if it contains DEFAULT and the VALUES is not part of an INSERT an error should eventually occur during parse analysis since a plain VALUES command has no context from which to retrieve a default.

David J.


[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux