Enrique Sánchez wrote:
> Hi! I'm new in Postgres.
> 
> I nedd to fill a database table x from a file With the COPY command
> an the delimiter '*'.
> This  table  has a timestamp null column (I declared like: ' birthday
> timestamp NULL' ).
> 
> But when I try to insert NULL values(specified in the file), postgres
> throw an error.
> 
> 
> I don't know how can I specify this NULL value wkthout an '\N'
> character. 

I created a table t1 with 3 columns, all nullable:

        f1 int
        f2 timestamp
        f3 int

Using the following input file t1.csv:

        5,NULL,7
        8,NULL,10

The following COPY command successfully put those rows in the table, with f2 
null:

        copy t1 (f1, f2, f3)
        from 't1.csv'
        null as 'NULL'
        csv;

-- 
Guy Rouillier


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to