Skip site navigation (1) Skip section navigation (2)

RE: [INTERFACES] ECPG Question

From: "Bruce Tenison" <btenison(at)rstc(dot)cc(dot)al(dot)us>
To: "Michael Meskes" <Michael_Meskes(at)usa(dot)net>
Cc: "PostgreSQL Interfaces" <pgsql-interfaces(at)postgresql(dot)org>
Subject: RE: [INTERFACES] ECPG Question
Date: 1999-01-21 18:01:34
Message-ID: 000001be4568$156af900$0105a8c0@tenison.irstc.cc.al.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Thanks!!!  That fixed our problem!  I should have stated that my source was
the result of an ecpg run.  We used the preprocessor to make some source
that we could manipulate, and never went back to the earlier source code.
Man this is great.

Thanks again!
Bruce


-----Original Message-----
From:	Michael Meskes [mailto:Michael_Meskes(at)usa(dot)net]
Sent:	Wednesday, January 20, 1999 2:03 PM
To:	Bruce Tenison
Cc:	PostgreSQL Interfaces
Subject:	Re: [INTERFACES] ECPG Question

On Wed, Jan 20, 1999 at 11:35:59AM -0600, Bruce Tenison wrote:
> Hi!  I hope that I'm in the correct list to ask this question.  We have a

Yes.

> daemon that need to access our PostgreSQL database and have been trying to
> use ecpg to generate the C source to use to access the database.
Basically,
> we're winding up with a bunch of open sockets for some reason.  Here's the
> function that accesses the database, and I'm wondering if we're closing
the
> connection properly (since we call this routine quite often...)

The function listed below is not an embedded sql function as preprocessed by
ecpg. It only uses libecpg. Or is this the result of an ecpg run?

> int getuname(ipaddr)
> char *ipaddr;
> {
>         ECPGconnect("currentuser");

ECPGconnect is used to connect to a database. So you open a connection to DB
currentuser everytime you call this function.

> ...
>         ECPGtrans(__LINE__, "end");
>
>         return not_found_uname;
> }

This only commits the transaction but does not disconnect from the database.
For that you need a call to ECPGfinish as done in ECPGdisconnect.

Michael
--
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael(dot)Meskes(at)gmx(dot)net          | Use PostgreSQL!


In response to

pgsql-interfaces by date

Next:From: Dave PageDate: 1999-01-22 16:52:27
Subject: pgAdmin 6.4.1 Download
Previous:From: Pavel PaJaSoft JanousekDate: 1999-01-21 17:43:25
Subject: Problem with Perl, DBI and Postgress 6.4.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group