Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Posts
    5

    Unanswered: how to retrieve table's column with its datatype

    hi...
    1st of all, i want to apologize for my broken english...

    i'm here about to ask if anybody here knows how to get table's column name with it's data type,
    i try to join the pg_tables and pg_type but the data type type of that column wasn't appear
    if i type "select * from pg_tables where tablename not like 'pg_%';"

    the result is like below :-
    schemaname | tablename | tableowner | hasindexes | hasrules | hastriggers
    -------------------------------------------------------------------------
    public | table1 | owner1 | f | f | f
    public | table2 | owner2 | f | f | f


    how can i get the result like this :-
    tablename | datatype | defaultvalues
    --------------------------------------------------------------------------
    table1 |varchar(12) | abc
    table1 |varchar(12) | def
    table1 |varchar(12) | ghi
    table1 |varchar(12) | jkl
    table1 |varchar(12) | mno
    table2 |int | 123
    table2 |int | 345
    table2 |int | 567
    table2 |int | 789
    table2 |int | 980


    is it can be done by joining the "pg_" file..
    if the answer is yes, how...?
    can anyone tell me plss...

  2. #2
    Join Date
    Feb 2004
    Posts
    78
    You want to look at the file and field ddf files. You can query them in the PCC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •