pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: dmitry.telpt@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16119: pg_dump omits columns specification for matviews
Date: Sat, 16 Nov 2019 01:05:36 -0500
Message-ID: <6368.1573884336@sss.pgh.pa.us> (raw)
In-Reply-To: <16119-e64823f30a45a754@postgresql.org>
References: <16119-e64823f30a45a754@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> We've faced up with an issue how pg_dump exports materialzed views, it
> doesn't export columns declaration that is legal parameter of CREATE DDL
> instruction.
> As I can see from db_dump source, it's intent behaviour and supposed that
> columns declarion will be picked up from query statement when matview is
> created by target instance. However, if matview is 'static' (doesn't have a
> query statement), it sets default column names (column1, column2, etc) that
> breaks all dependent tables/views/matviews, for instance:

> postgres=> CREATE MATERIALIZED VIEW test_mv
>   (id, alias) AS
>   VALUES (1, 5), (2, 6), (3, 17)
> ;

Hmm ... I agree this is not good, but this example doesn't seem like
a matview that anyone would create in practice.  For curiosity's sake,
would you explain the actual use-case that you hit this in?

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <6368.1573884336@sss.pgh.pa.us>
Permalink:  ../6368.1573884336@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6368.1573884336@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dmitry.telpt@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16119: pg_dump omits columns specification for matviews
  In-Reply-To: <6368.1573884336@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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