Received: from Radha.DoCS.UU.SE (root@Radha.DoCS.UU.SE [130.238.9.99]) by hub.org (8.9.3/8.9.3) with SMTP id MAA79443 for ; Sat, 13 Nov 1999 12:04:46 -0500 (EST) (envelope-from e99re41@DoCS.UU.SE) Received: from Val.DoCS.UU.SE (e99re41@Val.DoCS.UU.SE [130.238.9.94]) by Radha.DoCS.UU.SE (8.6.12/8.6.12) with ESMTP id SAA04674; Sat, 13 Nov 1999 18:04:43 +0100 Received: from localhost (e99re41@localhost) by Val.DoCS.UU.SE (8.6.12/8.6.12) with SMTP id SAA03135; Sat, 13 Nov 1999 18:04:41 +0100 X-Authentication-Warning: Val.DoCS.UU.SE: e99re41 owned process doing -bs Date: Sat, 13 Nov 1999 18:04:41 +0100 (MET) From: Peter Eisentraut Reply-To: Peter Eisentraut To: Mark Stosberg cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] Porting MySQL's DESCRIBE and ENUM features In-Reply-To: <382D92C3.C621932A@summersault.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I would myself be interested to see how the check constraints are stored, so I can put this into the psql \d command. mySQL's DESCRIBE is the same as the \d command in psql (Note: psql != Pgsql). There is no backend-level command doing this, but you are free to query the system catalogues similar to how psql does it. So it seems like there is no need to do a whole lot of work here. As soon as I get the word on the contraints, I'll implement them. -Peter On Sat, 13 Nov 1999, Mark Stosberg wrote: > > Hello, > > I'm helping to port some somewhere from MySQL to Postgres, and am > looking for an equivalent to MySQL's DESCRIBE function. Do you know of > one for Postgres? > Specifically, one way DESCRIBE is used in this software is to get the > values from ENUM, where a MySQL column declaration might look like this: > > ReceiveMail ENUM ('Yes', 'No') NOT NULL DEFAULT 'Yes', > > I can get the same functionality in Postgres like this, but what can > use to get the values back of what's being checked? Thanks! > > ReceiveMail CHAR(3) check(ReceiveMail in ('Yes', 'No')) NOT NULL > DEFAULT 'Yes', > > -mark > <<-------------------------------------------------------------->> > personal website < Summersault Website Design > http://mark.stosberg.com/ > http://www.summersault.com/ > > ************ > > -- Peter Eisentraut Sernanders vaeg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden