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

Re: extension for sql update

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Susanne Ebrecht <miracee(at)miracee(dot)de>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: extension for sql update
Date: 2006-07-27 13:28:05
Message-ID: 200607271328.k6RDS5519882@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> UPDATE mytab SET (foo, bar, baz) =
> >> (SELECT alpha, beta, gamma FROM othertab WHERE key = mytab.key);
> 
> > That UPDATE example is interesting because I remember when using
> > Informix that I had to do a separate SELECT statement for each UPDATE
> > column I wanted to update.  I didn't realize that you could group
> > columns and assign them from a single select --- clearly that is a
> > powerful syntax we should support some day.
> 
> No question.  The decision at hand is whether we want to look like
> we support it, when we don't yet.  I'd vote not, because I think the
> main use-case for the row-on-the-left syntax is exactly this, and
> so I fear people will just get frustrated if they see it in the
> syntax synopsis and try to use it.

Agreed.  My guess is that a soluion that allows SELECT to return
multiple values is going to be in another area of the code, and will
require us to remove this code once that is done.

-- 
  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

Responses

pgsql-hackers by date

Next:From: Joshua ReichDate: 2006-07-27 13:39:07
Subject: Re: [COMMITTERS] pgsql: /contrib/cube improvements: Update
Previous:From: Tom LaneDate: 2006-07-27 13:17:20
Subject: Re: extension for sql update

pgsql-patches by date

Next:From: Joshua ReichDate: 2006-07-27 13:39:07
Subject: Re: [COMMITTERS] pgsql: /contrib/cube improvements: Update
Previous:From: Bruce MomjianDate: 2006-07-27 13:20:21
Subject: Re: LDAP lookup of connection parameters

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