Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 8FFAE9FB3F0 for ; Sat, 17 Feb 2007 15:17:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 40077-02 for ; Sat, 17 Feb 2007 15:17:35 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web32005.mail.mud.yahoo.com (web32005.mail.mud.yahoo.com [68.142.207.102]) by postgresql.org (Postfix) with SMTP id B5DDD9FB3D0 for ; Sat, 17 Feb 2007 15:17:42 -0400 (AST) Received: (qmail 41351 invoked by uid 60001); 17 Feb 2007 19:17:41 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=6ZIDY5BmCSg9UEkNhwXE+bmcQp8NWuQQK1ubeeXMMOUdxnmZqcliMh8l3tUM2lxdoomatZ3kg0x4AQyOS16bQFlySOXxrIOR/R3da552ACHUkLLj1WLVnDSU641STw0pd6Q0wspvTt2NWOpSrLsV85gcQV973cJ2gdrNftgY5AE=; X-YMail-OSG: 6fmd_nIVM1kcXl8nZRK6kUvzyKIvxWS8p5_6Ix.oMOvE66E2E6xRpHXzIg7T4djdoGL7hzkmJqHfBAoaghTrlZk7inlQxIGIq1xqLHMGJwHmsl4nYMiVp0PWWquWDkdu3UK77Ij9kJtQkWw- Received: from [71.242.22.36] by web32005.mail.mud.yahoo.com via HTTP; Sat, 17 Feb 2007 11:17:41 PST Date: Sat, 17 Feb 2007 11:17:41 -0800 (PST) From: "j.random.programmer" Subject: Re: Bug in metadata.getColumns()/ORDINAL_POSITION To: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <616596.40210.qm@web32005.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.615 tagged_above=0 required=5 tests=BAYES_20, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: ** X-Archive-Number: 200702/84 X-Sequence-Number: 16640 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. For for example: test=# create table foo(x int, y varchar(5)); At this point, the jdbc metadata (md) method: md.getColumns( catalogname, schemaname, tablename, "%"); returns the correct ORDINAL_POSITION for x and y. x -- >1 y ---> 2 Now, let's do this: test=# alter table foo add z text; ALTER TABLE test=# alter table foo drop z; ALTER TABLE test=# alter table foo drop y; ALTER TABLE test=# alter table foo add a varchar(10); md.getColumns( catalogname, schemaname, tablename, "%"); now returns x --> 1 a --> 4 and that's the bug right there. Should be a ---> 2 (NOT 4) since there are only 2 columsn in the database at this point. Maybe the database is not updating the system tables properly when columns are altered/dropped ? Or is this something in the driver ? Either way, this totally breaks any O/R mapping tool. Best regards, -j ____________________________________________________________________________________ TV dinner still cooling? Check out "Tonight's Picks" on Yahoo! TV. http://tv.yahoo.com/