Re: COPY FROM and sequences

From: Matthew Terenzio <matt(at)jobsforge(dot)com>
To: Matthew Terenzio <matt(at)jobsforge(dot)com>
Cc: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: COPY FROM and sequences
Date: 2007-01-09 02:20:47
Message-ID: dd34e77d6af81677001220f5e7e8a51c@jobsforge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jan 8, 2007, at 9:13 PM, Matthew Terenzio wrote:

>
> On Jan 8, 2007, at 8:55 PM, Michael Glaesemann wrote:
>
>>
>> On Jan 8, 2007, at 19:20 , Matthew Terenzio wrote:
>>
>>> Is it true that you can't use COPY FROM to fill a table with a
>>> SERIAL type column?
>>>
>>> Or rather, how does one approach that situation most effectively?
>>
>> Could you give an example of what you're trying to do? What errors
>> are you getting?
>
> Just trying to fill a large number of rows in a table that uses a
> serial for the primary key, from a comma delimited file
>
> invalid input syntax for integer: ""
>
> I'm not quoting anything, just leaving the the delimited field empty
> and expected a seuqence would fill the column as it would in an insert

Looks like WITH NULL AS '' might work

>
>
>>
>> Michael Glaesemann
>> grzm seespotcode net
>>
>>
>>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Terenzio 2007-01-09 02:33:06 Re: COPY FROM and sequences
Previous Message Matthew Terenzio 2007-01-09 02:13:43 Re: COPY FROM and sequences