Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMZIb-0001um-GG for pgsql-jdbc@postgresql.org; Fri, 12 Oct 2012 07:04:45 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMZIZ-0007sf-6X for pgsql-jdbc@postgresql.org; Fri, 12 Oct 2012 07:04:44 +0000 Received: by mail-pa0-f46.google.com with SMTP id hz1so2560831pad.19 for ; Fri, 12 Oct 2012 00:04:41 -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=gzv+2lXXJVQEJB95sxXw7lyzeE1Lk1j79BLvB3115Fs=; b=KD4nRiNBGTkB/7Jo+Q0lO1wYYwQJDhPrGTB7420XNngOEAvoxT5nuX8vkM/0Ac1mV1 ZAFQx46IfPg65UdvEjI33EMsIEOzAMvpo/rByD+O8Uinb7UWM0UJZTcoiatyq6u2HnEo HrGBje2x5DVoUJih5A/EaYOrKNqiyY5A3xHI8HTMS3aOX/LG44j0adLU+MUym3h+4C2s WrlCvMa2cGuO3SVcKEcQ+2So3u6AR1/VssCBQtPlxVJZIp15/NBrYcVTrrxMnuzEqdQY TfTpfQTSyZvnnGHh0dXYuLx/RhpbiBkcbbAOOOfpvhhrxE9aA/R8gj6pX3p18/R03Ldn 1lpg== Received: by 10.68.130.201 with SMTP id og9mr11248048pbb.12.1350025481472; Fri, 12 Oct 2012 00:04:41 -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 i2sm3891603pay.31.2012.10.12.00.04.38 (version=SSLv3 cipher=OTHER); Fri, 12 Oct 2012 00:04:40 -0700 (PDT) Message-ID: <5077C103.4040701@ringerc.id.au> Date: Fri, 12 Oct 2012 15:04:35 +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: Thomas Kellerer CC: pgsql-jdbc@postgresql.org Subject: Re: bug report: slow getColumnTypeName References: <50745541.8060204@ttc-cmc.net> <50776FB4.5090701@ringerc.id.au> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkanWZkgKYNOJcy5hukaWHNWFGQwzJsgm9fjMK5uZ//2GZNLPYV1tAY78VUeqMrzz0nqU5Q X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/53 X-Sequence-Number: 23377 On 10/12/2012 02:33 PM, Thomas Kellerer wrote: > When looking at a CREATE TABLE statement in a SQL tool, users expect to > see "serial" there if the table was created that way. Applications can check the metadata and make any transformations they want for display. The fact remains that the data type is "integer" or "biginteger". JDBC isn't for the "end user", it's an API for developers, much like libpq. I maintain that presenting "serial" or "bigserial" as a *type* is just plain wrong. If nothing else: regress=# create table blah ( id serial primary key ); CREATE TABLE regress=# PREPARE insert_blah(serial) AS INSERT INTO blah(id) regress-# VALUES ($1); ERROR: type "serial" does not exist LINE 1: PREPARE insert_blah(serial) AS INSERT INTO blah(id) VALUES (... Also: regress=# SELECT '1'::serial; ERROR: type "serial" does not exist LINE 1: SELECT '1'::serial; Seriously, reporting the type as "serial" is just plain wrong. -- Craig Ringer