Re: How to find if a column is a "serial" column?

From: Kris Jurka <books(at)ejurka(dot)com>
To: Dave Bartmess <dingodave(at)edingo(dot)net>
Cc: PGSql List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: How to find if a column is a "serial" column?
Date: 2003-12-21 06:11:32
Message-ID: Pine.LNX.4.33.0312210105590.20574-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 20 Dec 2003, Dave Bartmess wrote:

> How do I determine if a column has been declared as a serial, since it
> only comes back in getColumns() as java.sql.Types.INTEGER in the
> resultset column "DATA_TYPE"?

Well, there is no value in java.sql.Types which represents the serial
data type. We could possibly return "serial" as the TYPE_NAME column
instead of int, but this could cause problems for other people who expect
it to return int. I would suggest examining COLUMN_DEF to see if it is
calling a sequence. This is kind of hack, but so is the serial type.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-12-22 15:09:40 postgres 7.4.1 release
Previous Message Dave Bartmess 2003-12-20 22:53:09 How to find if a column is a "serial" column?