Re: Mirroring a DB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Karl DeBisschop <kdebisschop(at)range(dot)infoplease(dot)com>
Cc: swalton(at)galileo(dot)csun(dot)edu, pgsql-general(at)postgresql(dot)org
Subject: Re: Mirroring a DB
Date: 1999-12-11 02:00:12
Message-ID: Pine.LNX.4.20.9912110244240.1875-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Beasley 1999-12-11 02:46:07 First draft of pg_group admin tool.
Previous Message Peter Bojanic 1999-12-10 22:12:43 Database connections

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 1999-12-11 02:00:31 Re: [HACKERS] First draft of pg_group admin tool.
Previous Message Jan Wieck 1999-12-11 01:16:25 Re: [HACKERS] Error in new psql