Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMTt7-0004kF-38 for pgsql-jdbc@postgresql.org; Fri, 12 Oct 2012 01:18:05 +0000 Received: from mail-da0-f46.google.com ([209.85.210.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMTt4-0002nx-1Y for pgsql-jdbc@postgresql.org; Fri, 12 Oct 2012 01:18:03 +0000 Received: by mail-da0-f46.google.com with SMTP id n41so1045583dak.19 for ; Thu, 11 Oct 2012 18:17:59 -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=fKwgbcPVF4gBjjblpIHNSJ1eKoSpvcTuYCjFIchOLEY=; b=i19PkD6yJlXe9K1gWtVlY7HjrIByk2OaQYLmV3pcPTfrmr0h/simbwIBXL/NErHWS4 Ckn+Yooc23HXcbuY5jnhVk3rNfeT9ZLF7QXfI7CstbHw12VAq71R/3jLJrDfi97aBEqO U+N/KmjKDVcu6WZWw9FEB8/p4bzWEngZ2TWspRLvzDJnv+/3+SO6jf+sgF9MPcGieLac TSXa6sScJ8DNFJ4JzmsrrsFT8T6oLHo5hvaSWmbuWOYp1cecnblLcxv/olXAHvSsjpmU Otn7heBBTedFJCH6IhY4N4Y4dz8Ny3C+TGCXeCtdE9OagVwsPvd9ZdWwDOEX6azjo2vB ZLtw== Received: by 10.68.211.99 with SMTP id nb3mr9180449pbc.16.1350004679600; Thu, 11 Oct 2012 18:17:59 -0700 (PDT) Received: from ayaki.localdomain ([211.29.169.132]) by mx.google.com with ESMTPS id o7sm3430749pay.14.2012.10.11.18.17.50 (version=SSLv3 cipher=OTHER); Thu, 11 Oct 2012 18:17:58 -0700 (PDT) Message-ID: <50776FB4.5090701@ringerc.id.au> Date: Fri, 12 Oct 2012 09:17:40 +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: David Johnston , Eyal Wilde , "pgsql-jdbc@postgresql.org" , dmp Subject: Re: bug report: slow getColumnTypeName References: <50745541.8060204@ttc-cmc.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQliuNEXWCdwzG+jhYQfThWBzlOkh6SP8PxjQJe0JSsYISplW5EhNABSRFnlqWJ3HVazsIiD X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/50 X-Sequence-Number: 23374 On 10/11/2012 10:07 PM, Luis Flores wrote: > You are talking about a different matter. > 1. 802 and prior drivers named serials as int4 (and big serials int8) > 2. 900 and newer drivers named serials as serials (and you got a > performance hit from that) > > We are now attempting to solve the problem #2, maintain the correct > column name (serial and big serial), and if possible improve > performance. I strongly disagree with this approach. "serial" and "bigserial" are *not* the correct column names. "serial" and "bigserial" are effectively macros and cease to exist in any meaningful way once expanded. Even if showing "serial" or "bigserial" were free, I'd still want to show the underlying types "integer" and "biginteger". Showing "serial" is not consistent with psql: regress=# CREATE TABLE blah ( id serial primary key); NOTICE: CREATE TABLE will create implicit sequence "blah_id_seq" for serial column "blah.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "blah_pkey" for table "blah" CREATE TABLE regress=# \d blah Table "public.blah" Column | Type | Modifiers --------+---------+--------------------------------------------------- id | integer | not null default nextval('blah_id_seq'::regclass) Indexes: "blah_pkey" PRIMARY KEY, btree (id) ... nor with INFORMATION_SCHEMA: select * from information_schema.columns WHERE table_schema = 'public' AND table_name = 'blah'; -[ RECORD 1 ]------------+--------------------------------- table_catalog | regress table_schema | public table_name | blah column_name | id ordinal_position | 1 column_default | nextval('blah_id_seq'::regclass) is_nullable | NO data_type | integer numeric_precision | 32 numeric_precision_radix | 2 numeric_scale | 0 ... udt_catalog | regress udt_schema | pg_catalog udt_name | int4 ... dtd_identifier | 1 is_self_referencing | NO is_identity | NO ... is_generated | NEVER ... is_updatable | YES > If you use a column with a default value from a sequence, the column > type name doesn't change. If the column is int AND is generated from a > sequence called __seq, then in postgresql (you can > check in pgadmin) PgAdmin is doing something funky; that doesn't mean PgJDBC should. -- Craig Ringer