pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alan Chandler <alan@chandlerfamily.org.uk>
To: pgsql-sql@postgresql.org
Subject: Matching the MYSQL "Describe <table-name>" command
Date: Sun, 24 Apr 2005 19:02:16 +0100
Message-ID: <200504241902.16770.alan@chandlerfamily.org.uk> (raw)

I am rather new to Postgres (running 7.4) but I am trying to port some PHP 
code that has been built to run with mysql.

I have got stuck trying to find the equivalent of the Mysql "DESCRIBE 
<tablename>;" SQL statement that lists the columns and type identifiers of a 
table.

I think I am going to do a SELECT on the "pg_attribute" table, but I don't 
understand what the "attrelid" column of that table refers to.  I need to get 
the table name of the column so that I can restrict the select with a WHERE 
clause so I assumed it was a key into the pg_class table, but I can't see a 
column in this table that could potentially correspond and therefore I could 
join to it.

Help
-- 
Alan Chandler
http://www.chandlerfamily.org.uk



view thread (5+ messages)  latest in thread

Message-ID: <200504241902.16770.alan@chandlerfamily.org.uk>
Permalink:  ../200504241902.16770.alan@chandlerfamily.org.uk/
Also on:    postgresql.org/message-id/200504241902.16770.alan@chandlerfamily.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alan@chandlerfamily.org.uk
  Subject: Re: Matching the MYSQL "Describe <table-name>" command
  In-Reply-To: <200504241902.16770.alan@chandlerfamily.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox