Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A7A7F9FB5EE for ; Sat, 17 Feb 2007 16:01:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 44926-03 for ; Sat, 17 Feb 2007 16:01:39 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id BBEF19FB599 for ; Sat, 17 Feb 2007 16:01:46 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l1HK1jo9023751; Sat, 17 Feb 2007 15:01:45 -0500 (EST) To: "j.random.programmer" cc: pgsql-jdbc@postgresql.org Subject: Re: Bug in metadata.getColumns()/ORDINAL_POSITION In-reply-to: <616596.40210.qm@web32005.mail.mud.yahoo.com> References: <616596.40210.qm@web32005.mail.mud.yahoo.com> Comments: In-reply-to "j.random.programmer" message dated "Sat, 17 Feb 2007 11:17:41 -0800" Date: Sat, 17 Feb 2007 15:01:45 -0500 Message-ID: <23750.1171742505@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/85 X-Sequence-Number: 16641 "j.random.programmer" writes: > This is a quick followup to my earlier post. Upon > further > testing, this bug reliably and reproducably happens > when an "alter table" command is used on the database. So the problem is that it's returning pg_attribute.attnum without any consideration for earlier dropped columns. Not sure how expensive it'd be to get the current logical column number, though --- at a minimum one would have to select all the table's pg_attribute rows :-( regards, tom lane