Re: request for sql3 compliance for the update command

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Dave Cramer <dave(at)fastcrypt(dot)com>
Cc: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: request for sql3 compliance for the update command
Date: 2003-02-19 23:00:51
Message-ID: 200302192300.h1JN0pZ18897@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


While I don't see the syntax of:

update table set (col...) = ( val...)

as valuable compared to separate col=val assignments, I do see a value
in allowing subqueries in such assignments:

update table set (col...) = ( select val ..)

Without it, you have to do separate subquery statements, and if they are
complex, that is a waste. I assume that was the motivation for the
feature.

---------------------------------------------------------------------------

Dave Cramer wrote:
> Patrick,
>
> No, they support the syntax:
>
> update table set (col1, col2, col3) = ( val1, val2, val3 )
>
> I have a customer with a rather large application which uses this
> syntax, because they were using informix. There is also a rather
> interesting 4GL project called aubit which is on sourceforge. They would
> also like to see this supported for the same reasons.
>
> Dave
>
>
> On Wed, 2003-02-19 at 15:02, Patrick Welche wrote:
> > > I have a large customer who is converting from informix to postgres and
> > > they have made extensive use of
> > >
> > > update table set (col...) = ( val...)
> > >
> > > as a first pass would it be possible to translate this in the parser to
> > >
> > > update table set col=val
> > >
> > > It would appear that this is SQL3 compliant
> > >
> > > <set clause> ::=
> > > <update target> <equals operator> <row value designator>
> > >
> > > <update target> ::=
> > > <object column>
> > > | <left paren> <object column list> <right paren>
> > >
> > >
> > > or can someone think of another way?
> >
> > I don't understand the original problem. What does informix give you? A
> > text file full of "update table set ()=()" which you then try to feed
> > into postgres? In that case, why not pass said text file through a sed or
> > perl script first?
> >
> > Cheers,
> >
> > Patrick
> --
> Dave Cramer <dave(at)fastcrypt(dot)com>
> Cramer Consulting
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Aubury 2003-02-19 23:16:00 Re: request for sql3 compliance for the update command
Previous Message Tilo Schwarz 2003-02-19 22:22:44 Re: Changing the default configuration (was Re: [pgsql-advocacy]