pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
RE[2]: [INTERFACES] ecpg and getting just assigned serial number
2+ messages / 2 participants
[nested] [flat]

* RE[2]: [INTERFACES] ecpg and getting just assigned serial number
@ 1999-09-13 19:02 Theofilu Andreas <theofilu@eunet.at>
  1999-09-15 18:21 ` RE: RE[2]: [INTERFACES] ecpg and getting just assigned serial nu Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 1 reply; 2+ messages in thread

From: theofilu@eunet.at @ 1999-09-13 19:02 UTC (permalink / raw)
  To: pgsql-interfaces

Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil> 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!
               -------------------------------------------------



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* RE: RE[2]: [INTERFACES] ecpg and getting just assigned serial nu
  1999-09-13 19:02 RE[2]: [INTERFACES] ecpg and getting just assigned serial number Theofilu Andreas <theofilu@eunet.at>
@ 1999-09-15 18:21 ` Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>
  0 siblings, 0 replies; 2+ messages in thread

From: Craig Orsinger @ 1999-09-15 18:21 UTC (permalink / raw)
  To: pgsql-interfaces


On 13-Sep-99 Theofilu Andreas wrote:
>> 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.

        I downloaded this program and tried it out. It definitely
has possibilities. I especially like its flexible prefix feature,
which should make it possible to use for source files in just 
about any language. You could use this, for instance, to pre-process
SQL scripts for different DBMSs. I've been doing stuff like this
using sed scripts in makefiles, and I can tell you I'd much rather
do it this way.

        Thanks for the tip.


----------------------------------
Date: 15-Sep-99  Time: 11:10:52

Craig Orsinger                  (email: <orsingerc@epg-gw1.lewis.army.mil>)
Logicon RDA
Bldg. 8B28                      "Just another megalomaniac with ideas above his
6th & F Streets                 station. The Universe is full of them."
Ft. Lewis, WA   98433                   - The Doctor
----------------------------------



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-09-15 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-09-13 19:02 RE[2]: [INTERFACES] ecpg and getting just assigned serial number Theofilu Andreas <theofilu@eunet.at>
1999-09-15 18:21 ` RE: RE[2]: [INTERFACES] ecpg and getting just assigned serial nu Craig Orsinger <orsingerc@epg-gw1.lewis.army.mil>

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