Re: execute block like Firebird does - Mailing list pgsql-general

From PegoraroF10
Subject Re: execute block like Firebird does
Date
Msg-id 1518443301602-0.post@n3.nabble.com
Whole thread Raw
In response to Re: execute block like Firebird does  (Thiemo Kellner <thiemo@gelassene-pferde.biz>)
Responses Re: execute block like Firebird does  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: execute block like Firebird does  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: execute block like Firebird does  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-general
We can change all those execute blocks, but it would be a huge work if we
need to rewrite them all.
Today, just for a test, I replaced a Firebird execute block to a Postgres
CTE. OK, worked but I spend 40 minutes and the problem is that we have
hundreds of these execute blocks and on each one we need to rethink,
rewrite, retest.

When we changed all our triggers and procedures from Firebird to PostGres we
needed only to rewrite "first 1" to "limit 1", "starting with" to "like" as
examples. So, just a Search and Replace will do solve it.

And now if PostGres doesn´t have something similar to Execute Block we have
to change lots of things. As you may know, change a function body to a CTE
is not so trivial.

Another approach to solve my problem would be a function that receives a
dynamic SQL, runs it and returns a XML or JSON and on client side I convert
that XML back to a recordset. Is that possible ?



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html


pgsql-general by date:

Previous
From: "Charles Clavadetscher"
Date:
Subject: RE: Remove default privilege from DB
Next
From: Magnus Hagander
Date:
Subject: Re: New Copy Formats - avro/orc/parquet