Return cols and rows via stored procedure - Mailing list pgsql-general

From Robert James
Subject Return cols and rows via stored procedure
Date
Msg-id CAGYyBggtqT8jhgOz5pcaBcrRMYLKYTT5dqJBg-2k+6ri2opsuQ@mail.gmail.com
Whole thread Raw
Responses Re: Return cols and rows via stored procedure  (David Johnston <polobo@yahoo.com>)
List pgsql-general
I'd like a stored procedure which does something like:

INSERT INTO...
SELECT... -- This should be returned as multicolumn, multifield - just
like a table or view

When I run it, though, instead of getting a table, I get one field
with all the data in it as a compound type.  I'd like to return the
results just like a view.

How do I do that?

Additionally, I'd like to put a:
DELETE...
at the end, but still return the SELECT (i.e. what SELECT said before
the DELETE).  Is that possible?

Finally, my preference is to do all this in a SQL stored procedure,
not PL/pgSQL or PL/anythingelse.

Thanks!


pgsql-general by date:

Previous
From: BladeOfLight16
Date:
Subject: Re: Update big table
Next
From: David Johnston
Date:
Subject: Re: Return cols and rows via stored procedure