From: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: ECPG call interface && filename
Date: Tue, 14 Jan 2020 13:01:45 +0100
Message-ID: <20200114120145.GA296972@sh4-5.1blu.de> (raw)
Hello,
Actually, the ecpg pre-compiler resolves ESQL/C statements like
EXEC SQL SELECT ....
into a function call to the executer in the ecpglib as:
ECPGdo(__LINE__, ...);
where __LINE__ is later substituted by the C-precompiler by the current
line number as an integer. The purpose is mostly for logging features
like:
[24304] [14.01.2020 12:05:18:433]: ECPGtrans on line 1108: action "rollback"; connection "sisis71"
i.e. to have the line number in the log statement
(btw: the date and timestamp is already a local modification we did to
bring the log line in sync with other logs our application is writing).
In a real world server application written in some hundreds foo.pgc
files (a generated application interface with the pgc files based on
the 400 tables in the database), it would be nice to have the call done
like this:
ECPGdo(__LINE__, __FILE__, ...)
and the resulting log line like this:
[24304] [14.01.2020 12:05:18:433]: ECPGtrans on line 1108 in file D01buch.c: action "rollback"; connection "sisis71"
Before hacking this into the ecpglib code by my own, I wanted discuss this here
or even file somewhere a structured change request for further development.
Thanks
matthias
--
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!
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: guru@unixarea.de
Subject: Re: ECPG call interface && filename
In-Reply-To: <20200114120145.GA296972@sh4-5.1blu.de>
References: <20200114120145.GA296972@sh4-5.1blu.de>
* 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