pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedInformix Schema -> PostgreSQL ?
6+ messages / 5 participants
[nested] [flat]
* Informix Schema -> PostgreSQL ?
@ 2007-07-03 16:22 Mark Fenbers <Mark.Fenbers@noaa.gov>
2007-07-03 17:35 ` Re: Informix Schema -> PostgreSQL ? Adam Tauno Williams <adamtaunowilliams@gmail.com>
2007-07-03 17:48 ` Re: Informix Schema -> PostgreSQL ? Scott Marlowe <smarlowe@g2switchworks.com>
0 siblings, 2 replies; 6+ messages in thread
From: Mark Fenbers @ 2007-07-03 16:22 UTC (permalink / raw)
To: pgsql-sql
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)??
Mark
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Informix Schema -> PostgreSQL ?
2007-07-03 16:22 Informix Schema -> PostgreSQL ? Mark Fenbers <Mark.Fenbers@noaa.gov>
@ 2007-07-03 17:35 ` Adam Tauno Williams <adamtaunowilliams@gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: Adam Tauno Williams @ 2007-07-03 17:35 UTC (permalink / raw)
To: pgsql-sql
On Tue, 2007-07-03 at 12:22 -0400, 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)??
Just use pg_dump to dump/backup the schema. Don't include the data; it
is just like doing an Informix "dbschema -d {database}"
pg_dump -U OGo --schema-only OGo
--
Adam Tauno Williams, Network & Systems Administrator
Consultant - http://www.whitemiceconsulting.com
Developer - http://www.opengroupware.org
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Informix Schema -> PostgreSQL ?
2007-07-03 16:22 Informix Schema -> PostgreSQL ? Mark Fenbers <Mark.Fenbers@noaa.gov>
@ 2007-07-03 17:48 ` Scott Marlowe <smarlowe@g2switchworks.com>
2007-07-03 23:35 ` Re: Informix Schema -> PostgreSQL ? Adam Tauno Williams <adamtaunowilliams@gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Scott Marlowe @ 2007-07-03 17:48 UTC (permalink / raw)
To: Mark Fenbers <Mark.Fenbers@noaa.gov>; +Cc: 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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Informix Schema -> PostgreSQL ?
2007-07-03 16:22 Informix Schema -> PostgreSQL ? Mark Fenbers <Mark.Fenbers@noaa.gov>
2007-07-03 17:48 ` Re: Informix Schema -> PostgreSQL ? Scott Marlowe <smarlowe@g2switchworks.com>
@ 2007-07-03 23:35 ` Adam Tauno Williams <adamtaunowilliams@gmail.com>
2007-07-04 04:18 ` Re: Informix Schema -> PostgreSQL ? Jaime Casanova <systemguards@gmail.com>
2007-07-04 04:34 ` Re: Informix Schema -> PostgreSQL ? Nis Jørgensen <nis@superlativ.dk>
0 siblings, 2 replies; 6+ messages in thread
From: Adam Tauno Williams @ 2007-07-03 23:35 UTC (permalink / raw)
To: pgsql-sql
> pg_dump dbname -s -t tableorindexname
[Also an Informix DBA] Is there a way to tweak the output of pg_dump
when used in this manner to omit the verbose commentary.
$ pg_dump OGo -s -t enterprise
....
--
-- Name: unique_enterprise_login; Type: INDEX; Schema: public; Owner:
OGo; Tablespace:
--
CREATE UNIQUE INDEX unique_enterprise_login ON enterprise USING btree
("login");
The "--" lines just eats up screen real estate.
--
Adam Tauno Williams, Network & Systems Administrator
Consultant - http://www.whitemiceconsulting.com
Developer - http://www.opengroupware.org
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Informix Schema -> PostgreSQL ?
2007-07-03 16:22 Informix Schema -> PostgreSQL ? Mark Fenbers <Mark.Fenbers@noaa.gov>
2007-07-03 17:48 ` Re: Informix Schema -> PostgreSQL ? Scott Marlowe <smarlowe@g2switchworks.com>
2007-07-03 23:35 ` Re: Informix Schema -> PostgreSQL ? Adam Tauno Williams <adamtaunowilliams@gmail.com>
@ 2007-07-04 04:18 ` Jaime Casanova <systemguards@gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: Jaime Casanova @ 2007-07-04 04:18 UTC (permalink / raw)
To: adamtaunowilliams@gmail.com; +Cc: pgsql-sql
On 7/3/07, Adam Tauno Williams <adamtaunowilliams@gmail.com> wrote:
> > pg_dump dbname -s -t tableorindexname
>
> [Also an Informix DBA] Is there a way to tweak the output of pg_dump
> when used in this manner to omit the verbose commentary.
>
no AFAIK. dbexport and dbschema doesn't have that either, or they have?
--
regards,
Jaime Casanova
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Informix Schema -> PostgreSQL ?
2007-07-03 16:22 Informix Schema -> PostgreSQL ? Mark Fenbers <Mark.Fenbers@noaa.gov>
2007-07-03 17:48 ` Re: Informix Schema -> PostgreSQL ? Scott Marlowe <smarlowe@g2switchworks.com>
2007-07-03 23:35 ` Re: Informix Schema -> PostgreSQL ? Adam Tauno Williams <adamtaunowilliams@gmail.com>
@ 2007-07-04 04:34 ` Nis Jørgensen <nis@superlativ.dk>
1 sibling, 0 replies; 6+ messages in thread
From: Nis Jørgensen @ 2007-07-04 04:34 UTC (permalink / raw)
To: pgsql-sql
Adam Tauno Williams skrev:
>> pg_dump dbname -s -t tableorindexname
>
> [Also an Informix DBA] Is there a way to tweak the output of pg_dump
> when used in this manner to omit the verbose commentary.
>
> $ pg_dump OGo -s -t enterprise
pg_dump OGo -s -t enterprise | grep -v '^--$'
Nis
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2007-07-04 04:34 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-07-03 16:22 Informix Schema -> PostgreSQL ? Mark Fenbers <Mark.Fenbers@noaa.gov>
2007-07-03 17:35 ` Adam Tauno Williams <adamtaunowilliams@gmail.com>
2007-07-03 17:48 ` Scott Marlowe <smarlowe@g2switchworks.com>
2007-07-03 23:35 ` Adam Tauno Williams <adamtaunowilliams@gmail.com>
2007-07-04 04:18 ` Jaime Casanova <systemguards@gmail.com>
2007-07-04 04:34 ` Nis Jørgensen <nis@superlativ.dk>
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