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

Re: [HACKERS] extension for sql update

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Jim Nasby <jnasby(at)pervasive(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Susanne Ebrecht <miracee(at)miracee(dot)de>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] extension for sql update
Date: 2006-07-27 22:02:27
Message-ID: 200607272202.k6RM2RB09421@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Jim Nasby wrote:
> On Jul 27, 2006, at 7:30 AM, Tom Lane wrote:
> > Susanne Ebrecht <miracee(at)miracee(dot)de> writes:
> >> ... We could provide the mixed update syntax and leave the
> >> typed row value expression for the next release. Do you agree?
> >
> > I don't really see the point --- the patch won't provide any new
> > functionality in anything like its current form, because you can
> > always just write the separate expressions in the simple one to
> > one way.  If we do offer the row-on-the-left syntax then people
> > will try to put sub-selects on the right, and won't get anything
> > beyond an unhelpful "syntax error" message.  So my vote would be
> > to leave it alone until we have a more complete implementation.
> 
> While the patch doesn't provide any new functionality, I would still  
> welcome it simply because I find it a lot easier and cleaner to group  
> fields together when updating multiple fields at once.
> 
> Even if we would have to rip this patch back out in order to fully  
> support the spec, we've got a (mostly) working patch right now, and  
> it sounds like it would take minimal effort to finish it.
> 
> In any case, it sounds like there should be a TODO item out of this.

We already had it on the TODO list, but I didn't realize about the
subselect issue.  I added a sentence to clarify that:

        o Allow UPDATE tab SET ROW (col, ...) = (...) for updating multiple
          columns

new-->    A subselect can also be used as the value source.

-- 
  Bruce Momjian   bruce(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2006-07-27 22:13:45
Subject: Re: [COMMITTERS] pgsql: another try at keeping AIX/ppc
Previous:From: Tom LaneDate: 2006-07-27 21:47:40
Subject: Re: [COMMITTERS] pgsql: another try at keeping AIX/ppc

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2006-07-27 23:29:14
Subject: Re: The vacuum-ignore-vacuum patch
Previous:From: Greg StarkDate: 2006-07-27 21:24:35
Subject: Re: [HACKERS] Resurrecting per-page cleaner for btree

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