Thread: [GENERAL] libecpg versions and libecpg_compat

[GENERAL] libecpg versions and libecpg_compat

From
Rob Newton
Date:
Hi Hackers,
I posted this to the GENERAL list a while back, but got no repies. 
Perhaps someone here can help...

I've been building ECPG (embedded SQL/C) programs on a system with 
Pg version 8.0 installed.  When I tried to run them recently on 
version 8.4 I found that there was a libecpg library 
incompatibility:  v8.0 uses libecpg.so.5, whereas 8.4 uses libecpg.so.6.

Then I noticed libecpg_compat in the lib area.  What is this used 
for?  "compat" suggests compatibility between different versions? 
But Pg 8.0 has libecpg_compat.so.2, whereas Pg 8.4 has 
libecpg_compat.so.3.

Is there some way of building with Pg v8.0 ECPG lib and running on a
system with Pg v8.4 ECPG lib?  or vice versa? and is libecpg_compat
intended for that purpose?

Thanks,
Rob

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] libecpg versions and libecpg_compat

From
Boszormenyi Zoltan
Date:
Rob Newton írta:
> Hi Hackers,
> I posted this to the GENERAL list a while back, but got no repies.
> Perhaps someone here can help...
>
> I've been building ECPG (embedded SQL/C) programs on a system with Pg
> version 8.0 installed.  When I tried to run them recently on version
> 8.4 I found that there was a libecpg library incompatibility:  v8.0
> uses libecpg.so.5, whereas 8.4 uses libecpg.so.6.
>
> Then I noticed libecpg_compat in the lib area.  What is this used
> for?  "compat" suggests compatibility between different versions? But
> Pg 8.0 has libecpg_compat.so.2, whereas Pg 8.4 has libecpg_compat.so.3.

libecpg_compat.so is for Informix compatibility.
It contains the Informix-specific calls.

> Is there some way of building with Pg v8.0 ECPG lib and running on a
> system with Pg v8.4 ECPG lib?  or vice versa? and is libecpg_compat
> intended for that purpose?

You can build the src/interfaces/libpq and src/interfaces/ecpg/ecpglib
directories in the old version and install them side by side with the new
version. The 8.4 server works happily with the old ECPG client.

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/



Re: [GENERAL] libecpg versions and libecpg_compat

From
Michael Meskes
Date:
On Tue, Feb 16, 2010 at 09:44:26AM +1000, Rob Newton wrote:
> I posted this to the GENERAL list a while back, but got no repies.
> Perhaps someone here can help...

Didn't see it there, sorry.

> Then I noticed libecpg_compat in the lib area.  What is this used
> for?  "compat" suggests compatibility between different versions?

No, compat means compatibility towards different database systems. In this case
it more or less only means compatibility to Informix.

> Is there some way of building with Pg v8.0 ECPG lib and running on a
> system with Pg v8.4 ECPG lib?  or vice versa? and is libecpg_compat
> intended for that purpose?

You can link the static library in so you're independant from the dynamic
libraries. However, I wonder if that's a good idea. ECPG's parser is build to
be in sync with the backend parser, i.e. ecpg 8.0 accepts all SQL statements
that the 8.0 backend understands which is is different set than what 8.4
understands. Also if my memory serves well, libpq has had a major version
update between 8.0 and 8.4, so if it works at all you might find that you have
to recompile the libraries too. 

Is there any reason why you cannot simply recompile your programs against 8.4?

Michael
-- 
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
ICQ 179140304, AIM/Yahoo/Skype michaelmeskes, Jabber meskes@jabber.org
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL


Re: [GENERAL] libecpg versions and libecpg_compat

From
Rob Newton
Date:
<br /><br /> Boszormenyi Zoltan wrote: <blockquote cite="mid:4B7A5275.3070902@cybertec.at" type="cite"><pre wrap="">Rob
Newtonírta: </pre><br /><blockquote type="cite"><pre wrap="">Is there some way of building with Pg v8.0 ECPG lib and
runningon a
 
system with Pg v8.4 ECPG lib?  or vice versa? and is libecpg_compat
intended for that purpose?   </pre></blockquote><pre wrap="">
You can build the src/interfaces/libpq and src/interfaces/ecpg/ecpglib
directories in the old version and install them side by side with the new
version. The 8.4 server works happily with the old ECPG client.
 </pre></blockquote> OK, that is handy to know.  I'll give it a try...<br /><br /> Many thanks,<br /> Rob<br />

Re: [GENERAL] libecpg versions and libecpg_compat

From
Rob Newton
Date:

Michael Meskes wrote:
> On Tue, Feb 16, 2010 at 09:44:26AM +1000, Rob Newton wrote:
>> Is there some way of building with Pg v8.0 ECPG lib and running on a
>> system with Pg v8.4 ECPG lib?  or vice versa? and is libecpg_compat
>> intended for that purpose?
> 
> You can link the static library in so you're independant from the dynamic
> libraries. However, I wonder if that's a good idea. ECPG's parser is build to
> be in sync with the backend parser, i.e. ecpg 8.0 accepts all SQL statements
> that the 8.0 backend understands which is is different set than what 8.4
> understands. Also if my memory serves well, libpq has had a major version
> update between 8.0 and 8.4, so if it works at all you might find that you have
> to recompile the libraries too. 
> 
> Is there any reason why you cannot simply recompile your programs against 8.4?

I was hoping I wouldn't have to select a particular version of Pg to 
compile against, depending on what the target server is using.  But 
that may be the simplest option.  An alternative suggested by Zoltán 
Böszörményi is to install the 8.0 libpq and libecpg on the target 
systems, since he reckons the 8.4 server will serve 8.0 clients OK;  or I could link statically as you suggest.

Thanks for your ideas!

Rob