- Mailing list pgsql-interfaces

From Cal McPherson
Subject
Date
Msg-id 65ED19764468D411A6AF006094EA0F3B275D61@SERVER
Whole thread Raw
List pgsql-interfaces
Regarding libpq:
I have a table defined as follows to log instances of a service. 

CREATE TABLE service_instance(service_instance_id serial PRIMARY KEY,started timestamp,finished timestamp,indial
text,pin_intext,FOREIGN KEY(indial, pin_in) REFERENCES service(indial, pin_in)
 
);

I would like to insert a row into the table to log the current service
instance.  I believe I simply leave out the serial primary key from the
insert statement to get the next default value.  However, directly after the
insert I need to know the default value used for this field.  
Is this possible with the libpq interface.  Can I somehow use object
PQoidValue(res) to find the serial id of the inserted row, or is there
another way?

calsa


pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inserting timestamp values from windowz application
Next
From: "Arthur Ward"
Date:
Subject: 7.4 and Pygresql