Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PostGreSQL question

Options
  • 07-08-2002 10:31am
    #1
    Registered Users Posts: 14,148 ✭✭✭✭


    Hey guys,

    I'm just wondering if there's a command to view the structure of a table as opposed to the content?

    eg.

    table X
    xid sequence ;
    xName char(10) not null ;
    xVar1 integer default 0;

    etc, etc.


Comments

  • Closed Accounts Posts: 286 ✭✭Kev


    load up psql and type

    \d tablename

    although it looks like you want an sql statement ?


  • Registered Users Posts: 14,148 ✭✭✭✭Lemming


    ARGGGH ... ... /me stupid!!!

    the \d command was under my nose the whole time.

    If it shows you the schema of a database, then it stands to reason it'll show you the schema of a table

    pffftt .. you idiot!

    Thanks Kev! That's what I was looking for :)


    [edit]
    Incidentally ... there's another way of gettign the information. Do a pg_dump (and if you want) dump it to file.
    [/edit]


Advertisement