pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Luis Flores <luiscamposflores@gmail.com>
Cc: David Johnston <polobo@yahoo.com>
Cc: Eyal Wilde <eyal.wilde@gmail.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Cc: dmp <danap@ttc-cmc.net>
Subject: Re: bug report: slow getColumnTypeName
Date: Fri, 12 Oct 2012 09:17:40 +0800
Message-ID: <50776FB4.5090701@ringerc.id.au> (raw)
In-Reply-To: <CA+nXnG-N2Fz3TUsxa485RL6n78L4aPWr4=HOnav0MR8EowErZQ@mail.gmail.com>
References: <CAMiEbch4MsNhkTamK3dt4GpJ8qU0BObYPmMNGkrzVFLjwONMpQ@mail.gmail.com>
	<CAMiEbchygfLbpytyOdDXL3-ORjMD76u_0MqwX9QROzCkHUUp0Q@mail.gmail.com>
	<50745541.8060204@ttc-cmc.net>
	<CA+nXnG8thQTe6D-njQYqQUd-LuXD2--RBejCz6Oq7dtMUEEs=g@mail.gmail.com>
	<CA+nXnG-xy8GvVj1gH0f0evuL0uvyw9f87zQVks_zzyuY7ZJEFA@mail.gmail.com>
	<CA+nXnG_Ma7c2kjsQJPDQMwXtsJHPW+7U0G3dQSzH8YpFMxaVSQ@mail.gmail.com>
	<CAMiEbchMwYJE7ShZw2YhSWV2MQ4mPA7Npti9Q2PiADhx8wCNkQ@mail.gmail.com>
	<CA+nXnG-_K3yLEm=daMV9fy7XNZLK8zBrMiE2UOm05vCBsBvmig@mail.gmail.com>
	<B0909057-2120-4C85-A442-0D0098DD4ACE@yahoo.com>
	<CA+nXnG-N2Fz3TUsxa485RL6n78L4aPWr4=HOnav0MR8EowErZQ@mail.gmail.com>

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 <TABLE>_<COLUMN>_seq, then in postgresql (you can
> check in pgadmin)

PgAdmin is doing something funky; that doesn't mean PgJDBC should.

--
Craig Ringer




view thread (30+ messages)  latest in thread

Message-ID: <50776FB4.5090701@ringerc.id.au>
Permalink:  ../50776FB4.5090701@ringerc.id.au/
Also on:    postgresql.org/message-id/50776FB4.5090701@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: ringerc@ringerc.id.au, luiscamposflores@gmail.com, polobo@yahoo.com, eyal.wilde@gmail.com, danap@ttc-cmc.net
  Subject: Re: bug report: slow getColumnTypeName
  In-Reply-To: <50776FB4.5090701@ringerc.id.au>
  References: <CAMiEbch4MsNhkTamK3dt4GpJ8qU0BObYPmMNGkrzVFLjwONMpQ@mail.gmail.com> <CAMiEbchygfLbpytyOdDXL3-ORjMD76u_0MqwX9QROzCkHUUp0Q@mail.gmail.com> <50745541.8060204@ttc-cmc.net> <CA+nXnG8thQTe6D-njQYqQUd-LuXD2--RBejCz6Oq7dtMUEEs=g@mail.gmail.com> <CA+nXnG-xy8GvVj1gH0f0evuL0uvyw9f87zQVks_zzyuY7ZJEFA@mail.gmail.com> <CA+nXnG_Ma7c2kjsQJPDQMwXtsJHPW+7U0G3dQSzH8YpFMxaVSQ@mail.gmail.com> <CAMiEbchMwYJE7ShZw2YhSWV2MQ4mPA7Npti9Q2PiADhx8wCNkQ@mail.gmail.com> <CA+nXnG-_K3yLEm=daMV9fy7XNZLK8zBrMiE2UOm05vCBsBvmig@mail.gmail.com> <B0909057-2120-4C85-A442-0D0098DD4ACE@yahoo.com> <CA+nXnG-N2Fz3TUsxa485RL6n78L4aPWr4=HOnav0MR8EowErZQ@mail.gmail.com> <50776FB4.5090701@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox