pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hoelc <hoelc@pd.jaring.my>
To: pgsql-interfaces@postgreSQL.org
Subject: question on accessing PostgreSQL with C
Date: Sun, 07 Feb 1999 08:45:22 +0800
Message-ID: <36BCE221.47837890@pd.jaring.my> (raw)

Hello,
I'm a newbee in PostgreSQL, Linux world.  Currently facing some problem
in building a simple application.  I'm trying to write a C program that
get input from user, then update (insert / change) the database, or
retrieve selected data.

Questions:
(1)  Where to get more example of communicating with PostgreSQL with C
program?

(2)  How to put variables into the SQL?
        I use C program to access PostgreSQL with libpq, and use PQexec(
) to send the query. One of the failed example of mine,
                    :
           /* get input from user, a string and an integer */
                    :
        PQexec(conn,"insert into NameList (name,id) values
(%s,%d).......
                    :
           /* I'm trying to put variables of string and integer into the
query */


(3)  How to check who are the users in PostgreSQL system?

Please advise.
Thanks & Regards,
LCH






view thread (10+ messages)  latest in thread

Message-ID: <36BCE221.47837890@pd.jaring.my>
Permalink:  ../36BCE221.47837890@pd.jaring.my/
Also on:    postgresql.org/message-id/36BCE221.47837890@pd.jaring.my

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: hoelc@pd.jaring.my
  Subject: Re: question on accessing PostgreSQL with C
  In-Reply-To: <36BCE221.47837890@pd.jaring.my>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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