Re: Field with default not being set on copy from.

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Field with default not being set on copy from.
Date: 2003-01-03 22:02:38
Message-ID: 3E16087E.582AA7DF@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,

I am sure you are right.

The last part of my message should have read:

I am running 7.2.3

Time to plan an upgrade...

JLL

Tom Lane wrote:
>
> Jean-Luc Lachance <jllachan(at)nsd(dot)ca> writes:
> > It seems that a field declared with a default is not being set when
> > executing copy from with less field then the table has.
>
> I think you are mistaken. This works in 7.3:
>
> regression=# create table foo (f1 int, f2 text, f3 int default 42);
> CREATE TABLE
> regression=# \copy foo(f1,f2) from stdin
> 1 first
> 2 second
> \.
> regression=# select * from foo;
> f1 | f2 | f3
> ----+--------+----
> 1 | first | 42
> 2 | second | 42
> (2 rows)
>
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-01-03 22:04:47 Re: Field with default not being set on copy from.
Previous Message culley harrelson 2003-01-03 21:43:07 example table functions?