| From: | Mansour Al Akeel <mansour(dot)alakeel(at)gmail(dot)com> |
|---|---|
| To: | Dave Cramer <pg(at)fastcrypt(dot)com> |
| Cc: | dmp <danap(at)ttc-cmc(dot)net>, PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org> |
| Subject: | Re: Reading schema information |
| Date: | 2015-05-26 11:10:44 |
| Message-ID: | CAFvvX=bMXVTpgpBxVTgjC=EL7L9igwitYhAGVMoziy=TPRwBfg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
Done. :)
On Mon, May 25, 2015 at 7:50 PM, Dave Cramer <pg(at)fastcrypt(dot)com> wrote:
> Looks like a bug, can you please file it on github
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
> On 25 May 2015 at 11:21, dmp <danap(at)ttc-cmc(dot)net> wrote:
>>
>> dmp wrote:
>>>
>>> dmp wrote:
>>>>
>>>> Mansour Al Akeel wrote:
>>>>>
>>>>> Sorry for missing the email subject in my previous email !
>>>>>
>>>>> I am trying to get some information about a coloum using the method:
>>>>>
>>>>> DatabaseMetaData.getString("IS_GENERATEDCOLUMN")
>>>>>
>>>>> However it is throwing an exception:
>>>>>
>>>>> org.postgresql.util.PSQLException: The column name IS_GENERATEDCOLUMN
>>>>> was not found in this ResultSet.
>>>>>
>>>>> Based on javadoc for getColumns method:
>>>>>
>>>>>
>>>>> http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 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) ?
>>>>>
>>>>>
>>>>> Thank you.
>>>>>
>>>
>>> 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?
>>>
>>> danap.
>>>
>>
>> Hello,
>>
>> 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.
>>
>>
>> danap.
>>
>>
>>
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://stream.boxwatch.ru/mailpref/pgsql-jdbc
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Mark Rotteveel | 2015-05-26 11:51:52 | Re: Reading schema information |
| Previous Message | Dave Cramer | 2015-05-25 15:50:00 | Re: Reading schema information |