Re: [HACKERS] Bug or feature? COPY ignores column defaults - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: [HACKERS] Bug or feature? COPY ignores column defaults
Date
Msg-id 199901281507.PAA24198@linda.lfix.co.uk
Whole thread Raw
In response to Re: [HACKERS] Bug or feature? COPY ignores column defaults  (Vadim Mikheev <vadim@krs.ru>)
Responses Re: [HACKERS] Bug or feature? COPY ignores column defaults  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Vadim Mikheev wrote: >Oliver Elphick wrote: >>  >> At release 6.4.2, COPY does not respect column defaults: >>  >>
INSERTworks correctly, however. >>  >> Is this intentional, or a bug? > >This is standard behaviour. DEFAULT value is
substituted>only if column value (including NULL) is not specified in  >INSERT statement. 
 

Well, isn't that the case here?
 junk=> copy testbed from stdin; Enter info followed by a newline End with a backslash and a period on a line by
itself.>>  >> \.
 

I haven't specified \N; there is no value at all for the column, so
surely the default should be used?

If that is not the case, I will add an explanation to the documentation for
COPY.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver              PGP key from public servers; key
ID32B8FAA1                ========================================    "Many are the afflictions of the righteous; but
the     LORD delivereth him out of them all."                                                    Psalm 34:19 
 




pgsql-hackers by date:

Previous
From: Massimo Dal Zotto
Date:
Subject: Re: [HACKERS] Postgres Speed or lack thereof
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Bug or feature? COPY ignores column defaults