Thread: table and column's comments

table and column's comments

From
"Katalina Marcos"
Date:

Hi all!

 

I want to ask you if I can retrieve table’s comment and column’s comments whit ResultSetMetaData in pgjdbc.

 

I did prove with a simple query ("select * from ca_t_nivel where 1=0") but table name is empty and column label is the same column name… I did use pg74.213.jdbc3.jar, my output:

 

table name

column number: 1

column name: tpl_nivel_conshist

column label: tpl_nivel_conshist

column type: 4

column classname: java.lang.Integer

column display size: 11

column number: 2

column name: td_nivel_fechoper

column label: td_nivel_fechoper

column type: 93

column classname: java.sql.Timestamp

column display size: 22

 

I’ve searched in mail list but I didn’t found much about it…

 

Thanks in advance…

Kata

Re: table and column's comments

From
Oliver Jowett
Date:
Katalina Marcos wrote:

> I want to ask you if I can retrieve table’s comment and column’s
> comments whit ResultSetMetaData in pgjdbc.

You can't get at the comments via the standard interface; it has no
provision for them. The label fields are apparently intended for output
formatting, not for comment display. See the discussion at:

   http://archives.postgresql.org/pgsql-jdbc/2004-07/msg00314.php
   http://archives.postgresql.org/pgsql-jdbc/2004-08/msg00008.php

If you need to get at the comments, you'll need to do a
postgresql-specific query.

-O

Re: table and column's comments

From
"Katalina Marcos"
Date:
Ok...

Thanks for your replay
Kata

-----Mensaje original-----
De: Oliver Jowett [mailto:oliver@opencloud.com]
Enviado el: miércoles, 06 de octubre de 2004 17:11
Para: kmarcos@mazda.com.co
CC: pgsql-jdbc@postgresql.org
Asunto: Re: [JDBC] table and column's comments

Katalina Marcos wrote:

> I want to ask you if I can retrieve table’s comment and column’s
> comments whit ResultSetMetaData in pgjdbc.

You can't get at the comments via the standard interface; it has no
provision for them. The label fields are apparently intended for output
formatting, not for comment display. See the discussion at:

   http://archives.postgresql.org/pgsql-jdbc/2004-07/msg00314.php
   http://archives.postgresql.org/pgsql-jdbc/2004-08/msg00008.php

If you need to get at the comments, you'll need to do a
postgresql-specific query.

-O


Re: table and column's comments

From
"Katalina Marcos"
Date:
Thanks a lot!
Kata

-----Mensaje original-----
De: Kris Jurka [mailto:books@ejurka.com]
Enviado el: miércoles, 06 de octubre de 2004 23:51
Para: Katalina Marcos
CC: pgsql-jdbc@postgresql.org
Asunto: Re: [JDBC] table and column's comments



On Wed, 6 Oct 2004, Katalina Marcos wrote:

> I want to ask you if I can retrieve table's comment and column's comments
> whit ResultSetMetaData in pgjdbc.

Not with ResultSetMetaData, but with DatabaseMetaData you can.
Both getTables and getColumns have REMARKS columns.

Kris Jurka


Re: table and column's comments

From
Kris Jurka
Date:

On Wed, 6 Oct 2004, Katalina Marcos wrote:

> I want to ask you if I can retrieve table's comment and column's comments
> whit ResultSetMetaData in pgjdbc.

Not with ResultSetMetaData, but with DatabaseMetaData you can.
Both getTables and getColumns have REMARKS columns.

Kris Jurka