Received: from relay14.jaring.my (relay14.jaring.my [192.228.128.125]) by hub.org (8.9.2/8.9.1) with ESMTP id TAA46476 for ; Sat, 6 Feb 1999 19:46:06 -0500 (EST) (envelope-from hoelc@pd.jaring.my) Received: from pd.jaring.my (j56.glg84.jaring.my [161.142.208.70]) by relay14.jaring.my (8.8.8/8.8.7) with ESMTP id IAA27027 for ; Sun, 7 Feb 1999 08:45:31 +0800 (MYT) Message-ID: <36BCE221.47837890@pd.jaring.my> Date: Sun, 07 Feb 1999 08:45:22 +0800 From: hoelc Reply-To: hoelc@pd.jaring.my X-Mailer: Mozilla 4.05 [en] (Win95; I) MIME-Version: 1.0 To: pgsql-interfaces@postgreSQL.org Subject: question on accessing PostgreSQL with C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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