Re: How to find if a column is a "serial" column? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: How to find if a column is a "serial" column?
Date
Msg-id Pine.LNX.4.33.0312210105590.20574-100000@leary.csoft.net
Whole thread Raw
In response to How to find if a column is a "serial" column?  (Dave Bartmess <dingodave@edingo.net>)
Responses postgres 7.4.1 release
List 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


pgsql-jdbc by date:

Previous
From: Dave Bartmess
Date:
Subject: How to find if a column is a "serial" column?
Next
From: Dave Cramer
Date:
Subject: postgres 7.4.1 release