Received: from panchito.Austria.EU.net (panchito.Austria.EU.net [193.154.160.103]) by hub.org (8.9.3/8.9.3) with ESMTP id PAA46906 for ; Mon, 13 Sep 1999 15:01:38 -0400 (EDT) (envelope-from theofilu@eunet.at) Received: from eunet.at (dialup160.ap01-graz.at.eu.net [193.81.170.160]) by panchito.Austria.EU.net (8.9.3/8.9.3) with ESMTP id VAA23811 for ; Mon, 13 Sep 1999 21:01:34 +0200 (MET DST) Received: (from theofilu) by eunet.at (8.9.3/8.9.3) id VAA06721 for pgsql-interfaces@postgresql.org; Mon, 13 Sep 1999 21:02:36 +0200 Message-Id: <199909131902.VAA06721@eunet.at> Date: Mon, 13 Sep 1999 21:02:34 +0200 (MEST) To: pgsql-interfaces@postgresql.org Reply-To: theofilu@eunet.at From: theofilu@eunet.at (Theofilu Andreas) Subject: RE[2]: [INTERFACES] ecpg and getting just assigned serial number In-Reply-To: X-Mailer: Ishmail 1.3.2-970722-linux MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Craig Orsinger wrote: > > On 13-Sep-99 Andreas Theofilu wrote: > > I can write such a function, of course. But I will not break > compatibility > > to Informix, because both databases, PostgreSQL _and_ Informix are > > supported in only a single source file. > > I've tried to do this myself, and in the long run I think > you'll be better off planning on having two different versions of > embedded C, or at least, two different sets of functions that do > certain operations. Informix ESQL/C and ecpg have significantly > different syntax, especially regarding CURSORs and FETCHs. If you > keep things simple, and have some way of converting database names > between the two systems, you can undoubtedly do what you're trying > to do. Anything else and it gets really difficult. While Informix > supports EXEC SQL IFDEF, PostgreSQL does not appear to. > It is not always easy to do that and the two are different, but not completely. However. I use a special preprocessor (lwpp [look at freshmeat for it]) to create an embedded C file for PostgreSQL 'ecpg' or Informix 'esqlc'. I think this is the better way. Having two source trees would mean to do everything twice and if I forget something I have two incompatible programs. > An alternative might be to have a single source file that > can be modified by a sed or awk script to conform to whatever > embedded SQL you're using at the moment. I considered this approach, > but didn't pursue it because I didn't have the time. > look above. > We had a discussion here about this subject in June. The > subject was "esql/c documentation". If you can't find it in the > archive, I can e-mail some of the more interesting posts in that > thread. > Thanks for that tip, will search for it. -- Theofilu Andreas http://members.eunet.at/theofilu ------------------------------------------------- Enjoy the science of Linux! Genieße die Wissenschaft von Linux! -------------------------------------------------