Re: bug or feature - Mailing list pgsql-general

From David G. Johnston
Subject Re: bug or feature
Date
Msg-id CAKFQuwZqm+d02pJAK0T3xGwds3sFpritkSW1aROjzO+GUGXMaA@mail.gmail.com
Whole thread
In response to bug or feature  ("Carl.Weierstrass" <carl.weierstrass@googlemail.com>)
Responses Re: bug or feature
List pgsql-general
On Monday, October 5, 2026, Carl.Weierstrass <carl.weierstrass@googlemail.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.

David J.

pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: bug or feature
Next
From: Adrian Klaver
Date:
Subject: Re: bug or feature