Re: [HACKERS] Re: [COMMITTERS] pgsql/src/interfaces/libpgeasy (libpgeasy.c)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [COMMITTERS] pgsql/src/interfaces/libpgeasy (libpgeasy.c)
Date: 1999-12-20 15:47:19
Message-ID: 18832.945704839@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> Clean up some minor gcc warnings. I'm not touching the
>> major one, though, which is the truly ugly stores into libpq private
>> storage. Can't you find a better way to do this?

> Yes, very ugly. I need some way to store my state information _inside_
> the Result structure. Any ideas?

One possibility is to add an application-defined field, say of void*
type, to PGconn and PGresult, plus set/get access functions for them.
This'd be a fairly general-purpose feature; I've seen it done in other
libraries that export objects of this sort.

On the other hand, if libpq did have such a feature, it'd be nice if
libpgeasy didn't commandeer it but left it open for the application
to use. So maybe we need something else for libpgeasy.

Since libpgeasy is new in the (core) distribution for this release,
perhaps it is not too late to consider an API change? If get_result,
set_result and friends returned a pointer to a two-element struct
(PGresult* and tuplenumber) instead of a raw PGresult*, the problem
would go away. More or less anyway ... I'm not quite sure where it'd
be OK to free() such a struct ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Keith Parks 1999-12-20 16:32:31 Re: [HACKERS] Re: initdb.sh fixed7
Previous Message NormanD 1999-12-20 15:31:26 New Catia 5 r 4 and other appz!!!