Re: CommitFest 2009-09, two weeks on
Boszormenyi Zoltan <zb@cybertec.at>
From: Boszormenyi Zoltan <zb@cybertec.at>
To: Michael Meskes <meskes@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, pgsql-hackers@postgresql.org, Hans-Juergen Schoenig <hs@cybertec.at>, Dan Colish <dan@unencrypted.org>
Date: 2009-10-02T14:27:20Z
Lists: pgsql-hackers
Attachments
- outofscope.ec (text/plain)
- struct.h (text/x-chdr)
- outofscope.c-native (text/plain)
- outofscope.c-compat (text/plain)
- outofscope.c-esql (text/plain)
Michael Meskes írta: > On Thu, Oct 01, 2009 at 09:05:55PM +0200, Boszormenyi Zoltan wrote: > >> Yes, but technical problems and solutions do. ECPG claims >> to be ESQL/C compatible, but at places it's only half compatible. >> > > Where does it claim to be fully compatible? > I didn't say it claims to be fully compatible, but it's a "hint" that "ecpg -C INFORMIX[_SE]" exists. :-) >> This comment is misleading and reflects quite a narrow POV. >> Not only OPEN and DECLARE may be out of scope, >> but FETCH and CLOSE as well. The reason why ESQL/C >> allows this construct is that this ultimately allows using >> embedded SQL in event-driven code in a straightforward way. >> For this purpose, native ECPG code is not usable currently, >> or you need programming tricks, like tracking whether the >> cursor is open and protecting DECLARE and OPEN under >> some conditional branch to avoid double open, etc. A straight >> DECLARE, OPEN, FETCH(s) and CLOSE series in >> the same function is only good for batch programming. >> > > Examples? > I took my outofscope.pgc example from our "out of scope" patch and shortened it. Compare the ecpg-native and compat outputs and the esql output of the same file. The ecpg outputs are generated with 8.4.1 plus out patches added, the native output differs only from 8.3.7's ecpg in the amount of whitespaces emitted between literals. The get_record1() function can be called from a button-handler, e.g. when pressing PgDn, or similar... No tricks needed, straightforward code. Best regards, Zoltán Böszörményi -- Bible has answers for everything. Proof: "But let your communication be, Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil." (Matthew 5:37) - basics of digital technology. "May your kingdom come" - superficial description of plate tectonics ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH http://www.postgresql.at/