From: Mark Rotteveel <mark@lawinegevaar.nl>
To: dmp <danap@ttc-cmc.net>
Cc: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Reading schema information
Date: Tue, 26 May 2015 13:51:52 +0200
Message-ID: <603930fe7a21fa575e0bd53972d38296@imap.procolix.com> (raw)
In-Reply-To: <55633DFE.6020306@ttc-cmc.net>
References: <CAFvvX=aeL4yfjA8Ng4Aek3W_FzO9zgihtRTXzaaaFw55d9GU1A@mail.gmail.com>
<55632843.8060109@ttc-cmc.net>
<55633883.5060900@ttc-cmc.net>
<55633DFE.6020306@ttc-cmc.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On Mon, 25 May 2015 09:21:34 -0600, dmp <danap@ttc-cmc.net> wrote:
> dmp wrote:
>> dmp wrote:
>>> Mansour Al Akeel wrote:
...
>>>> We have:
>>>>
>>>> IS_GENERATEDCOLUMN String => Indicates whether this is a generated
>>>> column
>>>>
>>>> YES --- if this a generated column
>>>> NO --- if this not a generated column
>>>> empty string --- if it cannot be determined whether this is a
>>>> generated column
>>>>
>>>>
>>>> My questions is, is this a bug ? if not, how can I obtain this
>>>> information about a column (if it's generated or not) ?
>>>>
>> Hello,
>>
>> I'm sorry, after testing, currently the given name IS_GENERATEDCOLUMN
is
>> given the error as you describe. The index of 23 can be used to obtain
>> the
>> results desired.
>>
>> Did you search the mailing list for a report or issue on this?
>
> Sorry for an earlier error.
>
> rs = dbMetaData.getColumns(tableMetaData.getCatalogName(1),
> tableMetaData.getSchemaName(1),
> tableMetaData.getTableName(1), "%");
>
> On further check,
> org.postgresql.Abstractjdbc2DatabaseMetaData.getColumns() does
> not implement the named Field IS_GENERATEDCOLUMN. As indicated using an
> index
> of 23 instead of the named Field should work.
Index 23 is IS_AUTOINCREMENT which does not have the same meaning as
IS_GENERATEDCOLUMN (index 24) which was added to the JDBC specification in
Java 7 / JDBC 4.1. The former is only for one specific column type: auto
increment (eg serial), while the latter is for all calculated or otherwise
generated columns.
Mark
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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: mark@lawinegevaar.nl, danap@ttc-cmc.net
Subject: Re: Reading schema information
In-Reply-To: <603930fe7a21fa575e0bd53972d38296@imap.procolix.com>
References: <CAFvvX=aeL4yfjA8Ng4Aek3W_FzO9zgihtRTXzaaaFw55d9GU1A@mail.gmail.com> <55632843.8060109@ttc-cmc.net> <55633883.5060900@ttc-cmc.net> <55633DFE.6020306@ttc-cmc.net> <603930fe7a21fa575e0bd53972d38296@imap.procolix.com>
* 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