Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMc8p-0003Zd-Um for pgsql-jdbc@postgresql.org; Fri, 12 Oct 2012 10:06:52 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMc8k-0002Bh-GM for pgsql-jdbc@postgresql.org; Fri, 12 Oct 2012 10:06:51 +0000 Received: by mail-pb0-f46.google.com with SMTP id rr4so2793895pbb.19 for ; Fri, 12 Oct 2012 03:06:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=fcFskjAwI8VdVeAzPFC+E60I5q7d8Xl7OYY8ky69kUs=; b=BtEPj6Y0SQMRmFaLVacQ1mhexIxWPDiNLRakuPKFkrKlJeriGvFTn74tM9nzDmx8HJ IuRPWg+VSFsR78qqC5kqRg0vOu37IqAeCHIsBxv1iORdIeEMKD2TOKnNgeeAvAMSSgL9 Ry19EKHbTyUYCqXkcuqJ/2IcGZHiixzfvl3ZOrLe2BMaede1yeQ57TGM3bwhZxTah+Fw fhy2FaKUwZO4sC8ZOnN6LOnkgtmvpkeLgzIKJbEO0VQARovGPulszoRAUiHlY3wCHQxM rmweLsGXaNJJfNTRj4wsY9Ha90cgwcys2zDKTxMmus9G3FPnX08KzGJUWdrxxqxlrESX t4Zg== Received: by 10.68.125.226 with SMTP id mt2mr11949401pbb.120.1350036404317; Fri, 12 Oct 2012 03:06:44 -0700 (PDT) Received: from ayaki.localdomain (58-7-144-234.dyn.iinet.net.au. [58.7.144.234]) by mx.google.com with ESMTPS id uu10sm4234357pbc.2.2012.10.12.03.06.40 (version=SSLv3 cipher=OTHER); Fri, 12 Oct 2012 03:06:42 -0700 (PDT) Message-ID: <5077EBAD.5060708@ringerc.id.au> Date: Fri, 12 Oct 2012 18:06:37 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Luis Flores CC: Thomas Kellerer , "pgsql-jdbc@postgresql.org" Subject: Re: bug report: slow getColumnTypeName References: <50745541.8060204@ttc-cmc.net> <50776FB4.5090701@ringerc.id.au> <5077C103.4040701@ringerc.id.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmz2O53IczscEN2aB8VoEkuGhF+/8PU+UJlO03c6ugpyx2rbBhRiusA+kDBZANjeNv6fdmD X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/57 X-Sequence-Number: 23381 On 10/12/2012 04:39 PM, Luis Flores wrote: > I agree, my only doubt is about the reasons behind the change, the driver was reporting int4, int8, and then was changed, why? Yep, that I'd like to know. The change appears to be: commit ddf8296bead68552a8e5de0f5bb20875273bb02d Author: Kris Jurka Date: Thu Sep 30 07:58:11 2004 +0000 Return serial datatypes in both getTypeInfo and getColumns methods. Jaroslaw J. Pysnzy Also add a test case for this and fix my previous regression test breakage on 7.2 servers. With serial columns before dependency information dropping a table did not drop the sequences that went with it. Explicitly drop them. Kris Jurka see git diff ddf8296bead68552a8e5de0f5bb20875273bb02d..8c9d68ee7763851732de0bd0d14b2b51cdfe0622 That code is all kinds of wrong. Check this out: if ( defval != null ) { if ( pgType.equals("int4") ) { if (defval.indexOf("nextval(") != -1) tuple[5] = connection.encodeString("serial"); } else if ( pgType.equals("int8") ) { if (defval.indexOf("nextval(") != -1) tuple[5] = connection.encodeString("bigserial"); } } *any* int4 or int8 with a DEFAULT nextval(... is reported as "serial" or "bigserial" whether or not it is. See AbstractJdbc2DatabaseMetaData.java line 2480. -- Craig Ringer