libpq++ - copy - default values
libpq++ - copy - default values
От:
"V. A." <a2891891@smail.Uni-Koeln.DE>
Дата:
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
Re: [INTERFACES] libpq++ - copy - default values
От:
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Дата:
> 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
Re: [INTERFACES] libpq++ - copy - default values
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"V. A." 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