Skip site navigation (1) Skip section navigation (2)

Re: extension for sql update

From: Susanne Ebrecht <miracee(at)miracee(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: extension for sql update
Date: 2006-07-27 09:36:35
Message-ID: 1153992995.4811.24.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Am Mittwoch, den 26.07.2006, 16:58 -0400 schrieb Tom Lane:
> Susanne Ebrecht <miracee(at)miracee(dot)de> writes:

> This is a cute hack, but it does only a small part of what I think the
> spec says.
Thank you for compliment.

> 
> In the first place, the SQL syntax is pretty clear that you can combine
> simple and multiple assignment in the same UPDATE:

Ups, I asked about mixed syntax and I missunderstood the answer (I
thougt there is nothing spezified about mixed syntax). But fixing this,
seems not to be difficult.

> The patch doesn't do that, but it wouldn't be too hard to fix.  The more
> serious problem is that
> 
>          <assigned row> ::= <contextually typed row value expression>
> 
> and <contextually typed row value expression> is supposed to be pretty
> much anything that can generate a row.  The patch as you have it
> provides nothing more than syntactic sugar for something people can do
> anyway.  The reason people want this syntax is that they expect to be
> able to write, say,
> 
> 	UPDATE mytab SET (foo, bar, baz) =
> 	    (SELECT alpha, beta, gamma FROM othertab WHERE key = mytab.key);
> 
> and with something like that you can't break apart the row-valued
> expression in the grammar.  So in reality the feature has to propagate
> much further into the backend than this.

This seems to be difficult and I'm not sure this could be done until
feature freeze. We could provide the mixed update syntax and leave the
typed row value expression for the next release. Do you agree?

regards 
Susanne Ebrecht

In response to

Responses

pgsql-hackers by date

Next:From: ITAGAKI TakahiroDate: 2006-07-27 09:46:07
Subject: Re: Resurrecting per-page cleaner for btree
Previous:From: Peter EisentrautDate: 2006-07-27 08:33:50
Subject: Re: GUC with units, details

pgsql-patches by date

Next:From: ITAGAKI TakahiroDate: 2006-07-27 09:46:07
Subject: Re: Resurrecting per-page cleaner for btree
Previous:From: Tatsuo IshiiDate: 2006-07-27 06:00:22
Subject: pgbench patches

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group