Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 93B4F9F9F54 for ; Tue, 18 Sep 2007 01:31:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 60773-04-2 for ; Tue, 18 Sep 2007 01:31:47 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.190]) by postgresql.org (Postfix) with ESMTP id D1B2B9F9D80 for ; Tue, 18 Sep 2007 01:31:47 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id l15so1390266rvb for ; Mon, 17 Sep 2007 21:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=avjoCEkwLwSX8tgPY8nb8Q7NFAw2bt8HdjgVYnVDSUw=; b=FYvluT3Cz+Sk25PcSwQFbxPSR7wy9wwP4nFTGuLBD58u1rMr9RmCKU4ERolp8+addriR2wJhjV35BlCVKcjzmixpJTdDGpM7qWRJtS3Rs562oOhFhWHOKHqtBvUa6mVBoMO9F9RKvKLVq73r6DEU6xZIiGFnp8xzt26G1mM5pIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=iHrAaOO8RnBIepJVHDJ3QXbOhlUTxJ6XNS2yTrNEJ0TKPn5BSQxkD6hMNcZb6IEJdXDpjpbuP2zA378arUK+K7M/BQhR8LfJB+t/T/zHF7QGKzclCDFmkPjG1ZSVA8yd52Ok+mPf0hebE1tagYENTHRrkpgDgGh505gC24cb04w= Received: by 10.114.78.1 with SMTP id a1mr2325571wab.1190089906392; Mon, 17 Sep 2007 21:31:46 -0700 (PDT) Received: by 10.114.123.13 with HTTP; Mon, 17 Sep 2007 21:31:46 -0700 (PDT) Message-ID: <9f2e40a90709172131g26d681a1pf030910a1793f791@mail.gmail.com> Date: Tue, 18 Sep 2007 10:01:46 +0530 From: "soni de" To: "Ansgar -59cobalt- Wiechers" Subject: Re: Regarding COPY command from Postgres 8.2.0 Cc: pgsql-performance@postgresql.org In-Reply-To: <20070914120321.GA2615@mail.planetcobalt.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14863_16632623.1190089906382" References: <9f2e40a90709140321l11e6cdb5g91d8f8bf0a43fd01@mail.gmail.com> <20070914120321.GA2615@mail.planetcobalt.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/303 X-Sequence-Number: 26848 ------=_Part_14863_16632623.1190089906382 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline We have upgraded postgres from 7.2.4 to 8.2.0. We have program which executes COPY command and our new database is changed having some extra columns in some tables. Because of this, COPY commands are failing. So, we wanted the option to COPY the data without specifying column names. Thanks, Sonal On 9/14/07, Ansgar -59cobalt- Wiechers wrote: > > On 2007-09-14 soni de wrote: > > In Postgres 7.2.4, COPY command is working fine even if tables have 6 > > fields but we are copying only 5 fields from the file > > > > But in Postgres 8.2.0, if table has 6 fields and we need to copy data > > for 5 fields only, then we need to specify the column names too in > > COPY command. > > > > Is there any configurable option, so that without specifying column > > name in COPY command we can copy records in table as happened in > > Postgres 7.2.4? > > I don't know if it is possible, but even if it were I'd strongly > recommend against it, as you'd be relying on the order the columns were > created in. That's a rather bad idea IMHO. Why would you want to avoid > giving the names of the columns in the first place? > > Regards > Ansgar Wiechers > -- > "The Mac OS X kernel should never panic because, when it does, it > seriously inconveniences the user." > --http://developer.apple.com/technotes/tn2004/tn2118.html > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > ------=_Part_14863_16632623.1190089906382 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
We have upgraded postgres from 7.2.4 to 8.2.0.
We have program which executes COPY command and our new database is changed having some extra columns in some tables.
Because of this, COPY commands are failing.
So, we wanted the option to COPY the data without specifying column names.
 
Thanks,
Sonal

 
On 9/14/07, Ansgar -59cobalt- Wiechers <lists@planetcobalt.net> wrote:
On 2007-09-14 soni de wrote:
> In Postgres 7.2.4, COPY command is working fine even if tables have 6
> fields but we are copying only 5 fields from the file
>
> But in Postgres 8.2.0, if table has 6 fields and we need to copy data
> for 5 fields only, then we need to specify the column names too in
> COPY command.
>
> Is there any configurable option, so that without specifying column
> name in COPY command we can copy records in table as happened in
> Postgres 7.2.4?

I don't know if it is possible, but even if it were I'd strongly
recommend against it, as you'd be relying on the order the columns were
created in. That's a rather bad idea IMHO. Why would you want to avoid
giving the names of the columns in the first place?

Regards
Ansgar Wiechers
--
"The Mac OS X kernel should never panic because, when it does, it
seriously inconveniences the user."
--http://developer.apple.com/technotes/tn2004/tn2118.html

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

------=_Part_14863_16632623.1190089906382--