Re: [HACKERS] non-SQL C interface ? (fwd)

From: Jan Vicherek <honza(at)ied(dot)com>
To: Peter T Mount <psqlhack(at)maidast(dot)demon(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] non-SQL C interface ? (fwd)
Date: 1998-01-18 18:36:30
Message-ID: Pine.LNX.3.96.980118132825.5201C-100000@ann.ied.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 18 Jan 1998, Peter T Mount wrote:

> > basically I'm using only one table at a time, and I need only a few
> > simple operations on tuples (find, add, updates, delete).
> >
> > Can sombody advise me how could I get this simple interface ?
>
> I think the simplest way of doing this is to write your own stubs, that
> then sit on top of libpq. This is the way I've done this in the past.

It seems like a bit of overkill, since this would still have to go
through the SQL parser,optimizer,executor,etc. If I want to access the
tables only one at a time, and only load the rows into a simple C
structure, it seems like there has to be this interface, since the SQL
executor has to get to the data somehow too. And I thought it would be
through this C interface that I'm looking for.

here goes the list of simple few calls I need :
open db
select fields to work with
select index to use
select a record
update a record
add a record
delete a record
lock a table against updates, unlock

> > and that's it. (Taken from Informinx 3.3, "ALL-II" C interface.)
> >
> > We are looking into porting an app written for this Informix interface
> > into Postgres, and I would wrinte a library simulating these calls.
> >
> > Is there a set of calls seomwhere inside of PGSQL that I could use in my
> > simulation library to utilize ?
>
> As your trying to simulate another api, and it looked like it's fairly
> simple, then it should be simple to do this, leaving libpq to do the
> actual network stuff to the database.

but libpq and do *only* SQL calls only, right ? Or can libpq do some of
these lower-level stuff too? that would be excellent !

Thanx,

Jan

-- Gospel of Jesus is the saving power of God for all who believe --
Jan Vicherek ## To some, nothing is impossible. ## www.ied.com/~honza
>>> Free Software Union President ... www.fslu.org <<<
Interactive Electronic Design Inc. -#- PGP: finger honza(at)ied(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-18 19:33:54 Re: [HACKERS] PSQL man page patch
Previous Message Vadim B. Mikheev 1998-01-18 12:27:09 Re: [HACKERS] subselects coding started