pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Old "Feature" - Copy table ignores column defaults
3+ messages / 2 participants
[nested] [flat]

* Old "Feature" - Copy table ignores column defaults
@ 2002-11-14 01:42 Tim Perdue <tim@perdue.net>
  2002-11-14 04:37 ` Re: Old "Feature" - Copy table ignores column defaults Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Tim Perdue @ 2002-11-14 01:42 UTC (permalink / raw)
  To: pgsql-sql

I see there are a handful of reports of this, but it does seem broken to 
me. If I am copying a table and a column is blank, surely it makes sense 
to substitute the column default from the table? Right now, it is 
substituting 0 for a null column, instead of -99 as I wished, and here I 
was complaining that it was the national weather service's bug.

Re: [HACKERS] Bug or feature? COPY ignores column defaults
http://archives.postgresql.org/pgsql-hackers/1999-01/msg00667.php
http://archives.postgresql.org/pgsql-hackers/1999-01/msg00650.php

Alas, I will have to run perl regex on this awful weather data to make 
it work right.

Tim




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Old "Feature" - Copy table ignores column defaults
  2002-11-14 01:42 Old "Feature" - Copy table ignores column defaults Tim Perdue <tim@perdue.net>
@ 2002-11-14 04:37 ` Tom Lane <tgl@sss.pgh.pa.us>
  2002-11-14 04:44   ` Re: Old "Feature" - Copy table ignores column defaults Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2002-11-14 04:37 UTC (permalink / raw)
  To: Tim Perdue <tim@perdue.net>; +Cc: pgsql-sql

Tim Perdue <tim@perdue.net> writes:
> I see there are a handful of reports of this, but it does seem broken to 
> me. If I am copying a table and a column is blank, surely it makes sense 
> to substitute the column default from the table?

There is no such concept as "blank" in SQL.

7.3 does have the ability to COPY a subset of a column's tables and
insert default values for the omitted columns.  But if a column is
provided in the input, there is no clean way to decide that a particular
input value ought to be replaced by a default.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Old "Feature" - Copy table ignores column defaults
  2002-11-14 01:42 Old "Feature" - Copy table ignores column defaults Tim Perdue <tim@perdue.net>
  2002-11-14 04:37 ` Re: Old "Feature" - Copy table ignores column defaults Tom Lane <tgl@sss.pgh.pa.us>
@ 2002-11-14 04:44   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2002-11-14 04:44 UTC (permalink / raw)
  To: Tim Perdue <tim@perdue.net>; pgsql-sql

I said:
> 7.3 does have the ability to COPY a subset of a column's tables and
> insert default values for the omitted columns.

s/column's tables/table's columns/

Must be time to go to bed ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-11-14 04:44 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-14 01:42 Old "Feature" - Copy table ignores column defaults Tim Perdue <tim@perdue.net>
2002-11-14 04:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-11-14 04:44   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox