pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedlibpq++ - copy - default values
4+ messages / 4 participants
[nested] [flat]
* libpq++ - copy - default values
@ 1999-03-04 13:16 V. A. <a2891891@smail.Uni-Koeln.DE>
1999-03-04 14:08 ` Re: [INTERFACES] libpq++ - copy - default values Thomas G. Lockhart <lockhart@alumni.caltech.edu>
1999-03-04 14:48 ` Re: [INTERFACES] libpq++ - copy - default values Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 4+ messages in thread
From: V. A. @ 1999-03-04 13:16 UTC (permalink / raw)
To: pgsql-interfaces
Hi!
I wrote a little Programm that puts all telefoncall-information from my
ISDN-card
and those from my telefonesystem into the Postgresdb, using the libpq++
library. My problem is, that I don't know how I can tell the copy-command to
leave the first field untouched, so that it gets the default value from a
sequence....
Can anyone tell me, how I can do this?
Thanks in advanced!
Viktor
Ps: Postgres 6.4 - Linux
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] libpq++ - copy - default values
1999-03-04 13:16 libpq++ - copy - default values V. A. <a2891891@smail.Uni-Koeln.DE>
@ 1999-03-04 14:08 ` Thomas G. Lockhart <lockhart@alumni.caltech.edu>
1 sibling, 0 replies; 4+ messages in thread
From: Thomas G. Lockhart @ 1999-03-04 14:08 UTC (permalink / raw)
To: V. A. <a2891891@smail.Uni-Koeln.DE>; +Cc: pgsql-interfaces
> My problem is, that I don't know how I can tell the copy-command to
> leave the first field untouched, so that it gets the default value
> from a sequence....
> Can anyone tell me, how I can do this?
afaik "copy" always fills all columns. You might get better results
using a series of inserts, which do allow default values to be used.
- Tom
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] libpq++ - copy - default values
1999-03-04 13:16 libpq++ - copy - default values V. A. <a2891891@smail.Uni-Koeln.DE>
@ 1999-03-04 14:48 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 1999-03-04 14:48 UTC (permalink / raw)
To: V. A. <a2891891@smail.Uni-Koeln.DE>; +Cc: pgsql-interfaces
"V. A." <a2891891@smail.Uni-Koeln.DE> writes:
> My problem is, that I don't know how I can tell the copy-command to
> leave the first field untouched, so that it gets the default value from a
> sequence....
You can't. COPY is for plain verbatim dumping and reloading of data.
Use INSERT if you need to have any calculations done.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] libpq++ - copy - default values
@ 1999-03-04 17:14 Viktor A. <a2891891@smail.Uni-Koeln.DE>
0 siblings, 0 replies; 4+ messages in thread
From: Viktor A. @ 1999-03-04 17:14 UTC (permalink / raw)
To: pgsql-interfaces
>> My problem is, that I don't know how I can tell the copy-command to
>> leave the first field untouched, so that it gets the default value from a
>> sequence....
>
>You can't. COPY is for plain verbatim dumping and reloading of data.
>Use INSERT if you need to have any calculations done.
Hmm..Thats what I was afraid of..... I don't have the slightest idea on how
to get the data into that PQExec("INSERT .....") String... Do you know,
where
I can get some sample source on this?
Thanks!
Viktor
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~1999-03-04 17:14 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-03-04 13:16 libpq++ - copy - default values V. A. <a2891891@smail.Uni-Koeln.DE>
1999-03-04 14:08 ` Thomas G. Lockhart <lockhart@alumni.caltech.edu>
1999-03-04 14:48 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-03-04 17:14 Re: [INTERFACES] libpq++ - copy - default values Viktor A. <a2891891@smail.Uni-Koeln.DE>
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