X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7F118329E73 for ; Tue, 21 Sep 2004 23:48:11 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18468-04 for ; Tue, 21 Sep 2004 22:48:00 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 2FE2C329C67 for ; Tue, 21 Sep 2004 23:48:01 +0100 (BST) Received: (qmail 1060 invoked from network); 21 Sep 2004 22:48:21 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 21 Sep 2004 22:48:21 -0000 Subject: Re: Auto-increment serial (Postgresql JDBC driver w/ From: Dave Cramer Reply-To: pg@fastcrypt.com To: "Jaroslaw J. Pyszny" Cc: Kris Jurka , pgsql-jdbc In-Reply-To: <1095798675.1557.122.camel@localhost.localdomain> References: <1095725344.10857.107.camel@lx.siec> <1095794747.18680.23.camel@lx.siec> <1095798675.1557.122.camel@localhost.localdomain> Content-Type: text/plain; charset=iso-8859-2 Organization: Cramer Consulting Message-Id: <1095807031.1556.129.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 21 Sep 2004 18:50:31 -0400 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/144 X-Sequence-Number: 11034 Sorry, missed one more where clause. select column_default from information_schema.columns where table_name = 'xyz' and column_name = 'id'; This assumes a table defined like create table xyz (id serial); Dave On Tue, 2004-09-21 at 16:31, Dave Cramer wrote: > This is probably a much more portable way to get the same information. > > select column_default from information_schema.columns where table_name > = 'xyz'; > > Dave > On Tue, 2004-09-21 at 15:25, Jaroslaw J. Pyszny wrote: > > W li¶cie z wto, 21-09-2004, godz. 03:50, Kris Jurka pisze: > > > On Mon, 21 Sep 2004, Jaroslaw J. Pyszny wrote: > > > > > > > > The basic idea looks good to me, but you've made a mistake in the > > > isAutoIncrement() method. You are using the column number from the > > > ResultSet to look up the default when you need to actually use that > > > column's position in the table. In fact it looks like the whole method > > > body should be moved into the Field class much like the isNullable method > > > does. This also avoid the contrived hash key value. > > > > > > Finally we prefer patches in context diff format (diff -c). > > Thanks :) > > I'll try fix it. > > > > Jarek -- Dave Cramer 519 939 0336 ICQ # 14675561 www.postgresintl.com