Re: COPY with default values?

From: "Len Morgan" <len-morgan(at)crcom(dot)net>
To: "Jeff Boes" <jboes(at)nexcerpt(dot)com>, "Postgres-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY with default values?
Date: 2001-05-25 15:27:46
Message-ID: 006601c0e52f$57cdc2a0$0908a8c0@H233.bstx.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You are correct and if you did your bulk insert with INSERT commands, it
will work just fine. The difference is the COPY command which AFAIK was/is
intended for backup and restore use.

len morgan

-----Original Message-----
From: Jeff Boes <jboes(at)nexcerpt(dot)com>
To: Postgres-general <pgsql-general(at)postgresql(dot)org>
Date: Friday, May 25, 2001 10:25 AM
Subject: Re: [GENERAL] COPY with default values?

>On Fri, 25 May 2001 10:33:41 -0400
>Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> COPY does not deal with insertion of default values. Sorry.
>
>This seems odd to me, especially since Pgsql treats
>
>INSERT INTO keywords (key_id, key_text) VALUES (null, 'foo');
>
>differently than
>
>INSERT INTO keywords (key_text) VALUES ('foo');
>
>It's been a while, but I'm pretty sure Oracle will do the same thing for
>each of these inserts, namely apply a default value when a null is
>detected.
>
>But thanks for the help!
>
>--
>Jeff Boes vox 616.226.9550
>Database Engineer fax 616.349.9076
>Nexcerpt, Inc. jboes(at)nexcerpt(dot)com
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2001-05-25 15:38:50 Re: Username with a hyphen character (grant failing?)
Previous Message Farid Hajji 2001-05-25 15:24:18 Re: Trouble with strange OUTER JOIN syntax