How to get column comment

Hi,

I am using pgSQL as database with JSP.

I have given coomets to each column in table.

I have retieved the column comment using :

"select col_description('table_name'::regclass,column+index)"

Now i have stored these column comments in a combo box.

Now i want to retrieve the column name matching with the comments in combo.

When user selects the comment from combo then appropriate column name should be desplayed below.

I am not able to get column name in pgsql...

so i retrived its comment using above method.

is there any method to retrieve column comment in JAVA?

Help me

Eexample:

suppose

table_name=institute

columns: instcode,instname.

column comments: institute code,institute name // this will be in combo

When user selects "institute name" from combo then "instcode" then i should get "instname"

PLz help me

[959 byte] By [Atmaling_Kshirsagara] at [2007-11-27 8:06:06]
# 1

The following found when googled "pgsql retrieve column name":

at http://archives.postgresql.org/pgsql-sql/1999-05/msg00150.php:

To retrieve the table names , use the pg_tables :

SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%';

To retrieve the column names , you can use the pg_attribute and

pg_type tables :

SELECT attname , typname FROM pg_attribute , pg_type WHERE

typrelid=attrelid AND typname = 'banals' ;

if your table name is 'banals' , but this will give you 6 columns that

you haven't declared : cmax,xmax,cmin,xmin,oid,ctid .

If you want column names with its type :

SELECT attname , opcname , atttypmod FROM pg_attribute,pg_type,

pg_opclass WHERE attrelid=typrelid AND atttypid=opcdeftype AND

typname = 'banals' ;

dwga at 2007-7-12 19:48:39 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...