Re: pg_dump compatibility level / use create view instead of create table/rule

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alex Williams <valenceshell(at)protonmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: pg_dump compatibility level / use create view instead of create table/rule
Date: 2019-10-09 05:01:01
Message-ID: 30565.1570597261@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Alex Williams <valenceshell(at)protonmail(dot)com> writes:
> Can someone let me know when you're doing a pg_dump, can you specify not to use the view rules so that the statement in the pg_dump file uses create view instead of create table/create rule?

No.

> We dump from 9.5.5 and restore to one 9.5.18 server and two 9.2 servers....we've been doing this for awhile and had no issues until recently with certain views that are trying to be restored with rule views (some views in the pg_dump file are created with create view and some by create table / create rule)

In general, we don't promise that pg_dump output from major version N
can be loaded into previous major versions. Having said that, 9.2
should not have a problem with either the CREATE VIEW or CREATE TABLE-
plus-CREATE RULE approaches per se, so there's some critical detail
that you haven't told us about. You didn't show the actual error
messages, either.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-10-09 05:31:13 Re: WIP: raise error when submitting invalid ALTER SYSTEM command
Previous Message Masahiko Sawada 2019-10-09 04:51:47 Re: maintenance_work_mem used by Vacuum

Browse pgsql-sql by date

  From Date Subject
Next Message Ed Behn 2019-10-09 16:36:45 Set FILLFACTOR for primary key
Previous Message Alex Williams 2019-10-09 01:11:42 Re: pg_dump compatibility level / use create view instead of create table/rule