Re: Informix Schema -> PostgreSQL ?

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Mark Fenbers <Mark(dot)Fenbers(at)noaa(dot)gov>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Informix Schema -> PostgreSQL ?
Date: 2007-07-03 17:48:56
Message-ID: 468A8C08.1060803@g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2007-07-03 17:56:39 Re: Using escape strings in an insert statement.
Previous Message Adam Tauno Williams 2007-07-03 17:35:06 Re: Informix Schema -> PostgreSQL ?