Re: Mirroring a DB - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: Mirroring a DB
Date
Msg-id Pine.LNX.4.20.9912110244240.1875-100000@localhost.localdomain
Whole thread Raw
In response to Mirroring a DB (was Re: [GENERAL] \d shows all my tables twice)  (Karl DeBisschop <kdebisschop@range.infoplease.com>)
Responses Re: Mirroring a DB
List pgsql-general
On 1999-12-10, Karl DeBisschop mentioned:

>  pg_dump -o -h <live> <table> | psql -h <mirror> <table>
>
> This generally works, but has a habit recreating the views as actual
> tables.  Often you can live with this, and there may be a simple way
> to prevent it.  I just haven't found one yet.

I view *is* a table, with a ON SELECT rule on it. So writing

CREATE TABLE foo ( ... );
CREATE RULE _RETfoo AS ON SELECT DO INSTEAD SELECT your_stuff_here;

is equivalent to

CREATE VIEW foo AS SELECT your_stuff_here;

Perhaps it would be nicer if the dump contained the second version, but
you're not supposed to read these dumps (in case you didn't know :).

--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-general by date:

Previous
From: Sanchez Diaz Sonia
Date:
Subject: doubt about UNIX!!!
Next
From: Scott Beasley
Date:
Subject: First draft of pg_group admin tool.