Serial data type - Mailing list pgsql-jdbc

From Christian Rengstl
Subject Serial data type
Date
Msg-id 474FF9E7.90AD.0080.0@klinik.uni-regensburg.de
Whole thread Raw
Responses Re: Serial data type
Re: Serial data type
Re: Serial data type
List pgsql-jdbc
Hi everyone,

in my Java app at certain points INSERT queries are built dynamically,
but now i am facing a problem when the target table contains a SERIAL
field where NULL values are not allowed. Therefore I have two questions:

1) How can I find out if there is a serial field in a table, as
getColumnType() in ResultSetMetaData does not return a field indicating
SERIAL as far as I could see?
2) Why does it not work to issue a query like INSERT INTO
x(serial_field) VALUES(NULL) as the default of the "serial_field" is
nextval() anyway?

Thanks!


Christian Rengstl M.A.
Klinik und Poliklinik für Innere Medizin II
Kardiologie - Forschung
Universitätsklinikum Regensburg
B3 1.388
Franz-Josef-Strauss-Allee 11
93053 Regensburg
Tel.: +49-941-944-7230




pgsql-jdbc by date:

Previous
From: tivvpgsqljdbc@gtech-ua.com
Date:
Subject: Re: PreparedStatement vs. Statement problem
Next
From: Kris Jurka
Date:
Subject: Re: Serial data type