Sample Program

Started by Mulcahy, Chrisover 25 years ago6 messagesgeneral
Jump to latest
#1Mulcahy, Chris
cmulcahy@vivius.com

Greetings:

I have so far been unsuccessful in my searches. Does someone have a very
small sample of a C/C++ program to read some data out of a Postgresql
database and insert a new record?

Any help appreciated.

Thanks
Chris

#2Adam Lang
aalang@rutgersinsurance.com
In reply to: Mulcahy, Chris (#1)
Re: Sample Program

There was an example of using libpq with C in Bruce's book:
http://www.postgresql.org/docs/awbook.html

it was chapter 17, section 1, but it might have changed.

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Mulcahy, Chris" <cmulcahy@vivius.com>
To: <pgsql-general@postgresql.org>
Sent: Wednesday, November 01, 2000 2:28 PM
Subject: [GENERAL] Sample Program

Show quoted text

Greetings:

I have so far been unsuccessful in my searches. Does someone have a very
small sample of a C/C++ program to read some data out of a Postgresql
database and insert a new record?

Any help appreciated.

Thanks
Chris

#3Nick Fankhauser
nickf@ontko.com
In reply to: Mulcahy, Chris (#1)
RE: Sample Program

If you want to go one step further & learn Java, I can supply several
examples using Java & JDBC...

Also try going to this link & look for instructions on getting the examples
rpm if you are on RH:

http://www.linuxdoc.org/HOWTO/PostgreSQL-HOWTO-6.html#ss6.4

I don't know if C is among the examples, but this is where I got some Java
samples...

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Mulcahy, Chris
Sent: Wednesday, November 01, 2000 2:28 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Sample Program

Greetings:
I have so far been unsuccessful in my searches. Does someone have a very
small sample of a C/C++ program to read some data out of a Postgresql
database and insert a new record?
Any help appreciated.
Thanks
Chris

#4Igor Roboul
igor@raduga.dyndns.org
In reply to: Adam Lang (#2)
Re: Sample Program

On Wed, Nov 01, 2000 at 02:53:12PM -0500, Adam Lang wrote:

There was an example of using libpq with C in Bruce's book:
http://www.postgresql.org/docs/awbook.html

it was chapter 17, section 1, but it might have changed.

Also, you can fetch this book in PDF format (for example once per week)
It is good, but still incomplete, source of PostgreSQL information.
But week-by-week it becomes better :-)

--
Igor Roboul, Unix System Administrator & Programmer @ sanatorium "Raduga",
Sochi, Russia
http://www.brainbench.com/transcript.jsp?pid=304744

#5Colin Taylor
Colin_Taylor@PortaSystemsDev.com
In reply to: Igor Roboul (#4)
RE: Sample Program

Found examples in:

http://www.postgresql.org/docs/aw_pgsql_book/node188.html

These include the techniques that I use at home and have had "few" problems.
Have fun.

Show quoted text

-----Original Message-----
From: Nick Fankhauser [mailto:nickf@ontko.com]
Sent: Wednesday, November 01, 2000 7:58 PM
To: pgsql-general; Mulcahy, Chris
Subject: RE: [GENERAL] Sample Program

If you want to go one step further & learn Java, I can supply several
examples using Java & JDBC...

Also try going to this link & look for instructions on
getting the examples
rpm if you are on RH:

http://www.linuxdoc.org/HOWTO/PostgreSQL-HOWTO-6.html#ss6.4

I don't know if C is among the examples, but this is where I
got some Java
samples...

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Mulcahy, Chris
Sent: Wednesday, November 01, 2000 2:28 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Sample Program

Greetings:
I have so far been unsuccessful in my searches. Does someone
have a very
small sample of a C/C++ program to read some data out of a Postgresql
database and insert a new record?
Any help appreciated.
Thanks
Chris

#6Bruce Momjian
bruce@momjian.us
In reply to: Igor Roboul (#4)
Re: Sample Program

On Wed, Nov 01, 2000 at 02:53:12PM -0500, Adam Lang wrote:

There was an example of using libpq with C in Bruce's book:
http://www.postgresql.org/docs/awbook.html

it was chapter 17, section 1, but it might have changed.

Also, you can fetch this book in PDF format (for example once per week)
It is good, but still incomplete, source of PostgreSQL information.
But week-by-week it becomes better :-)

Actually, it is done, and has been for a few months. Should be for sale
in a week or so.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026