X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5F75CD1B8A5 for ; Fri, 15 Aug 2003 16:27:51 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 82330-10 for ; Fri, 15 Aug 2003 13:27:41 -0300 (ADT) Received: from THOR.goeci.com (thor.goeci.com [66.28.220.99]) by svr1.postgresql.org (Postfix) with ESMTP id 1DA9FD1B899 for ; Fri, 15 Aug 2003 13:27:40 -0300 (ADT) Received: by THOR.goeci.com with Internet Mail Service (5.5.2653.19) id ; Fri, 15 Aug 2003 12:27:40 -0400 Message-ID: <2D92FEBFD3BE1346A6C397223A8DD3FC0923B0@THOR.goeci.com> From: Murthy Kambhampaty To: 'expect' , pgsql-general@postgresql.org Subject: Re: importing db as text files Date: Fri, 15 Aug 2003 12:27:34 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/740 X-Sequence-Number: 47157 >-----Original Message----- >From: expect [mailto:expect@ihubbell.com] >Sent: Friday, August 15, 2003 11:56 >To: pgsql-general@postgresql.org >Subject: Re: [GENERAL] importing db as text files > > >On Fri, 15 Aug 2003 11:32:20 -0400 >Murthy Kambhampaty wrote: > >> On Friday, August 15, 2003 03:53, expect >[mailto:expect@ihubbell.com] wrote: >> >On Fri, 15 Aug 2003 00:32:01 -0700 (PDT) >> >Stephan Szabo wrote: >> > >> ... >> >> Given >> >> create table test( >> >> a text default 'abc', >> >> b int default 5 >> >> ); >> >> >> >> copy test from stdin with delimiter ','; >> >> , >> >> \. >> >> >> >> What would you expect the values of the row in test >> >> to be? >> > >> > >> ... >> >In this case I would expect the row to have: >> > >> > a | b >> >---------- >> > | >> > abc | 5 >> > >> > >> >Is this too much to expect? >> >> Your expectations don't seem consistent with the table >definition, which >> permits Null values are allowed in (it's ironic you would >add "null ''" to >> the copy statement, which says you want to treat empty >strings as default >> values, not null!). >> > > >Why is it ironic? I don't think you've followed the thread correctly. >It's what I wanted to have happen. > Pardon my dyslexic typing; that was to read: "it's ironic you would add "null ''" to the copy statement, which says you want to treat empty strings as nulls, not default values!"