Re: bug or feature

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "Carl(dot)Weierstrass" <carl(dot)weierstrass(at)googlemail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: bug or feature
Date: 2026-10-05 14:53:41
Message-ID: cc75fdfb-25da-41a3-8fe7-6b5d9966775e@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/5/26 7:32 AM, David G. Johnston wrote:
> On Monday, October 5, 2026, Carl.Weierstrass
> <carl(dot)weierstrass(at)googlemail(dot)com
> <mailto:carl(dot)weierstrass(at)googlemail(dot)com>> wrote:
>
> but the more elegant version in one single statement results in a
> syntax error
>
> begin;
> insert into test2
> delete from test1
> where 1 = 1
> returning *;  --return deleted lines
> commit;
>
> psql:test.sql:32: FEHLER:  Syntaxfehler bei »delete«
> ZEILE 2: delete from test1
>
> Is this a bug or a feature?
>
>
> If you make something up that isn’t documented it shouldn’t work.  You
> can call the inability to interpret random stuff you send to the server
> a feature if you need an apply a label.
>
> You might want to look at the WITH clause of those commands to see how
> to go about combining multiple distinct commands into one execution
> correctly.

In particular:

https://www.postgresql.org/docs/current/queries-with.html#QUERIES-WITH-MODIFYING

>
> David J.
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2026-10-05 14:57:05 Re: libpq analog of \c
Previous Message David G. Johnston 2026-10-05 14:32:21 Re: bug or feature