pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PegoraroF10 <marcos@f10.com.br>
To: pgsql-general@postgresql.org
Subject: Re: execute block like Firebird does
Date: Mon, 12 Feb 2018 06:48:21 -0700 (MST)
Message-ID: <1518443301602-0.post@n3.nabble.com> (raw)
In-Reply-To: <9fa5f7c2-b6ca-ccfd-fded-284359f973c4@gelassene-pferde.biz>
References: <1518328644815-0.post@n3.nabble.com>
	<9fa5f7c2-b6ca-ccfd-fded-284359f973c4@gelassene-pferde.biz>

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




view thread (23+ messages)  latest in thread

Message-ID: <1518443301602-0.post@n3.nabble.com>
Permalink:  ../1518443301602-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1518443301602-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: marcos@f10.com.br
  Subject: Re: execute block like Firebird does
  In-Reply-To: <1518443301602-0.post@n3.nabble.com>
  References: <1518328644815-0.post@n3.nabble.com> <9fa5f7c2-b6ca-ccfd-fded-284359f973c4@gelassene-pferde.biz> <1518443301602-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox