pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedValues list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?)
61+ messages / 11 participants
[nested] [flat]
* Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?)
@ 2006-07-24 03:57 Joe Conway <mail@joeconway.com>
2006-07-24 06:22 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 61+ messages in thread
From: Joe Conway @ 2006-07-24 03:57 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Patches (PostgreSQL) <pgsql-patches@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>
>>I'm liking this too. But when you say "jointree node", are you saying to
>>model the new node type after NestLoop/MergeJoin/HashJoin nodes? These
>>are referred to as "join nodes" in ExecInitNode. Or as you mentioned a
>>couple of times, should this look more like an Append node?
>
>
> No, I guess I confused you by talking about the executor representation
> at the same time. This is really unrelated to the executor. The join
> tree I'm thinking of here is the data structure that dangles off
> Query.jointree --- it's a representation of the query's FROM clause,
> and (at present) can contain RangeTblRef, FromExpr, and JoinExpr nodes.
> See the last hundred or so lines of primnodes.h for some details.
> The jointree is used by the planner to compute the plan node tree that
> the executor will run, but it's not the same thing.
>
> There are basically two ways you could go about this:
> 1. Make a new jointree leaf node type to represent a VALUES construct,
> and dangle the list of lists of expressions off that.
> 2. Make a new RangeTblEntry type to represent a VALUES construct, and
> just put a RangeTblRef to it into the jointree. The expressions
> dangle off the RangeTblEntry.
>
> Offhand I'm not certain which of these would be cleanest. The second
> way has some similarities to the way we handle set operation trees
> (UNION et al), so it might be worth looking at that stuff. However,
> being a RangeTblEntry has a lot of baggage (eg, various routines expect
> to find an RTE alias, column names, column types, etc) and maybe we
> don't need all that for VALUES.
Since the feature freeze is only about a week off, I wanted to post this
patch even though it is not yet ready to be applied.
Executive summary:
==================
1. The patch is now large and invasive based on adding new node
types and associated infrastructure. I modelled the nodes largely
on RangeFunction and FunctionScan.
2. Performance is close enough to mysql to not be a big issue (I think,
more data below) as long as the machine does not get into a memory
swapping regime. Memory usage is now better, but not as good as
mysql.
3. I specifically coded with the intent of preserving current insert
statement behavior and code paths for current functionality. So there
*should* be no performance degradation or subtle semantics changes
for "INSERT DEFAULT VALUES", "INSERT ... VALUES (with one target
list)", "INSERT ... SELECT ...". Even Tom's recently discovered
"insert into foo values (tenk1.*)" still works ;-)
Performance:
============
On my development machine (dual core amd64, 2GB RAM) I get the following
results using the php script posted earlier:
Postgres:
---------
$loopcount = 100000;
multi-INSERT-at-once Elapsed time is 1 second
$loopcount = 300000;
multi-INSERT-at-once Elapsed time is 5 seconds
$loopcount = 500000;
multi-INSERT-at-once Elapsed time is 9 seconds
$loopcount = 800000;
multi-INSERT-at-once Elapsed time is 14 seconds
$loopcount = 900000;
multi-INSERT-at-once Elapsed time is 17 seconds
$loopcount = 1000000;
multi-INSERT-at-once Elapsed time is 42 seconds
$loopcount = 2000000;
killed after 5 minutes due to swapping
MySQL:
------
$loopcount = 100000;
multi-INSERT-at-once Elapsed time is 2 seconds
$loopcount = 300000;
INSERT failed:Got a packet bigger than 'max_allowed_packet' bytes
changed max_allowed_packet=64M
multi-INSERT-at-once Elapsed time is 5 seconds
$loopcount = 500000;
multi-INSERT-at-once Elapsed time is 8 seconds
$loopcount = 800000;
multi-INSERT-at-once Elapsed time is 13 seconds
$loopcount = 900000;
multi-INSERT-at-once Elapsed time is 15 seconds
$loopcount = 1000000;
multi-INSERT-at-once Elapsed time is 17 seconds
$loopcount = 2000000;
multi-INSERT-at-once Elapsed time is 36 seconds
$loopcount = 3000000;
multi-INSERT-at-once Elapsed time is 54 seconds
$loopcount = 4000000;
multi-INSERT-at-once Elapsed time is 134 seconds
<table value constructor>:
==========================
Included in this patch is support for <table value constructor> in the
FROM clause, e.g.:
regression=# select * from {values (1,array[1,2]),(2,array[3,4])};
?column? | array
----------+-------
1 | {1,2}
2 | {3,4}
(2 rows)
The strange syntax is a temporary hack to eliminate shift/reduce
conflicts. I'm not entirely sure we want to try to support this (or
something like it) for 8.2, but much of what is needed is now readily
available. More on known issues next.
Known Issues:
=============
General:
--------
1. Several comments in the patch are marked "FIXME". These are areas
where I was uncertain what was the "right thing to do". Any advice
on these specific spots would be very much appreciated.
2. I broke the rules regression test -- still need to look at what I
did to mess that up. Somewhere in the reconstruction of "VALUES ..."
according to the diff.
VALUES multi-targetlist INSERTS:
--------------------------------
3. Not yet quite sure how to get DEFAULT to work for "INSERT ...
multi-values". As noted above, works fine if there is only
one targetlist.
<table value constructor>:
--------------------------
4. I'm getting shift/reduce conflicts that are not easily eliminated.
Making VALUES fully reserved only made it 1 shift/reduce conflict.
5. Column aliases are still not working correctly. Haven't really looked
closely at this yet.
6. Data types are being deduced currently based on the first row,
and not currently getting checked on subsequent rows. So it is
easy to induce a crash:
regression=# select * from {values (1,array[1,2]),(2,3)};
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>
7. In general, <table value constructor> in the FROM clause needs
more discussion -- among other things, how should we determine and
enforce column types? I think this could be a very useful feature,
but I'm not comfortable I understand it yet.
=================
As usual, review, advise, comments, flames, etc. requested
Joe
Attachments:
multi-insert-r6a.diff.gz (application/x-gzip, 16.1K) download
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
@ 2006-07-24 06:22 ` Joe Conway <mail@joeconway.com>
1 sibling, 0 replies; 61+ messages in thread
From: Joe Conway @ 2006-07-24 06:22 UTC (permalink / raw)
To: Patches (PostgreSQL) <pgsql-patches@postgresql.org>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Joe Conway wrote:
> Since the feature freeze is only about a week off, I wanted to post this
> patch even though it is not yet ready to be applied.
>
Sorry -- I just realized that two new files for ValuesScan didn't make
it into the patch posted earlier. Here they are now -- please untar in
your postgres sourcetree root in addition to applying the patch.
(I thought "cvs diff -cN" should have included the new files, since I
had earlier done "cvs add" on them, but it didn't work. I could swear
that worked for me in the past...)
Thanks,
Joe
Attachments:
multi-insert-r6a.new.tar.gz (application/x-gzip, 2.4K) download
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
@ 2006-07-24 16:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
1 sibling, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-07-24 16:12 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Patches (PostgreSQL) <pgsql-patches@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> There are basically two ways you could go about this:
>> 1. Make a new jointree leaf node type to represent a VALUES construct,
>> and dangle the list of lists of expressions off that.
>> 2. Make a new RangeTblEntry type to represent a VALUES construct, and
>> just put a RangeTblRef to it into the jointree. The expressions
>> dangle off the RangeTblEntry.
You seem to have done *both*, which is certainly not what I had in mind.
I'd drop the RangeTblEntry changes, I think.
Shoving all the tuples into a tuplestore is not doing anything for you
from a performance point of view. I was thinking more of evaluating the
targetlists on-the-fly. Basically what I foresaw as the executor
mechanism was something like a Result node, except with a list of
targetlists instead of just one, and part of its runtime state would be
an index saying which one to evaluate next. (The update logic for the
index would be just like Append's logic for which subplan to eval next.)
Result as it currently stands is a pretty queer beast because it can
have a child plan or not. I'm tempted to suggest splitting it into
two node types, perhaps call the one with a child "Filter" and reserve
the name "Result" for the one with no child. The reason for doing this
in this context is that we could just make the no-child case be
multi-targetlist-capable (rather than having separate nearly identical
node types with single and multi tlists). AFAICS multi tlists don't
make any sense for the filter-a-child-plan scenario, so that's why I
want to push that case off to a different node type.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-07-24 16:32 ` Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 61+ messages in thread
From: Joe Conway @ 2006-07-24 16:32 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Patches (PostgreSQL) <pgsql-patches@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Tom Lane wrote:
>>
>>>There are basically two ways you could go about this:
>>>1. Make a new jointree leaf node type to represent a VALUES construct,
>>>and dangle the list of lists of expressions off that.
>>>2. Make a new RangeTblEntry type to represent a VALUES construct, and
>>>just put a RangeTblRef to it into the jointree. The expressions
>>>dangle off the RangeTblEntry.
>
> You seem to have done *both*, which is certainly not what I had in mind.
> I'd drop the RangeTblEntry changes, I think.
Good feedback -- thanks! But without the RTE, how would VALUES in the
FROM clause work? Or should I just drop that part and focus on just the
InsertStmt case?
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-07-24 17:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 21:22 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
0 siblings, 2 replies; 61+ messages in thread
From: Tom Lane @ 2006-07-24 17:09 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Patches (PostgreSQL) <pgsql-patches@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Joe Conway <mail@joeconway.com> writes:
> Good feedback -- thanks! But without the RTE, how would VALUES in the
> FROM clause work?
Is it different from INSERT? I'm just imagining a Values node in
the jointree and nothing in the rangetable.
If I'm reading the spec correctly, VALUES is exactly parallel to SELECT
in the grammar, which means that to use it in FROM you would need
parentheses and an alias:
SELECT ... FROM (SELECT ...) AS foo
SELECT ... FROM (VALUES ...) AS foo
ISTM that this should be represented using an RTE_SUBQUERY node in the
outer query; the alias attaches to that node, not to the VALUES itself.
So I don't think you need that alias field in the jointree entry either.
If we stick with the plan of representing VALUES as if it were SELECT *
FROM (valuesnode), then this approach would make the second query above
have a structure like
Query
.rtable -> RTE_SUBQUERY
.subquery -> Query
.jointree -> Values
(leaving out a ton of detail of course, but those are the key nodes).
To get this to reverse-list in the expected form, we'd need a small
kluge in ruleutils.c that short-circuits the display of "SELECT
... FROM" etc when it sees a Values node at the top of the jointree.
This seems like a fairly small price to pay for keeping Query in
approximately its present form, though.
One thought is that we might allow Query.jointree to point to either
a FromExpr or a Values node, and disallow Values from appearing further
down in the jointree (except perhaps after flattening of subqueries
in the planner). The alternative is that there's a FromExpr atop
the Values node in the jointree even in the simple case; which seems
uglier but it might avoid breaking some code that expects the top level
to always be FromExpr.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-07-24 21:22 ` Joe Conway <mail@joeconway.com>
1 sibling, 0 replies; 61+ messages in thread
From: Joe Conway @ 2006-07-24 21:22 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Patches (PostgreSQL) <pgsql-patches@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Tom Lane wrote:
> ISTM that this should be represented using an RTE_SUBQUERY node in the
> outer query; the alias attaches to that node, not to the VALUES itself.
> So I don't think you need that alias field in the jointree entry either.
>
> If we stick with the plan of representing VALUES as if it were SELECT *
> FROM (valuesnode), then this approach would make the second query above
> have a structure like
>
> Query
> .rtable -> RTE_SUBQUERY
> .subquery -> Query
> .jointree -> Values
>
> (leaving out a ton of detail of course, but those are the key nodes).
>
OK, I'll go try to wrap my mind around that this evening and see where
it takes me.
Thanks,
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-07-30 01:24 ` Joe Conway <mail@joeconway.com>
2006-07-30 01:35 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 2 replies; 61+ messages in thread
From: Joe Conway @ 2006-07-30 01:24 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Tom Lane wrote:
> If I'm reading the spec correctly, VALUES is exactly parallel to SELECT
> in the grammar, which means that to use it in FROM you would need
> parentheses and an alias:
>
> SELECT ... FROM (SELECT ...) AS foo
>
> SELECT ... FROM (VALUES ...) AS foo
One of the things I'm struggling with is lack of column aliases. Would
it be reasonable to require something like this?
SELECT ... FROM (VALUES ...) AS foo(col1, col2, ...)
The other issue is how to determine column type. Even better would be to
require (similar to SRF returning record):
SELECT ... FROM (VALUES ...) AS foo(col1 type1, col2 type2, ...)
This would unambiguously identify the column aliases and types. Assuming
we stick with the spec:
SELECT ... FROM (VALUES ...) AS foo
1. How should we assign column names?
values1, values2, ...?
or
col1, col2, ...?
or
???
2. How should we assign datatypes? Use the first "row" and try to coerce
the rest to that type?
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-07-30 01:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:45 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
1 sibling, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-07-30 01:35 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Joe Conway <mail@joeconway.com> writes:
> One of the things I'm struggling with is lack of column aliases. Would
> it be reasonable to require something like this?
> SELECT ... FROM (VALUES ...) AS foo(col1, col2, ...)
Requiring column aliases is counter to spec ...
> The other issue is how to determine column type. Even better would be to
> require (similar to SRF returning record):
> SELECT ... FROM (VALUES ...) AS foo(col1 type1, col2 type2, ...)
... and this is even further away from it.
As for the names, just use "?column?", same as we do now in INSERT
... VALUES. Anyone who wants to refer to those columns explicitly will
need to assign aliases, but if they don't assign aliases, we don't have
to do anything very intelligent.
As for the types, I believe that the spec pretty much dictates that we
apply the same type resolution algorithm as for a UNION. This is fairly
expensive and we should avoid it in the case of INSERT ... VALUES, but
for VALUES appearing anywhere else I think we have little choice.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-07-30 01:35 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-07-30 01:45 ` Joe Conway <mail@joeconway.com>
2006-07-30 01:50 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 61+ messages in thread
From: Joe Conway @ 2006-07-30 01:45 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>>One of the things I'm struggling with is lack of column aliases. Would
>>it be reasonable to require something like this?
> Requiring column aliases is counter to spec ...
>> SELECT ... FROM (VALUES ...) AS foo(col1 type1, col2 type2, ...)
> ... and this is even further away from it.
I figured as much, but thought I'd ask anyway :-). I did find something
in the appendix to the spec after sending this:
Annex C
(informative)
Implementation-dependent elements
18) Subclause 7.3, “<table value constructor>”:
a) The column names of a <table value constructor> or a <contextually
typed table value constructor>
are implementation-dependent.
> As for the names, just use "?column?", same as we do now in INSERT
> ... VALUES. Anyone who wants to refer to those columns explicitly will
> need to assign aliases, but if they don't assign aliases, we don't have
> to do anything very intelligent.
OK, I just thought "?column?" was ugly and useless.
> As for the types, I believe that the spec pretty much dictates that we
> apply the same type resolution algorithm as for a UNION. This is fairly
> expensive and we should avoid it in the case of INSERT ... VALUES, but
> for VALUES appearing anywhere else I think we have little choice.
Where do I find that algorithm -- somewhere in nodeAppend.c?
Thanks,
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-07-30 01:35 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:45 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-07-30 01:50 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 61+ messages in thread
From: Tom Lane @ 2006-07-30 01:50 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>; Andrew Dunstan <andrew@dunslane.net>; Bernd Helmle <mailings@oopsware.de>; Peter Eisentraut <peter_e@gmx.net>; Susanne Ebrecht <susanne.ebrecht@credativ.de>
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> As for the types, I believe that the spec pretty much dictates that we
>> apply the same type resolution algorithm as for a UNION.
> Where do I find that algorithm -- somewhere in nodeAppend.c?
select_common_type(), in the parser.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-08-01 20:15 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:26 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Alvaro Herrera <alvherre@commandprompt.com>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
1 sibling, 2 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-01 20:15 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
I've found a problem with the VALUES-as-RTE approach:
regression=# create table src(f1 int, f2 int);
CREATE TABLE
regression=# create table log(f1 int, f2 int, tag text);
CREATE TABLE
regression=# insert into src values(1,2);
INSERT 0 1
regression=# create rule r2 as on update to src do
regression-# insert into log values(old.*, 'old'), (new.*, 'new');
CREATE RULE
regression=# update src set f2 = f2 + 1;
server closed the connection unexpectedly
The problem with this is that the rewriter is substituting Vars
referencing "src" into the values lists of the VALUES RTE, within
a query that looks like a Cartesian product of src and *VALUES*:
regression=# explain update src set f2 = f2 + 1;
QUERY PLAN
--------------------------------------------------------------------
Nested Loop (cost=0.00..97.62 rows=3880 width=40)
-> Values Scan on "*VALUES*" (cost=0.00..0.02 rows=2 width=40)
-> Seq Scan on src (cost=0.00..29.40 rows=1940 width=0)
Seq Scan on src (cost=0.00..34.25 rows=1940 width=14)
(5 rows)
The ValuesScan node doesn't have access to the values of the current
row of src ... indeed, the planner doesn't know that it shouldn't
put the VALUES on the outside of the join, as it's done here, so
there *isn't* a current row of src.
AFAICT, the only way to make this work would be to implement SQL99's
LATERAL construct (or something pretty close to it --- I'm not entirely
sure I understand what LATERAL is supposed to do) so that the rewritten
query could be expressed like
insert into log select ... from src, LATERAL VALUES(src.f1, ...)
That's obviously not something we can get done for 8.2.
We could maybe kluge something to work for 8.2 if we were willing to
abandon the VALUES-as-RTE approach and go back to the notion of some
kind of multiple targetlist in a Query. I'm disinclined to do that
though, because as I've been working with your patch I've come to agree
that the RTE solution is a pretty clean one.
What I'm inclined to do for 8.2 is to disallow OLD/NEW references in
multi-element VALUES clauses; the feature is still tremendously useful
without that.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-01 20:26 ` Alvaro Herrera <alvherre@commandprompt.com>
2006-08-01 20:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 61+ messages in thread
From: Alvaro Herrera @ 2006-08-01 20:26 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Tom Lane wrote:
> I've found a problem with the VALUES-as-RTE approach:
>
> regression=# create table src(f1 int, f2 int);
> CREATE TABLE
> regression=# create table log(f1 int, f2 int, tag text);
> CREATE TABLE
> regression=# insert into src values(1,2);
> INSERT 0 1
> regression=# create rule r2 as on update to src do
> regression-# insert into log values(old.*, 'old'), (new.*, 'new');
> CREATE RULE
> regression=# update src set f2 = f2 + 1;
> server closed the connection unexpectedly
Does it work if you do
regression=# create rule r2 as on update to src do
regression-# insert into log values(old.f1, old.f2, 'old'), (new.f1, new.f2, 'new');
?
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:26 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Alvaro Herrera <alvherre@commandprompt.com>
@ 2006-08-01 20:47 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-01 20:47 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: Joe Conway <mail@joeconway.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Does it work if you do
> regression=# create rule r2 as on update to src do
> regression-# insert into log values(old.f1, old.f2, 'old'), (new.f1, new.f2, 'new');
No, that's not the problem. "*" expansion works just fine here, it's
the executor that can't deal with the resulting Vars.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-01 20:41 ` Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 2 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-01 20:41 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Tom Lane wrote:
> What I'm inclined to do for 8.2 is to disallow OLD/NEW references in
> multi-element VALUES clauses; the feature is still tremendously useful
> without that.
Given the timing, this sounds like a reasonable approach. I agree that
the feature has lots of interesting uses -- I'd hate to see us lose
that. Disallowing OLD/NEW references doesn't contradict the spec in any
way AFAIK either.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-08-01 23:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 02:10 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 05:26 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 05:50 ` Re: Values list-of-targetlists patch for comments (was Re: Joshua D. Drake <jd@commandprompt.com>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
1 sibling, 6 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-01 23:16 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: pgsql-patches@postgreSQL.org
Here's what I've got so far. I think there's probably more gold to be
mined in terms of reducing runtime memory consumption (I don't like the
list_free_deep bit, we should use a context), but functionally it seems
complete. I'm off to dinner again, it's in your court to look over some
more if you want.
(PS: if you want to apply, go ahead, don't forget catversion bump.)
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 00:05 ` Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 02:38 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
5 siblings, 2 replies; 61+ messages in thread
From: Gavin Sherry @ 2006-08-02 00:05 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org
Tom,
Is this intentional:
template1=# values(1), (2);
column1
---------
1
2
(2 rows)
This is legal because of:
simple_select:
/* ... */
| values_clause { $$ = $2; }
Also, I am working out some docs and regression tests.
Gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-02 01:17 ` Joe Conway <mail@joeconway.com>
2006-08-02 01:28 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
1 sibling, 2 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-02 01:17 UTC (permalink / raw)
To: Gavin Sherry <swm@linuxworld.com.au>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-patches@postgresql.org
Gavin Sherry wrote:
> Is this intentional:
>
> template1=# values(1), (2);
> column1
> ---------
> 1
> 2
> (2 rows)
>
> This is legal because of:
>
> simple_select:
> /* ... */
> | values_clause { $$ = $2; }
hmm, not sure about that...
>
> Also, I am working out some docs and regression tests.
>
Oh, cool. I was going to start working on that myself tonight, but if
you're already working on it, don't let me stand in the way ;-)
Actually, if you want me to finish up whatever you have started, I'm
happy to do that too.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-02 01:28 ` Gavin Sherry <swm@linuxworld.com.au>
1 sibling, 0 replies; 61+ messages in thread
From: Gavin Sherry @ 2006-08-02 01:28 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-patches@postgresql.org
On Tue, 1 Aug 2006, Joe Conway wrote:
> Gavin Sherry wrote:
> > Is this intentional:
> >
> > template1=# values(1), (2);
> > column1
> > ---------
> > 1
> > 2
> > (2 rows)
> >
> > This is legal because of:
> >
> > simple_select:
> > /* ... */
> > | values_clause { $$ = $2; }
>
> hmm, not sure about that...
>
> >
> > Also, I am working out some docs and regression tests.
> >
>
> Oh, cool. I was going to start working on that myself tonight, but if
> you're already working on it, don't let me stand in the way ;-)
>
> Actually, if you want me to finish up whatever you have started, I'm
> happy to do that too.
I've got to go out but I'll send a complete patch when I get back.
Gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-03 05:31 ` Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 61+ messages in thread
From: Gavin Sherry @ 2006-08-03 05:31 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-patches@postgresql.org
Docs and regression tests attached.
One slightly annoying thing is this:
---
regression=# declare foo cursor with hold for VALUES(1,2), (3, 4);
DECLARE CURSOR
regression=# declare foo2 cursor with hold for (VALUES(1,2), (3, 4)) as
foo(i, j);
ERROR: syntax error at or near "as"
LINE 1: ...e foo2 cursor with hold for (VALUES(1,2), (3, 4)) as foo(i, ...
---
Now, we can just rewrite the second query as:
---
declare foo2 cursor with hold for select * from (VALUES(1,2), (3, 4)) as
foo(i, j);
---
but it's not immediately obvious. Not worth busting up the grammar for it,
though. And, it's not spec.
Gavin
Attachments:
values_doc_test.diff (text/plain, 16.6K) download
Index: doc/src/sgml/ref/declare.sgml
===================================================================
RCS file: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/declare.sgml,v
retrieving revision 1.37
diff -c -p -r1.37 declare.sgml
*** doc/src/sgml/ref/declare.sgml 26 Feb 2006 03:20:46 -0000 1.37
--- doc/src/sgml/ref/declare.sgml 3 Aug 2006 04:18:28 -0000
*************** DECLARE liahona CURSOR FOR SELECT * FROM
*** 275,280 ****
--- 275,288 ----
See <xref linkend="sql-fetch" endterm="sql-fetch-title"> for more
examples of cursor usage.
</para>
+
+ <para>
+ The cursor <replaceable class="parameter">query</> clause can also
+ be a <literal>VALUES</> list:
+ <programlisting>
+ DECLARE cols CURSOR FOR VALUES(1,2), (3,4);
+ </programlisting>
+ </para>
</refsect1>
<refsect1>
Index: doc/src/sgml/ref/delete.sgml
===================================================================
RCS file: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/delete.sgml,v
retrieving revision 1.26
diff -c -p -r1.26 delete.sgml
*** doc/src/sgml/ref/delete.sgml 22 Jan 2006 05:20:33 -0000 1.26
--- doc/src/sgml/ref/delete.sgml 3 Aug 2006 03:26:58 -0000
*************** DELETE FROM [ ONLY ] <replaceable class=
*** 117,122 ****
--- 117,128 ----
in the <replaceable class="PARAMETER">usinglist</replaceable>,
unless you wish to set up a self-join.
</para>
+
+ <para>
+ The <replaceable class="PARAMETER">usinglist</> may also contain a
+ <literal>VALUES</> list, evaluating to one or more rows. These
+ rows may also be referenced in the <literal>WHERE</> clause.
+ </para>
</listitem>
</varlistentry>
*************** DELETE FROM films WHERE kind <> 'M
*** 191,196 ****
--- 197,213 ----
DELETE FROM films;
</programlisting>
</para>
+
+ <para>
+ Delete films made after 1990 which are 'Horror' and films made
+ after 2000 which are 'Crime'. To do this, we use a <literal>VALUES</>
+ list in the <literal>USING</> clause.
+ <programlisting>
+ DELETE FROM films USING (VALUES('1990-01-01, 'Horror'), ('2000-01-01', 'Crime))
+ AS det (year, kind) WHERE films.date_prod >= det.year AND
+ films.kind = det.kind;
+ </programlisting>
+ </para>
</refsect1>
<refsect1>
Index: doc/src/sgml/ref/insert.sgml
===================================================================
RCS file: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v
retrieving revision 1.30
diff -c -p -r1.30 insert.sgml
*** doc/src/sgml/ref/insert.sgml 17 Nov 2005 22:14:51 -0000 1.30
--- doc/src/sgml/ref/insert.sgml 2 Aug 2006 22:40:14 -0000
*************** PostgreSQL documentation
*** 21,27 ****
<refsynopsisdiv>
<synopsis>
INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ]
! { DEFAULT VALUES | VALUES ( { <replaceable class="PARAMETER">expression</replaceable> | DEFAULT } [, ...] ) | <replaceable class="PARAMETER">query</replaceable> }
</synopsis>
</refsynopsisdiv>
--- 21,27 ----
<refsynopsisdiv>
<synopsis>
INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ]
! { DEFAULT VALUES | VALUES ( { <replaceable class="PARAMETER">expression</replaceable> | DEFAULT } [, ...] ) [, ( ... ) ] | <replaceable class="PARAMETER">query</replaceable> }
</synopsis>
</refsynopsisdiv>
*************** INSERT INTO <replaceable class="PARAMETE
*** 30,37 ****
<para>
<command>INSERT</command> inserts new rows into a table.
! One can insert a single row specified by value expressions,
! or several rows as a result of a query.
</para>
<para>
--- 30,37 ----
<para>
<command>INSERT</command> inserts new rows into a table.
! One can insert one or more rows specified by value expressions,
! or zero or more rows resulting from a query.
</para>
<para>
*************** INSERT INTO films VALUES
*** 162,167 ****
--- 162,177 ----
</para>
<para>
+ Insert multiple rows into a table <literal>films</>:
+
+ <programlisting>
+ INSERT INTO films VALUES
+ ('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'),
+ ('HG120', 'The Dinner Game', 140, '1998-10-12', 'Comedy');
+ </programlisting>
+ </para>
+
+ <para>
In this example, the <literal>len</literal> column is
omitted and therefore it will have the default value:
Index: doc/src/sgml/ref/select.sgml
===================================================================
RCS file: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/select.sgml,v
retrieving revision 1.91
diff -c -p -r1.91 select.sgml
*** doc/src/sgml/ref/select.sgml 30 Apr 2006 18:30:38 -0000 1.91
--- doc/src/sgml/ref/select.sgml 2 Aug 2006 22:40:12 -0000
*************** SELECT [ ALL | DISTINCT [ ON ( <replacea
*** 35,40 ****
--- 35,41 ----
where <replaceable class="parameter">from_item</replaceable> can be one of:
[ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ] [ [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] ) ] ]
+ ( VALUES ( <replaceable class="parameter">expression</replaceable> [, ... ] ) [, ( ... ) ] [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] ) ]
( <replaceable class="parameter">select</replaceable> ) [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] ) ]
<replaceable class="parameter">function_name</replaceable> ( [ <replaceable class="parameter">argument</replaceable> [, ...] ] ) [ AS ] <replaceable class="parameter">alias</replaceable> [ ( <replaceable class="parameter">column_alias</replaceable> [, ...] | <replaceable class="parameter">column_definition</replaceable> [, ...] ) ]
<replaceable class="parameter">function_name</replaceable> ( [ <replaceable class="parameter">argument</replaceable> [, ...] ] ) AS ( <replaceable class="parameter">column_definition</replaceable> [, ...] )
*************** where <replaceable class="parameter">fro
*** 197,202 ****
--- 198,214 ----
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><literal>VALUES(<replaceable class="parameter">expression</replaceable> [, ...]) [, ...]</literal></term>
+ <listitem>
+ <para>
+ One or more rows may be constructed in the from clause. Each
+ <replaceable class="parameter">expression</> will be evaluated and
+ assigned to the corresponding column.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term><replaceable class="parameter">alias</replaceable></term>
*************** SELECT f.title, f.did, d.name, f.date_pr
*** 916,921 ****
--- 928,947 ----
</para>
<para>
+ To join the table <literal>films</> with a <literal>VALUES</> list:
+ <programlisting>
+ SELECT f.title, f.did, f.date_prod, f.kind
+ FROM films f, (VALUES('Horror'), ('Sci-Fi')) as k (kind)
+ WHERE f.kind = k.kind;
+ title | did | date_prod | kind
+ ------------------------------+-----+------------+--------
+ The Texas Chain Saw Massacre | 190 | 1974-06-11 | Horror
+ 2001: A Space Odyssey | 210 | 1968-08-24 | Sci-Fi
+ ...
+ </programlisting>
+ </para>
+
+ <para>
To sum the column <literal>len</literal> of all films and group
the results by <literal>kind</literal>:
Index: doc/src/sgml/ref/update.sgml
===================================================================
RCS file: /usr/local/cvsroot/pgsql/doc/src/sgml/ref/update.sgml,v
retrieving revision 1.37
diff -c -p -r1.37 update.sgml
*** doc/src/sgml/ref/update.sgml 8 Mar 2006 22:59:09 -0000 1.37
--- doc/src/sgml/ref/update.sgml 3 Aug 2006 03:27:07 -0000
*************** UPDATE [ ONLY ] <replaceable class="PARA
*** 134,139 ****
--- 134,145 ----
<replaceable>fromlist</>, unless you intend a self-join (in which
case it must appear with an alias in the <replaceable>fromlist</>).
</para>
+
+ <para>
+ The <replaceable class="PARAMETER">from_list</> may also contain a
+ <literal>VALUES</> list, evaluating to one or more rows. These
+ rows may also be referenced in the <literal>WHERE</> clause.
+ </para>
</listitem>
</varlistentry>
*************** UPDATE employees SET sales_count = sales
*** 233,238 ****
--- 239,255 ----
</para>
<para>
+ Perform an update on <literal>employees</> with a join against a
+ <literal>VALUES</> list:
+ <programlisting>
+ UPDATE employees SET salary = salary * increase
+ FROM (VALUES(1, 200000, 1.2), (2, 400000, 1.4))
+ as prof (depno, target, increase)
+ WHERE employees.sales >= prof.target and employees.depno = prof.depno;
+ </programlisting>
+ </para>
+
+ <para>
Attempt to insert a new stock item along with the quantity of stock. If
the item already exists, instead update the stock count of the existing
item. To do this without failing the entire transaction, use savepoints.
Index: src/test/regress/sql/insert.sql
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/test/regress/sql/insert.sql,v
retrieving revision 1.2
diff -c -p -r1.2 insert.sql
*** src/test/regress/sql/insert.sql 24 Apr 2002 02:22:54 -0000 1.2
--- src/test/regress/sql/insert.sql 3 Aug 2006 05:13:57 -0000
*************** insert into inserttest (col1, col2, col3
*** 18,22 ****
--- 18,29 ----
insert into inserttest (col1) values (1, 2);
insert into inserttest (col1) values (DEFAULT, DEFAULT);
+ --
+ -- VALUES test
+ --
+
+ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT),
+ ((select 2), (select i from (values(3)) as foo (i)), 'values are fun!');
+
select * from inserttest;
drop table inserttest;
Index: src/test/regress/sql/select.sql
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/test/regress/sql/select.sql,v
retrieving revision 1.10
diff -c -p -r1.10 select.sql
*** src/test/regress/sql/select.sql 14 Dec 2005 16:28:32 -0000 1.10
--- src/test/regress/sql/select.sql 3 Aug 2006 05:04:15 -0000
*************** SELECT p.name, p.age FROM person* p ORDE
*** 110,112 ****
--- 110,125 ----
select foo from (select 1) as foo;
select foo from (select null) as foo;
select foo from (select 'xyzzy',1,null) as foo;
+
+ --
+ -- Test VALUES lists
+ --
+ select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) WHERE
+ onek.unique1 = v.i and onek.stringu1 = v.j;
+
+ -- a more complex case
+ -- looks like we're coding lisp :-)
+ select * from onek, (values((select i from
+ (values(10000), (2), (389), (1000), (2000), ((select 10029))) as foo(i)
+ order by i asc limit 1))) bar (i)
+ where onek.unique1 = bar.i;
Index: src/test/regress/sql/update.sql
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/test/regress/sql/update.sql,v
retrieving revision 1.3
diff -c -p -r1.3 update.sql
*** src/test/regress/sql/update.sql 22 Jan 2006 05:20:35 -0000 1.3
--- src/test/regress/sql/update.sql 3 Aug 2006 04:32:03 -0000
*************** SELECT * FROM update_test;
*** 23,28 ****
--- 23,35 ----
UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
+ --
+ -- Test VALUES in FROM
+ --
+
+ UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
+
SELECT * FROM update_test;
-- if an alias for the target table is specified, don't allow references
*************** SET LOCAL add_missing_from = false;
*** 32,35 ****
--- 39,43 ----
UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a = 10;
ROLLBACK;
+
DROP TABLE update_test;
Index: src/test/regress/expected/insert.out
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/test/regress/expected/insert.out,v
retrieving revision 1.7
diff -c -p -r1.7 insert.out
*** src/test/regress/expected/insert.out 25 Sep 2003 06:58:06 -0000 1.7
--- src/test/regress/expected/insert.out 3 Aug 2006 05:19:01 -0000
*************** insert into inserttest (col1) values (1,
*** 28,40 ****
ERROR: INSERT has more expressions than target columns
insert into inserttest (col1) values (DEFAULT, DEFAULT);
ERROR: INSERT has more expressions than target columns
select * from inserttest;
col1 | col2 | col3
! ------+------+---------
| 3 | testing
| 5 | testing
| 5 | test
| 7 | testing
! (4 rows)
drop table inserttest;
--- 28,48 ----
ERROR: INSERT has more expressions than target columns
insert into inserttest (col1) values (DEFAULT, DEFAULT);
ERROR: INSERT has more expressions than target columns
+ --
+ -- VALUES test
+ --
+ insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT),
+ ((select 2), (select i from (values(3)) as foo (i)), 'values are fun!');
select * from inserttest;
col1 | col2 | col3
! ------+------+-----------------
| 3 | testing
| 5 | testing
| 5 | test
| 7 | testing
! 10 | 20 | 40
! -1 | 2 | testing
! 2 | 3 | values are fun!
! (7 rows)
drop table inserttest;
Index: src/test/regress/expected/select.out
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/test/regress/expected/select.out,v
retrieving revision 1.14
diff -c -p -r1.14 select.out
*** src/test/regress/expected/select.out 14 Dec 2005 16:28:32 -0000 1.14
--- src/test/regress/expected/select.out 3 Aug 2006 04:50:36 -0000
*************** select foo from (select 'xyzzy',1,null)
*** 452,454 ****
--- 452,476 ----
(xyzzy,1,)
(1 row)
+ --
+ -- Test VALUES lists
+ --
+ select * from onek, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j) WHERE
+ onek.unique1 = v.i and onek.stringu1 = v.j;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 | i | j
+ ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------+-----+--------
+ 147 | 0 | 1 | 3 | 7 | 7 | 7 | 47 | 147 | 147 | 147 | 14 | 15 | RFAAAA | AAAAAA | AAAAxx | 147 | RFAAAA
+ 931 | 1 | 1 | 3 | 1 | 11 | 1 | 31 | 131 | 431 | 931 | 2 | 3 | VJAAAA | BAAAAA | HHHHxx | 931 | VJAAAA
+ (2 rows)
+
+ -- a more complex case
+ -- looks like we're coding lisp :-)
+ select * from onek, (values((select i from
+ (values(10000), (2), (389), (1000), (2000), ((select 10029))) as foo(i)
+ order by i asc limit 1))) bar (i)
+ where onek.unique1 = bar.i;
+ unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4 | i
+ ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------+---
+ 2 | 326 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 4 | 5 | CAAAAA | OMAAAA | OOOOxx | 2
+ (1 row)
+
Index: src/test/regress/expected/update.out
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/test/regress/expected/update.out,v
retrieving revision 1.3
diff -c -p -r1.3 update.out
*** src/test/regress/expected/update.out 14 Mar 2006 22:48:25 -0000 1.3
--- src/test/regress/expected/update.out 3 Aug 2006 04:50:48 -0000
*************** SELECT * FROM update_test;
*** 32,42 ****
(2 rows)
UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
SELECT * FROM update_test;
a | b
! ----+----
! 10 | 20
! 10 | 20
(2 rows)
-- if an alias for the target table is specified, don't allow references
--- 32,47 ----
(2 rows)
UPDATE update_test t SET b = t.b + 10 WHERE t.a = 10;
+ --
+ -- Test VALUES in FROM
+ --
+ UPDATE update_test SET a=v.i FROM (VALUES(100, 20)) AS v(i, j)
+ WHERE update_test.b = v.j;
SELECT * FROM update_test;
a | b
! -----+----
! 100 | 20
! 100 | 20
(2 rows)
-- if an alias for the target table is specified, don't allow references
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-03 14:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:40 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 20:35 ` Re: Values list-of-targetlists patch for comments (was Re: Simon Riggs <simon@2ndquadrant.com>
0 siblings, 4 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-03 14:58 UTC (permalink / raw)
To: Gavin Sherry <swm@linuxworld.com.au>; +Cc: Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
Gavin Sherry <swm@linuxworld.com.au> writes:
> Docs and regression tests attached.
I've applied the regression tests (with a few additions), but I'm
feeling dissatisfied with this approach to documenting VALUES.
It seems to be mostly missing the point about VALUES being usable
whereever SELECT is. I'm not at all sure what I'd do instead though.
Should we give VALUES its own reference page? That doesn't quite
seem helpful either. cc'ing to pgsql-docs for ideas.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-03 15:56 ` Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
3 siblings, 1 reply; 61+ messages in thread
From: Michael Glaesemann @ 2006-08-03 15:56 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Gavin Sherry <swm@linuxworld.com.au>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
On Aug 3, 2006, at 23:58 , Tom Lane wrote:
> Should we give VALUES its own reference page? That doesn't quite
> seem helpful either.
>
I think we should go for a separate reference page, as VALUES appears
to be expanding quite a bit. Up till now I've thought of VALUES only
in conjunction with UPDATE, so perhaps a useful alternative would be
to keep all of the information regarding VALUES and its syntax would
be as a large part of the UPDATE reference page, though that would
imply by placement (even if explained otherwise) that VALUES is only
a part of the UPDATE syntax, which it no longer (?) is. That brings
me back to the idea of VALUES deserving its own reference page.
I wonder how soon pretty much the entire SQL spec will be duplicated
in the PostgreSQL documentation. :)
Michael Glaesemann
grzm seespotcode net
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
@ 2006-08-04 00:42 ` Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:05 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 02:50 ` Re: [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 61+ messages in thread
From: Gavin Sherry @ 2006-08-04 00:42 UTC (permalink / raw)
To: Michael Glaesemann <grzm@seespotcode.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
On Fri, 4 Aug 2006, Michael Glaesemann wrote:
> On Aug 3, 2006, at 23:58 , Tom Lane wrote:
>
>
> > Should we give VALUES its own reference page? That doesn't quite
> > seem helpful either.
> >
>
> I think we should go for a separate reference page, as VALUES appears
> to be expanding quite a bit. Up till now I've thought of VALUES only
> in conjunction with UPDATE, so perhaps a useful alternative would be
> to keep all of the information regarding VALUES and its syntax would
> be as a large part of the UPDATE reference page, though that would
> imply by placement (even if explained otherwise) that VALUES is only
> a part of the UPDATE syntax, which it no longer (?) is. That brings
> me back to the idea of VALUES deserving its own reference page.
... with update? I associate it very closely with INSERT. After all,
INSERT is the only statement where we've had VALUES as part of the
grammar.
Thanks,
Gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-04 01:05 ` Michael Glaesemann <grzm@seespotcode.net>
1 sibling, 0 replies; 61+ messages in thread
From: Michael Glaesemann @ 2006-08-04 01:05 UTC (permalink / raw)
To: Gavin Sherry <swm@linuxworld.com.au>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
On Aug 4, 2006, at 9:42 , Gavin Sherry wrote:
> ... with update? I associate it very closely with INSERT. After all,
> INSERT is the only statement where we've had VALUES as part of the
> grammar.
Of course! Thanks for catching the glitch. I must have a bad RAM chip.
Michael Glaesemann
grzm seespotcode net
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: [PATCHES] Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-04 02:50 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-09 13:05 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: Peter Eisentraut <peter_e@gmx.net>
1 sibling, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-08-04 02:50 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org, Gavin Sherry <swm@linuxworld.com.au>; +Cc: Michael Glaesemann <grzm@seespotcode.net>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
Gavin Sherry <swm@linuxworld.com.au> writes:
> On Fri, 4 Aug 2006, Michael Glaesemann wrote:
>> On Aug 3, 2006, at 23:58 , Tom Lane wrote:
>>> Should we give VALUES its own reference page? That doesn't quite
>>> seem helpful either.
>>
>> I think we should go for a separate reference page, as VALUES appears
>> to be expanding quite a bit.
> ... with update? I associate it very closely with INSERT. After all,
> INSERT is the only statement where we've had VALUES as part of the
> grammar.
True, but I think that's just a historical artifact. If you look at the
SQL spec, INSERT ... VALUES and INSERT ... SELECT are not distinct
constructs: they fall out of the fact that VALUES and SELECT are allowed
interchangeably.
<insert statement> ::=
INSERT INTO <table name>
<insert columns and source>
<insert columns and source> ::=
[ <left paren> <insert column list> <right paren> ]
<query expression>
| DEFAULT VALUES
<insert column list> ::= <column name list>
and when you trace down <query expression> you find the SELECT
and VALUES options entering at exactly the same place ...
I'd like to see us refactor the docs as necessary to reflect that idea.
Peter is right that this needs some discussion in syntax.sgml as well as
in the reference pages --- but I'm still not very clear on how the
presentation should go.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 02:50 ` Re: [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-09 13:05 ` Peter Eisentraut <peter_e@gmx.net>
2006-08-09 16:22 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: David Fetter <david@fetter.org>
0 siblings, 1 reply; 61+ messages in thread
From: Peter Eisentraut @ 2006-08-09 13:05 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Gavin Sherry <swm@linuxworld.com.au>; Michael Glaesemann <grzm@seespotcode.net>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
Am Freitag, 4. August 2006 04:50 schrieb Tom Lane:
> I'd like to see us refactor the docs as necessary to reflect that idea.
> Peter is right that this needs some discussion in syntax.sgml as well as
> in the reference pages --- but I'm still not very clear on how the
> presentation should go.
I'm beginning to think that VALUES might be a separate command after all.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 02:50 ` Re: [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-09 13:05 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: Peter Eisentraut <peter_e@gmx.net>
@ 2006-08-09 16:22 ` David Fetter <david@fetter.org>
2006-08-09 17:07 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 61+ messages in thread
From: David Fetter @ 2006-08-09 16:22 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-hackers@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Gavin Sherry <swm@linuxworld.com.au>; Michael Glaesemann <grzm@seespotcode.net>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
On Wed, Aug 09, 2006 at 03:05:02PM +0200, Peter Eisentraut wrote:
> Am Freitag, 4. August 2006 04:50 schrieb Tom Lane:
> > I'd like to see us refactor the docs as necessary to reflect that
> > idea. Peter is right that this needs some discussion in
> > syntax.sgml as well as in the reference pages --- but I'm still
> > not very clear on how the presentation should go.
>
> I'm beginning to think that VALUES might be a separate command after
> all.
What's below definitely bolsters that idea :)
postgres=# VALUES(1);
column1
---------
1
(1 row)
However, there are some oddities:
postgres=# SELECT * FROM (VALUES (1,2)) AS foo(bar,baz);
bar | baz
-----+-----
1 | 2
(1 row)
postgres=# (VALUES (1,2)) AS foo(bar,baz);
ERROR: syntax error at or near "AS"
LINE 1: (VALUES (1,2)) AS foo(bar,baz);
Does the SQL standard have anything to say about assigning identifiers
both to the entire VALUES() statement and to its columns when the
VALUES() statement is by itself?
Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter
Remember to vote!
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 02:50 ` Re: [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-09 13:05 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: Peter Eisentraut <peter_e@gmx.net>
2006-08-09 16:22 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: David Fetter <david@fetter.org>
@ 2006-08-09 17:07 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-09 17:07 UTC (permalink / raw)
To: David Fetter <david@fetter.org>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-hackers@postgresql.org, Gavin Sherry <swm@linuxworld.com.au>; Michael Glaesemann <grzm@seespotcode.net>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
David Fetter <david@fetter.org> writes:
> However, there are some oddities:
> postgres=# SELECT * FROM (VALUES (1,2)) AS foo(bar,baz);
> [ works ]
> postgres=# (VALUES (1,2)) AS foo(bar,baz);
> ERROR: syntax error at or near "AS"
This is per spec. Effectively, AS is part of the FROM-clause syntax
not part of a standalone command. You can't write this either:
regression=# (select 1,2) as foo(bar,baz);
ERROR: syntax error at or near "as"
LINE 1: (select 1,2) as foo(bar,baz);
^
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-03 17:11 ` Peter Eisentraut <peter_e@gmx.net>
2006-08-03 17:48 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
3 siblings, 2 replies; 61+ messages in thread
From: Peter Eisentraut @ 2006-08-03 17:11 UTC (permalink / raw)
To: pgsql-docs; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Gavin Sherry <swm@linuxworld.com.au>; Joe Conway <mail@joeconway.com>
Tom Lane wrote:
> Should we give VALUES its own reference page? That doesn't quite
> seem helpful either. cc'ing to pgsql-docs for ideas.
This is probably the sort of thing that should be explained part II "The
SQL Language". In particular, section 7.2 is about table expressions,
which this is either a case of or related to.
A few examples on the command references pages to show how it can be
useful are probably OK, but the big picture shoulbd be developed in
chapter 7 or so.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
@ 2006-08-03 17:48 ` Joe Conway <mail@joeconway.com>
2006-08-04 00:36 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
1 sibling, 1 reply; 61+ messages in thread
From: Joe Conway @ 2006-08-03 17:48 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Gavin Sherry <swm@linuxworld.com.au>
Peter Eisentraut wrote:
> Tom Lane wrote:
>
>>Should we give VALUES its own reference page? That doesn't quite
>>seem helpful either. cc'ing to pgsql-docs for ideas.
>
> This is probably the sort of thing that should be explained part II "The
> SQL Language". In particular, section 7.2 is about table expressions,
> which this is either a case of or related to.
>
> A few examples on the command references pages to show how it can be
> useful are probably OK, but the big picture shoulbd be developed in
> chapter 7 or so.
>
I'll need some time (perhaps a few weeks because I'm just starting to do
business travel again), but I'll take responsibility to write something
up if you'd like.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-03 17:48 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-04 00:36 ` Gavin Sherry <swm@linuxworld.com.au>
0 siblings, 0 replies; 61+ messages in thread
From: Gavin Sherry @ 2006-08-04 00:36 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
On Thu, 3 Aug 2006, Joe Conway wrote:
> Peter Eisentraut wrote:
> > Tom Lane wrote:
> >
> >>Should we give VALUES its own reference page? That doesn't quite
> >>seem helpful either. cc'ing to pgsql-docs for ideas.
> >
> > This is probably the sort of thing that should be explained part II "The
> > SQL Language". In particular, section 7.2 is about table expressions,
> > which this is either a case of or related to.
> >
> > A few examples on the command references pages to show how it can be
> > useful are probably OK, but the big picture shoulbd be developed in
> > chapter 7 or so.
> >
>
> I'll need some time (perhaps a few weeks because I'm just starting to do
> business travel again), but I'll take responsibility to write something
> up if you'd like.
I'm happy to finish what I started.
Gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
@ 2006-08-04 00:52 ` Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:21 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-11 03:07 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
1 sibling, 2 replies; 61+ messages in thread
From: Gavin Sherry @ 2006-08-04 00:52 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>
On Thu, 3 Aug 2006, Peter Eisentraut wrote:
> Tom Lane wrote:
> > Should we give VALUES its own reference page? That doesn't quite
> > seem helpful either. cc'ing to pgsql-docs for ideas.
>
> This is probably the sort of thing that should be explained part II "The
> SQL Language". In particular, section 7.2 is about table expressions,
> which this is either a case of or related to.
Yes, good idea.
>
> A few examples on the command references pages to show how it can be
> useful are probably OK, but the big picture shoulbd be developed in
> chapter 7 or so.
What do we want to do about documenting:
regression=# values(1);
column1
---------
1
(1 row)
It seems to me that if this isn't in the command reference we'll see an
email every few months say 'is this an undocumented feature?'. We can
cover it easily in Part II, 7.2 but people wont look there. Then again, it
just doesn't seem right to put it in the command reference as a 'top
level' command.
Gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-04 01:21 ` Peter Eisentraut <peter_e@gmx.net>
2006-08-04 01:57 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 02:36 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 2 replies; 61+ messages in thread
From: Peter Eisentraut @ 2006-08-04 01:21 UTC (permalink / raw)
To: Gavin Sherry <swm@linuxworld.com.au>; +Cc: pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>
Gavin Sherry wrote:
> What do we want to do about documenting:
>
> regression=# values(1);
Out of curiosity, according to what theory should that be allowed?
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:21 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
@ 2006-08-04 01:57 ` Gavin Sherry <swm@linuxworld.com.au>
1 sibling, 0 replies; 61+ messages in thread
From: Gavin Sherry @ 2006-08-04 01:57 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>
On Fri, 4 Aug 2006, Peter Eisentraut wrote:
> Gavin Sherry wrote:
> > What do we want to do about documenting:
> >
> > regression=# values(1);
>
> Out of curiosity, according to what theory should that be allowed?
I asked this too. Tom pointed this out (I'd give the URL if I could find
it on archives):
--
You bet. VALUES is parallel to SELECT in the SQL grammar, so AFAICS
it should be legal anywhere you can write SELECT.
The basic productions in the spec's grammar are respectively
<query specification> ::=
SELECT [ <set quantifier> ] <select list>
<table expression>
and
<table value constructor> ::=
VALUES <row value expression list>
--
which seems to be the case from my reading of the spec.
Gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:21 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
@ 2006-08-04 02:36 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-04 07:02 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
1 sibling, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-08-04 02:36 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Gavin Sherry <swm@linuxworld.com.au>; pgsql-docs@postgresql.org, Joe Conway <mail@joeconway.com>
Peter Eisentraut <peter_e@gmx.net> writes:
> Gavin Sherry wrote:
>> What do we want to do about documenting:
>> regression=# values(1);
> Out of curiosity, according to what theory should that be allowed?
Wrong question. SELECT (for the general case of multi-row results)
and VALUES are exactly parallel in the SQL grammar; the right question
is "according to what theory are you allowed to issue a general SELECT?"
AFAICT the SQL spec only envisions "SELECT ... INTO some-variables",
restricted to a single-row result (cf <select statement: single row>
production) as being something a client can issue directly. Every more-
complex case is apparently supposed to be handled by one-row-at-a-time
fetches from a cursor.
If you can persuade the community that they don't want SELECT in its
current form, you might be able to persuade me that VALUES shouldn't
be allowed either.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:21 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 02:36 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-04 07:02 ` Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 61+ messages in thread
From: Peter Eisentraut @ 2006-08-04 07:02 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Gavin Sherry <swm@linuxworld.com.au>; pgsql-docs@postgresql.org, Joe Conway <mail@joeconway.com>
Tom Lane wrote:
> Wrong question. SELECT (for the general case of multi-row results)
> and VALUES are exactly parallel in the SQL grammar; the right
> question is "according to what theory are you allowed to issue a
> general SELECT?"
The "top-level" SELECT for interactive use is
<direct SQL statement> ::= <directly executable statement> <semicolon>
<directly executable statement> ::= <direct SQL data statement> | ...
<direct SQL data statement> ::= <direct select statement: multiple rows> | ...
But this actually does resolve as just VALUES (something), so nevermind.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-11 03:07 ` Bruce Momjian <bruce@momjian.us>
2006-08-11 04:35 ` Re: Values list-of-targetlists patch for comments (was Re: Michael Glaesemann <grzm@seespotcode.net>
1 sibling, 1 reply; 61+ messages in thread
From: Bruce Momjian @ 2006-08-11 03:07 UTC (permalink / raw)
To: Gavin Sherry <swm@linuxworld.com.au>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>
Gavin Sherry wrote:
> > A few examples on the command references pages to show how it can be
> > useful are probably OK, but the big picture shoulbd be developed in
> > chapter 7 or so.
>
> What do we want to do about documenting:
>
> regression=# values(1);
> column1
> ---------
> 1
> (1 row)
>
> It seems to me that if this isn't in the command reference we'll see an
> email every few months say 'is this an undocumented feature?'. We can
> cover it easily in Part II, 7.2 but people wont look there. Then again, it
> just doesn't seem right to put it in the command reference as a 'top
> level' command.
How many people are going to think of doing a VALUES(1)? Isn't it just
like SELECT 1? We can try making VALUES a non-toplevel command, and if
people get confused, we can promote in the documenation. I think
starting it at top-level is perhaps confusing.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-11 03:07 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
@ 2006-08-11 04:35 ` Michael Glaesemann <grzm@seespotcode.net>
0 siblings, 0 replies; 61+ messages in thread
From: Michael Glaesemann @ 2006-08-11 04:35 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Gavin Sherry <swm@linuxworld.com.au>; Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>; Joe Conway <mail@joeconway.com>
On Aug 11, 2006, at 12:07 , Bruce Momjian wrote:
> Gavin Sherry wrote:
>>> A few examples on the command references pages to show how it can be
>>> useful are probably OK, but the big picture shoulbd be developed in
>>> chapter 7 or so.
>>
>> What do we want to do about documenting:
>>
>> regression=# values(1);
>> column1
>> ---------
>> 1
>> (1 row)
>>
>> It seems to me that if this isn't in the command reference we'll
>> see an
>> email every few months say 'is this an undocumented feature?'. We can
>> cover it easily in Part II, 7.2 but people wont look there. Then
>> again, it
>> just doesn't seem right to put it in the command reference as a 'top
>> level' command.
>
> How many people are going to think of doing a VALUES(1)? Isn't it
> just
> like SELECT 1? We can try making VALUES a non-toplevel command,
> and if
> people get confused, we can promote in the documenation. I think
> starting it at top-level is perhaps confusing.
Perhaps it may be confusing, but at the same time, it's educational
to put VALUES at the top level. Having not read the SQL spec in
detail, I do rely on the Postgres documentation as a quick reference.
Thanks to the high-level of SQL-spec compliance, the Postgres
documentation is pretty helpful in that way. And I'm always
pleasantly surprised when I learn something new just from looking
indices such as this.
Michael Glaesemann
grzm seespotcode net
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-04 00:40 ` Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 04:43 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Pavel Stehule <pavel.stehule@hotmail.com>
3 siblings, 1 reply; 61+ messages in thread
From: Gavin Sherry @ 2006-08-04 00:40 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
On Thu, 3 Aug 2006, Tom Lane wrote:
> Gavin Sherry <swm@linuxworld.com.au> writes:
> > Docs and regression tests attached.
>
> I've applied the regression tests (with a few additions), but I'm
> feeling dissatisfied with this approach to documenting VALUES.
> It seems to be mostly missing the point about VALUES being usable
> whereever SELECT is. I'm not at all sure what I'd do instead though.
> Should we give VALUES its own reference page? That doesn't quite
> seem helpful either. cc'ing to pgsql-docs for ideas.
Good point. One question: are we happy calling this a 'VALUES list'? It's
better than a 'table value constructor'. I took the lead from a comment in the
source.
Thanks,
gavin
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-04 00:40 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-04 04:43 ` Pavel Stehule <pavel.stehule@hotmail.com>
0 siblings, 0 replies; 61+ messages in thread
From: Pavel Stehule @ 2006-08-04 04:43 UTC (permalink / raw)
To: swm@linuxworld.com.au; tgl@sss.pgh.pa.us; +Cc: mail@joeconway.com; pgsql-patches@postgresql.org; pgsql-docs
>
>Good point. One question: are we happy calling this a 'VALUES list'? It's
>better than a 'table value constructor'. I took the lead from a comment in
>the
>source.
>
table value constructor is name from ANSI. All people wiil find t.v.c., not
values list. I vote table value constructor.
Regards
Pavel Stehule
_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-04 20:35 ` Simon Riggs <simon@2ndquadrant.com>
3 siblings, 0 replies; 61+ messages in thread
From: Simon Riggs @ 2006-08-04 20:35 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Gavin Sherry <swm@linuxworld.com.au>; Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org; pgsql-docs
On Thu, 2006-08-03 at 10:58 -0400, Tom Lane wrote:
> Gavin Sherry <swm@linuxworld.com.au> writes:
> > Docs and regression tests attached.
>
> I've applied the regression tests (with a few additions), but I'm
> feeling dissatisfied with this approach to documenting VALUES.
> It seems to be mostly missing the point about VALUES being usable
> whereever SELECT is. I'm not at all sure what I'd do instead though.
> Should we give VALUES its own reference page? That doesn't quite
> seem helpful either. cc'ing to pgsql-docs for ideas.
The DB2 manual does exactly that and is not any clearer as a result,
even if it is fully normalised.
If we did that we'd need to emphasise that VALUES is more of a clause
than a new command.
--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
@ 2006-08-02 02:38 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-02 02:38 UTC (permalink / raw)
To: Gavin Sherry <swm@linuxworld.com.au>; +Cc: Joe Conway <mail@joeconway.com>; pgsql-patches@postgresql.org
Gavin Sherry <swm@linuxworld.com.au> writes:
> Is this intentional:
> template1=# values(1), (2);
> column1
> ---------
> 1
> 2
> (2 rows)
You bet. VALUES is parallel to SELECT in the SQL grammar, so AFAICS
it should be legal anywhere you can write SELECT.
The basic productions in the spec's grammar are respectively
<query specification> ::=
SELECT [ <set quantifier> ] <select list>
<table expression>
and
<table value constructor> ::=
VALUES <row value expression list>
and both of them link into the rest of the grammar here:
<simple table> ::=
<query specification>
| <table value constructor>
| <explicit table>
There is no construct I can find in the spec grammar that allows
<query specification> but not <table value constructor>. QED.
Try some stuff like
DECLARE c CURSOR FOR VALUES ...
WHERE foo IN (VALUES ...
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 01:17 ` Joe Conway <mail@joeconway.com>
5 siblings, 0 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-02 01:17 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org
Tom Lane wrote:
> Here's what I've got so far. I think there's probably more gold to be
> mined in terms of reducing runtime memory consumption (I don't like the
> list_free_deep bit, we should use a context), but functionally it seems
> complete. I'm off to dinner again, it's in your court to look over some
> more if you want.
OK, I'll continue to look at it this week.
> (PS: if you want to apply, go ahead, don't forget catversion bump.)
>
Sure, I'll commit shortly.
Thanks,
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 02:10 ` Joe Conway <mail@joeconway.com>
5 siblings, 0 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-02 02:10 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org, Bruce Momjian <pgman@candle.pha.pa.us>
Tom Lane wrote:
> Here's what I've got so far. I think there's probably more gold to be
> mined in terms of reducing runtime memory consumption (I don't like the
> list_free_deep bit, we should use a context), but functionally it seems
> complete. I'm off to dinner again, it's in your court to look over some
> more if you want.
>
> (PS: if you want to apply, go ahead, don't forget catversion bump.)
Committed, with catversion bump.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 05:26 ` Joe Conway <mail@joeconway.com>
5 siblings, 0 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-02 05:26 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org
Tom Lane wrote:
> Here's what I've got so far. I think there's probably more gold to be
> mined in terms of reducing runtime memory consumption (I don't like the
> list_free_deep bit, we should use a context), but functionally it seems
> complete.
I checked out memory usage, and it had regressed to about 1.4 GB (from
730 MB as reported yesterday) for 2 million inserts of 2 integers (i.e.
with the php script I've been using).
I know you're not too happy with the attached approach to solving this,
but I'm not sure how creating a memory context is going to help. Part of
the problem is that the various transformXXX functions sometimes return
freshly palloc'd memory, and sometimes return the pointer they are given.
Anyway, with the attached diff, the 2 million inserts case is back to
about 730 MB memory use, and speed is pretty much the same as reported
yesterday (i.e both memory use and performance better than mysql with
innodb tables).
Thoughts?
Thanks,
Joe
Attachments:
multi-insert-memleak.r00.diff (text/x-patch, 3.2K) download
Index: src/backend/parser/analyze.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/analyze.c,v
retrieving revision 1.341
diff -c -r1.341 analyze.c
*** src/backend/parser/analyze.c 2 Aug 2006 01:59:46 -0000 1.341
--- src/backend/parser/analyze.c 2 Aug 2006 05:13:20 -0000
***************
*** 872,877 ****
--- 872,878 ----
foreach(lc, exprlist)
{
Expr *expr = (Expr *) lfirst(lc);
+ Expr *p = expr;
ResTarget *col;
col = (ResTarget *) lfirst(icols);
***************
*** 885,893 ****
--- 886,898 ----
result = lappend(result, expr);
+ if (expr != p)
+ pfree(p);
+
icols = lnext(icols);
attnos = lnext(attnos);
}
+ list_free(exprlist);
return result;
}
***************
*** 2191,2196 ****
--- 2196,2202 ----
for (i = 0; i < sublist_length; i++)
{
coltypes[i] = select_common_type(coltype_lists[i], "VALUES");
+ list_free(coltype_lists[i]);
}
newExprsLists = NIL;
***************
*** 2203,2216 ****
foreach(lc2, sublist)
{
Node *col = (Node *) lfirst(lc2);
- col = coerce_to_common_type(pstate, col, coltypes[i], "VALUES");
- newsublist = lappend(newsublist, col);
i++;
}
newExprsLists = lappend(newExprsLists, newsublist);
}
/*
* Generate the VALUES RTE
--- 2209,2228 ----
foreach(lc2, sublist)
{
Node *col = (Node *) lfirst(lc2);
+ Node *new_col;
+
+ new_col = coerce_to_common_type(pstate, col, coltypes[i], "VALUES");
+ newsublist = lappend(newsublist, new_col);
+ if (new_col != col)
+ pfree(col);
i++;
}
newExprsLists = lappend(newExprsLists, newsublist);
+ list_free(sublist);
}
+ list_free(exprsLists);
/*
* Generate the VALUES RTE
Index: src/backend/parser/parse_target.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/parse_target.c,v
retrieving revision 1.147
diff -c -r1.147 parse_target.c
*** src/backend/parser/parse_target.c 2 Aug 2006 01:59:47 -0000 1.147
--- src/backend/parser/parse_target.c 2 Aug 2006 05:13:21 -0000
***************
*** 172,177 ****
--- 172,178 ----
foreach(lc, exprlist)
{
Node *e = (Node *) lfirst(lc);
+ Node *p = e;
/*
* Check for "something.*". Depending on the complexity of the
***************
*** 188,193 ****
--- 189,195 ----
result = list_concat(result,
ExpandColumnRefStar(pstate, cref,
false));
+ pfree(e);
continue;
}
}
***************
*** 203,208 ****
--- 205,211 ----
result = list_concat(result,
ExpandIndirectionStar(pstate, ind,
false));
+ pfree(e);
continue;
}
}
***************
*** 210,218 ****
/*
* Not "something.*", so transform as a single expression
*/
! result = lappend(result,
! transformExpr(pstate, e));
}
return result;
}
--- 213,224 ----
/*
* Not "something.*", so transform as a single expression
*/
! p = transformExpr(pstate, e);
! result = lappend(result, p);
! if (e != p)
! pfree(e);
}
+ list_free(exprlist);
return result;
}
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 05:50 ` Joshua D. Drake <jd@commandprompt.com>
5 siblings, 0 replies; 61+ messages in thread
From: Joshua D. Drake @ 2006-08-02 05:50 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-patches@postgresql.org
>
> Anyway, with the attached diff, the 2 million inserts case is back to
> about 730 MB memory use, and speed is pretty much the same as reported
> yesterday (i.e both memory use and performance better than mysql with
> innodb tables).
That's all that matters ;)
Joshua D. Drake
--
=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 05:52 ` Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
5 siblings, 1 reply; 61+ messages in thread
From: Joe Conway @ 2006-08-02 05:52 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org
Joe Conway wrote:
> Tom Lane wrote:
>
>> Here's what I've got so far. I think there's probably more gold to be
>> mined in terms of reducing runtime memory consumption (I don't like the
>> list_free_deep bit, we should use a context), but functionally it seems
>> complete.
>
> I checked out memory usage, and it had regressed to about 1.4 GB (from
> 730 MB as reported yesterday) for 2 million inserts of 2 integers (i.e.
> with the php script I've been using).
>
> I know you're not too happy with the attached approach to solving this,
> but I'm not sure how creating a memory context is going to help. Part of
> the problem is that the various transformXXX functions sometimes return
> freshly palloc'd memory, and sometimes return the pointer they are given.
>
> Anyway, with the attached diff, the 2 million inserts case is back to
> about 730 MB memory use, and speed is pretty much the same as reported
> yesterday (i.e both memory use and performance better than mysql with
> innodb tables).
Of course it also breaks a bunch of regression tests -- I guess that
just points to the fragility of this approach.
This patch retains the memory consumption savings but doesn't break any
regression tests...
Joe
Attachments:
multi-insert-memleak.r01.diff (text/x-patch, 2.9K) download
? src/test/regress/sql/insert.sql.new
Index: src/backend/parser/analyze.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/analyze.c,v
retrieving revision 1.341
diff -c -r1.341 analyze.c
*** src/backend/parser/analyze.c 2 Aug 2006 01:59:46 -0000 1.341
--- src/backend/parser/analyze.c 2 Aug 2006 05:48:18 -0000
***************
*** 888,893 ****
--- 888,894 ----
icols = lnext(icols);
attnos = lnext(attnos);
}
+ list_free(exprlist);
return result;
}
***************
*** 2191,2196 ****
--- 2192,2198 ----
for (i = 0; i < sublist_length; i++)
{
coltypes[i] = select_common_type(coltype_lists[i], "VALUES");
+ list_free(coltype_lists[i]);
}
newExprsLists = NIL;
***************
*** 2203,2216 ****
foreach(lc2, sublist)
{
Node *col = (Node *) lfirst(lc2);
- col = coerce_to_common_type(pstate, col, coltypes[i], "VALUES");
- newsublist = lappend(newsublist, col);
i++;
}
newExprsLists = lappend(newExprsLists, newsublist);
}
/*
* Generate the VALUES RTE
--- 2205,2224 ----
foreach(lc2, sublist)
{
Node *col = (Node *) lfirst(lc2);
+ Node *new_col;
+
+ new_col = coerce_to_common_type(pstate, col, coltypes[i], "VALUES");
+ newsublist = lappend(newsublist, new_col);
+ if (new_col != col)
+ pfree(col);
i++;
}
newExprsLists = lappend(newExprsLists, newsublist);
+ list_free(sublist);
}
+ list_free(exprsLists);
/*
* Generate the VALUES RTE
Index: src/backend/parser/parse_target.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/parser/parse_target.c,v
retrieving revision 1.147
diff -c -r1.147 parse_target.c
*** src/backend/parser/parse_target.c 2 Aug 2006 01:59:47 -0000 1.147
--- src/backend/parser/parse_target.c 2 Aug 2006 05:48:18 -0000
***************
*** 172,177 ****
--- 172,178 ----
foreach(lc, exprlist)
{
Node *e = (Node *) lfirst(lc);
+ Node *p = e;
/*
* Check for "something.*". Depending on the complexity of the
***************
*** 188,193 ****
--- 189,195 ----
result = list_concat(result,
ExpandColumnRefStar(pstate, cref,
false));
+ pfree(e);
continue;
}
}
***************
*** 203,208 ****
--- 205,211 ----
result = list_concat(result,
ExpandIndirectionStar(pstate, ind,
false));
+ pfree(e);
continue;
}
}
***************
*** 210,218 ****
/*
* Not "something.*", so transform as a single expression
*/
! result = lappend(result,
! transformExpr(pstate, e));
}
return result;
}
--- 213,224 ----
/*
* Not "something.*", so transform as a single expression
*/
! p = transformExpr(pstate, e);
! result = lappend(result, p);
! if (e != p)
! pfree(e);
}
+ list_free(exprlist);
return result;
}
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-02 13:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
0 siblings, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-08-02 13:43 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: pgsql-patches@postgreSQL.org
Joe Conway <mail@joeconway.com> writes:
> This patch retains the memory consumption savings but doesn't break any
> regression tests...
I'm unconvinced that retail pfree's are the way to go. I just did some
profiling of this test case:
insert into foo values
(0,0,0),
(1,1,1),
(2,2,2),
(3,3,3),
... one million rows ...
(999997,999997,999997),
(999998,999998,999998),
(999999,999999,999999);
using CVS tip, and got these oprofile results:
samples % symbol name
39742 10.1656 base_yyparse
38338 9.8065 XLogInsert
28247 7.2253 AllocSetAlloc
20490 5.2411 expression_tree_walker
16822 4.3029 ExecInitExpr
16469 4.2126 base_yylex
14789 3.7829 PageAddItem
11174 2.8582 LWLockAcquire
11167 2.8564 LWLockRelease
9195 2.3520 RewriteQuery
9120 2.3328 AllocSetFree
7788 1.9921 ExecInitValuesScan
7596 1.9430 ExecEvalConst
7586 1.9404 lappend
6860 1.7547 ValuesNext
6261 1.6015 heap_fill_tuple
6141 1.5708 MemoryContextAllocZeroAligned
5619 1.4373 fix_expr_references_walker
5613 1.4357 transformExpressionList
5269 1.3478 heap_insert
5177 1.3242 contain_vars_of_level_walker
4601 1.1769 heap_form_tuple
4345 1.1114 ExecutorRun
4299 1.0996 hash_any
4201 1.0746 MemoryContextAlloc
4061 1.0388 check_stack_depth
It's slightly depressing that there's not more time being spent in
places we can easily tweak, but anyway the salient point to me is
that AllocSetFree is already chewing a nontrivial part of the runtime.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 13:58 ` Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 61+ messages in thread
From: Joe Conway @ 2006-08-02 13:58 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>
>>This patch retains the memory consumption savings but doesn't break any
>>regression tests...
>
>
> I'm unconvinced that retail pfree's are the way to go. I just did some
> profiling of this test case:
<snip>
> It's slightly depressing that there's not more time being spent in
> places we can easily tweak, but anyway the salient point to me is
> that AllocSetFree is already chewing a nontrivial part of the runtime.
That's undoubtedly true, and important for the case that isn't memory
constrained (but where I'm already seeing us perform relatively well).
But once we start the machine swapping, runtime goes in the toilet. And
without addressing the memory leak somehow, we will start a machine
swapping significantly earlier than mysql.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-02 14:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 14:42 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
0 siblings, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-08-02 14:25 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: pgsql-patches@postgreSQL.org
Joe Conway <mail@joeconway.com> writes:
> That's undoubtedly true, and important for the case that isn't memory
> constrained (but where I'm already seeing us perform relatively well).
> But once we start the machine swapping, runtime goes in the toilet. And
> without addressing the memory leak somehow, we will start a machine
> swapping significantly earlier than mysql.
I'm not arguing that we don't need to work on the memory usage ... just
that I'm not very happy with that particular approach.
I wonder whether there is any reasonable way to determine which data
structures are responsible for how much space ... in my test I'm seeing
MessageContext: 822075440 total in 104 blocks; 4510280 free (1 chunks); 817565160 used
ExecutorState: 8024624 total in 3 blocks; 20592 free (12 chunks); 8004032 used
so it seems mostly not the executor's fault, but that's not much to go
on.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 14:42 ` Joe Conway <mail@joeconway.com>
2006-08-02 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 61+ messages in thread
From: Joe Conway @ 2006-08-02 14:42 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org
Tom Lane wrote:
>
> I wonder whether there is any reasonable way to determine which data
> structures are responsible for how much space ... in my test I'm seeing
>
> MessageContext: 822075440 total in 104 blocks; 4510280 free (1 chunks); 817565160 used
> ExecutorState: 8024624 total in 3 blocks; 20592 free (12 chunks); 8004032 used
>
> so it seems mostly not the executor's fault, but that's not much to go
> on.
I was doing it by sprinkling MemoryContextStats() in various places.
I'll spend some time again later today and see if I can narrow it down
to specific data structures using that. It shouldn't be too hard -- the
patch I sent last night only pfrees a few structures, and they represent
the bulk of what we need to clean up.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 14:42 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-02 15:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 18:10 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
0 siblings, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-08-02 15:56 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: pgsql-patches@postgreSQL.org
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> I wonder whether there is any reasonable way to determine which data
>> structures are responsible for how much space ... in my test I'm seeing
> I was doing it by sprinkling MemoryContextStats() in various places.
Yeah, I've just been doing that and some hand analysis too. What I get
(on a 64-bit machine) is that essentially all the space goes into
lists of A_Const lists: 320000000
lists of Const lists: 320000000
transformInsertRow extra lists: 144000000
I think we could safely list_free the input list in transformInsertRow
as your patch suggests, which would buy back the 144M part. But I don't
believe it's safe at all to free the raw_parser output --- the grammar
sometimes makes multiple links to the same subtree, eg in BETWEEN.
In any case the patch as proposed wouldn't catch all the detritus for
any case more complicated than a simple integer constant.
The way that the list memory usage works (again, 64-bit machine) is
sizeof(List) = 24
sizeof(ListCell) = 16
sizeof(A_Const) = 32
Each of these nodes will have 16 bytes palloc overhead, and the List
header will be rounded up to 32 bytes as well, so we have total space
for a 3-element integer list of
32+16 + (16+16 + 32+16) * 3
Add in 16+16 for the associated ListCell of the top list-of-lists,
and you come to 320 bytes per sublist. Const happens to also be
32 bytes so the transformed lists are the same size.
It's interesting to reflect on the fact that this comes to 184 bytes
of useful data and 136 bytes of palloc overhead per row ... not sure
if we can do much about the overhead though.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 14:42 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 18:10 ` Joe Conway <mail@joeconway.com>
2006-08-02 18:59 ` Re: Values list-of-targetlists patch for comments (was Re: Alvaro Herrera <alvherre@commandprompt.com>
2006-08-02 19:18 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-02 18:10 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-patches@postgreSQL.org
Tom Lane wrote:
> Yeah, I've just been doing that and some hand analysis too. What I get
> (on a 64-bit machine) is that essentially all the space goes into
>
> lists of A_Const lists: 320000000
> lists of Const lists: 320000000
> transformInsertRow extra lists: 144000000
>
> I think we could safely list_free the input list in transformInsertRow
> as your patch suggests, which would buy back the 144M part. But I don't
> believe it's safe at all to free the raw_parser output --- the grammar
> sometimes makes multiple links to the same subtree, eg in BETWEEN.
> In any case the patch as proposed wouldn't catch all the detritus for
> any case more complicated than a simple integer constant.
:-(
> The way that the list memory usage works (again, 64-bit machine) is
>
> sizeof(List) = 24
> sizeof(ListCell) = 16
> sizeof(A_Const) = 32
>
> Each of these nodes will have 16 bytes palloc overhead, and the List
> header will be rounded up to 32 bytes as well, so we have total space
> for a 3-element integer list of
> 32+16 + (16+16 + 32+16) * 3
> Add in 16+16 for the associated ListCell of the top list-of-lists,
> and you come to 320 bytes per sublist. Const happens to also be
> 32 bytes so the transformed lists are the same size.
What if we built an array of A_Const nodes instead of a List? Maybe we
could use something akin to appendStringInfo()/enlargeStringInfo() to
build the array of nodes and enlarge it in chunks.
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 14:42 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 18:10 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-02 18:59 ` Alvaro Herrera <alvherre@commandprompt.com>
1 sibling, 0 replies; 61+ messages in thread
From: Alvaro Herrera @ 2006-08-02 18:59 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-patches@postgreSQL.org
Joe Conway wrote:
> What if we built an array of A_Const nodes instead of a List? Maybe we
> could use something akin to appendStringInfo()/enlargeStringInfo() to
> build the array of nodes and enlarge it in chunks.
In inval.c you find this:
/*
* To minimize palloc traffic, we keep pending requests in successively-
* larger chunks (a slightly more sophisticated version of an expansible
* array). All request types can be stored as SharedInvalidationMessage
* records. The ordering of requests within a list is never significant.
*/
typedef struct InvalidationChunk
{
struct InvalidationChunk *next; /* list link */
int nitems; /* # items currently stored in chunk */
int maxitems; /* size of allocated array in this chunk */
SharedInvalidationMessage msgs[1]; /* VARIABLE LENGTH ARRAY */
} InvalidationChunk; /* VARIABLE LENGTH STRUCTURE */
Which might give you an idea ...
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 14:42 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 18:10 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
@ 2006-08-02 19:18 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-02 19:18 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: pgsql-patches@postgreSQL.org
Joe Conway <mail@joeconway.com> writes:
> What if we built an array of A_Const nodes instead of a List? Maybe we
> could use something akin to appendStringInfo()/enlargeStringInfo() to
> build the array of nodes and enlarge it in chunks.
For lists this short I'm not sure how much of a win it'd be. It's
interesting though to think about doing something like that within the
List abstraction itself. We did a "fastlist" hack once before and it
was a crock ... don't want to do that again. But now that we've got a
distinction between List and ListCell you could imagine that a List
header has a small private array of ListCells ... tuning the size might
be tricky though.
Another thing we could consider is flattening the double-level list into
a single list ... probably be a pain notationally, but it'd save one
List header and one ListCell per VALUES sublist. And it would offer
more traction for an array-inside-Lists optimization.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?)
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-08-02 02:52 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 61+ messages in thread
From: Tom Lane @ 2006-08-02 02:52 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Joe Conway <mail@joeconway.com> writes:
> Tom Lane wrote:
>> What I'm inclined to do for 8.2 is to disallow OLD/NEW references in
>> multi-element VALUES clauses; the feature is still tremendously useful
>> without that.
> Given the timing, this sounds like a reasonable approach. I agree that
> the feature has lots of interesting uses -- I'd hate to see us lose
> that. Disallowing OLD/NEW references doesn't contradict the spec in any
> way AFAIK either.
I don't think rules are in the spec at all ;-) ... so no, that's not
a problem. My example demonstrated a pretty likely use:
create rule r2 as on update to src do
insert into log values(old.*, 'old'), (new.*, 'new');
but for the moment we can tell people to work around it the way
they always have:
create rule r2 as on update to src do
insert into log select old.*, 'old' union all new.*, 'new';
or just use two separate INSERT commands in the rule.
We oughta fix it later, but I don't feel ashamed to have a restriction
like this in the first cut.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-08-02 03:14 ` Bruce Momjian <bruce@momjian.us>
2006-08-02 03:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
0 siblings, 1 reply; 61+ messages in thread
From: Bruce Momjian @ 2006-08-02 03:14 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Joe Conway <mail@joeconway.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Should we wait for someone to actually ask for this before adding it to
the TODO list? Does it cause a crash now?
---------------------------------------------------------------------------
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> > Tom Lane wrote:
> >> What I'm inclined to do for 8.2 is to disallow OLD/NEW references in
> >> multi-element VALUES clauses; the feature is still tremendously useful
> >> without that.
>
> > Given the timing, this sounds like a reasonable approach. I agree that
> > the feature has lots of interesting uses -- I'd hate to see us lose
> > that. Disallowing OLD/NEW references doesn't contradict the spec in any
> > way AFAIK either.
>
> I don't think rules are in the spec at all ;-) ... so no, that's not
> a problem. My example demonstrated a pretty likely use:
>
> create rule r2 as on update to src do
> insert into log values(old.*, 'old'), (new.*, 'new');
>
> but for the moment we can tell people to work around it the way
> they always have:
>
> create rule r2 as on update to src do
> insert into log select old.*, 'old' union all new.*, 'new';
>
> or just use two separate INSERT commands in the rule.
>
> We oughta fix it later, but I don't feel ashamed to have a restriction
> like this in the first cut.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
@ 2006-08-02 03:47 ` Joe Conway <mail@joeconway.com>
2006-08-02 06:54 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-02 13:30 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
0 siblings, 2 replies; 61+ messages in thread
From: Joe Conway @ 2006-08-02 03:47 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Bruce Momjian wrote:
> Should we wait for someone to actually ask for this before adding it
> to the TODO list?
Probably worth adding it to the TODO list so it doen't get lost.
> Does it cause a crash now?
Nope:
regression=# create table log(f1 int, f2 int, tag text);
CREATE TABLE
regression=# insert into src values(1,2);
INSERT 0 1
regression=# create rule r2 as on update to src do insert into log
values(old.*, 'old'), (new.*, 'new');
ERROR: VALUES must not contain OLD or NEW references
Joe
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re: [PATCHES]
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
2006-08-02 03:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-08-02 06:54 ` Michael Glaesemann <grzm@seespotcode.net>
2006-08-02 13:30 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 61+ messages in thread
From: Michael Glaesemann @ 2006-08-02 06:54 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Tom Lane <tgl@sss.pgh.pa.us>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
On Aug 2, 2006, at 12:47 , Joe Conway wrote:
> regression=# create rule r2 as on update to src do insert into log
> values(old.*, 'old'), (new.*, 'new');
> ERROR: VALUES must not contain OLD or NEW references
>
Would it make sense to add a HINT as well, recommending the UNION
construct Tom mentioned earlier?
On Aug 2, 2006, at 11:52 , Tom Lane wrote:
> create rule r2 as on update to src do
> insert into log select old.*, 'old' union all new.*, 'new';
>
> or just use two separate INSERT commands in the rule.
>
Or is the general case too, uh, general for a HINT?
Michael Glaesemann
grzm seespotcode net
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
2006-08-02 03:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 06:54 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
@ 2006-08-02 13:30 ` Bruce Momjian <bruce@momjian.us>
2006-08-02 14:07 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 61+ messages in thread
From: Bruce Momjian @ 2006-08-02 13:30 UTC (permalink / raw)
To: Michael Glaesemann <grzm@seespotcode.net>; +Cc: Joe Conway <mail@joeconway.com>; Tom Lane <tgl@sss.pgh.pa.us>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Michael Glaesemann wrote:
> On Aug 2, 2006, at 12:47 , Joe Conway wrote:
>
>
> > regression=# create rule r2 as on update to src do insert into log
> > values(old.*, 'old'), (new.*, 'new');
> > ERROR: VALUES must not contain OLD or NEW references
> >
>
> Would it make sense to add a HINT as well, recommending the UNION
> construct Tom mentioned earlier?
Agreed.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
2006-08-02 03:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 06:54 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-02 13:30 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
@ 2006-08-02 14:07 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 61+ messages in thread
From: Tom Lane @ 2006-08-02 14:07 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Michael Glaesemann <grzm@seespotcode.net>; Joe Conway <mail@joeconway.com>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Bruce Momjian <bruce@momjian.us> writes:
> Michael Glaesemann wrote:
>> Would it make sense to add a HINT as well, recommending the UNION
>> construct Tom mentioned earlier?
> Agreed.
Done.
regards, tom lane
^ permalink raw reply [nested|flat] 61+ messages in thread
* Re: Values list-of-targetlists patch for comments (was Re:
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Re: Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
2006-08-02 03:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
@ 2006-08-02 13:30 ` Bruce Momjian <bruce@momjian.us>
1 sibling, 0 replies; 61+ messages in thread
From: Bruce Momjian @ 2006-08-02 13:30 UTC (permalink / raw)
To: Joe Conway <mail@joeconway.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Joe Conway wrote:
> Bruce Momjian wrote:
> > Should we wait for someone to actually ask for this before adding it
> > to the TODO list?
>
> Probably worth adding it to the TODO list so it doen't get lost.
Added:
o In rules, allow VALUES() to contain a mixture of 'old' and 'new'
references
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 61+ messages in thread
end of thread, other threads:[~2006-08-11 04:35 UTC | newest]
Thread overview: 61+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-07-24 03:57 Values list-of-targetlists patch for comments (was Re: [HACKERS] 8.2 features?) Joe Conway <mail@joeconway.com>
2006-07-24 06:22 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 16:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 16:32 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-24 17:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-07-24 21:22 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-07-30 01:24 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-07-30 01:35 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-07-30 01:45 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-07-30 01:50 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:15 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:26 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Alvaro Herrera <alvherre@commandprompt.com>
2006-08-01 20:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-01 20:41 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-01 23:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 00:05 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 01:28 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 05:31 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-03 14:58 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:42 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:05 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 02:50 ` Re: [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-09 13:05 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: Peter Eisentraut <peter_e@gmx.net>
2006-08-09 16:22 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: David Fetter <david@fetter.org>
2006-08-09 17:07 ` Re: [HACKERS] [PATCHES] Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-03 17:11 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-03 17:48 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-04 00:36 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 00:52 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 01:21 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-04 01:57 ` Re: Values list-of-targetlists patch for comments (was Re: Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 02:36 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Tom Lane <tgl@sss.pgh.pa.us>
2006-08-04 07:02 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Peter Eisentraut <peter_e@gmx.net>
2006-08-11 03:07 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
2006-08-11 04:35 ` Re: Values list-of-targetlists patch for comments (was Re: Michael Glaesemann <grzm@seespotcode.net>
2006-08-04 00:40 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Gavin Sherry <swm@linuxworld.com.au>
2006-08-04 04:43 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Pavel Stehule <pavel.stehule@hotmail.com>
2006-08-04 20:35 ` Re: Values list-of-targetlists patch for comments (was Re: Simon Riggs <simon@2ndquadrant.com>
2006-08-02 02:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 01:17 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 02:10 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 05:26 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 05:50 ` Re: Values list-of-targetlists patch for comments (was Re: Joshua D. Drake <jd@commandprompt.com>
2006-08-02 05:52 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 13:43 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:58 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 14:25 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 14:42 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 15:56 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 18:10 ` Re: Values list-of-targetlists patch for comments (was Re: Joe Conway <mail@joeconway.com>
2006-08-02 18:59 ` Re: Values list-of-targetlists patch for comments (was Re: Alvaro Herrera <alvherre@commandprompt.com>
2006-08-02 19:18 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 02:52 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] 8.2 features?) Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 03:14 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Bruce Momjian <bruce@momjian.us>
2006-08-02 03:47 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Joe Conway <mail@joeconway.com>
2006-08-02 06:54 ` Re: Values list-of-targetlists patch for comments (was Re: [PATCHES] Michael Glaesemann <grzm@seespotcode.net>
2006-08-02 13:30 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
2006-08-02 14:07 ` Re: Values list-of-targetlists patch for comments (was Re: Tom Lane <tgl@sss.pgh.pa.us>
2006-08-02 13:30 ` Re: Values list-of-targetlists patch for comments (was Re: Bruce Momjian <bruce@momjian.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox