Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id C6B7C9FB6AF for ; Tue, 3 Jul 2007 14:49:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 84805-01 for ; Tue, 3 Jul 2007 14:48:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [38.98.183.40]) by postgresql.org (Postfix) with ESMTP id 16E509FB68B for ; Tue, 3 Jul 2007 14:48:57 -0300 (ADT) Received: from [10.10.1.37] ([10.10.1.37]) by exchange.g2switchworks.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 3 Jul 2007 12:48:56 -0500 Message-ID: <468A8C08.1060803@g2switchworks.com> Date: Tue, 03 Jul 2007 12:48:56 -0500 From: Scott Marlowe User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: Mark Fenbers CC: pgsql-sql@postgresql.org Subject: Re: Informix Schema -> PostgreSQL ? References: <468A77B6.2070706@noaa.gov> In-Reply-To: <468A77B6.2070706@noaa.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jul 2007 17:48:56.0566 (UTC) FILETIME=[6DA79160:01C7BD9A] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/21 X-Sequence-Number: 28756 Mark Fenbers wrote: > I am an ex-Informix convert. Informix used the term "schema" to refer > to the SQL-format definition of how a table or view was created. > E.g., CREATE TABLE john ( char(8) lid, ...); Some views we have are > quite complex (and not created by me) and I want to create a similar > one in Pg. If I could see the view in this SQL format, then I could > use SQL to create another one using this as a template. > > pgadmin3 can show this definition in SQL format, but I can't use > pgadmin3 on a certain box. How can I show information in Pg (psql) > the way that Informix would show a schema? > > BTW, what does PostgreSQL call this (what Informix calls a schema)?? Oddly enough, it's the same thing. There's schema, the object, which holds related objects inside it. databases contain schemas which contain tables, indexes, etc... Then there's schema, as a definition of how something it put together. Confusing, I know. The easiest way to view the sql format definition of a view is the use the pg_views view... select * from pg_views where viewname='nameofview'; You can get the same thing with pg_dump: pg_dump dbname -s -t tableorindexname