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 5F369D1C964 for ; Fri, 15 Aug 2003 15:35:38 +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 72369-06 for ; Fri, 15 Aug 2003 12:35:28 -0300 (ADT) Received: from THOR.goeci.com (thor.goeci.com [66.28.220.99]) by svr1.postgresql.org (Postfix) with ESMTP id 97A3ED1C961 for ; Fri, 15 Aug 2003 12:35:22 -0300 (ADT) Received: by THOR.goeci.com with Internet Mail Service (5.5.2653.19) id ; Fri, 15 Aug 2003 11:35:19 -0400 Message-ID: <2D92FEBFD3BE1346A6C397223A8DD3FC0923AF@THOR.goeci.com> From: Murthy Kambhampaty To: pgsql-general@postgresql.org Subject: Re: importing db as text files Date: Fri, 15 Aug 2003 11:35:12 -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/743 X-Sequence-Number: 47160 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!). It can be frustrating to deal with postgresql, but I've come to appreciate the requirement that you clean your data before you COPY it. Cheers, Murthy PS: Sorry "expect", I meant to send to the list, not directly to you. (I guess I'd better just hit "reply to all", and not edit the "To:" line.)