"\d tablename" to get column name, and column type by using JDBC

Поиск
Список
Период
Сортировка
От Ying Lu
Тема "\d tablename" to get column name, and column type by using JDBC
Дата
Msg-id 413733C6.5050604@cs.concordia.ca
обсуждение исходный текст
Ответы Re: "\d tablename" to get column name, and column type by using JDBC  (Paul Thomas <paul@tmsl.demon.co.uk>)
R: "\d tablename" to get column name, and column type by using JDBC  ("Leonardo Francalanci" <lfrancalanci@simtel.ie>)
Re: "\d tablename" to get column name, and column type by  (Doug McNaught <doug@mcnaught.org>)
Список pgsql-general
Hello,

Under mysql, we have "desc tablename" to get the detail information
about a table. My question is about to get column name, and column type
for a specific table under PostgreSQL through JDBC.

Assume we have a table named "test". Under PSQL, we can input "\d test"
to see the details about table "test" successufully.  However, my main
purpose is trying to get column name, column name of a table through JDBC.

The following is the java code, by which I always get "   ERROR: syntax
error at or near "\"      ".

Some clues?
Emi

====================================================================================
            Connection connection     = DriverManager.getConnection(url,
"abc", "abc");      //username and pwd is "abc"
            Statement stmt             = connection.createStatement();
            String query                = "\\d test";
            System.out.println("query: "+query);
            ResultSet rs                 = stmt.executeQuery(query);





В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Foreign key locks
Следующее
От: "Owens, Steve"
Дата:
Сообщение: Odd problem in 7.4.2?