pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: sanskar@flintk12.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18607: UNION ALL discards all foreign key relations + indexes
Date: Tue, 10 Sep 2024 09:10:00 +0200
Message-ID: <Zt_wyM5koKKmOmdn@depesz.com> (raw)
In-Reply-To: <18607-651aa996c1e71d48@postgresql.org>
References: <18607-651aa996c1e71d48@postgresql.org>

On Mon, Sep 09, 2024 at 03:16:33PM +0000, PG Bug reporting form wrote:
> Consider the query below -> 
> 
> "
> CREATE OR REPLACE VIEW v3.temp_view AS
> SELECT * FROM users WHERE id = 'e-1'
> UNION ALL
> SELECT * FROM users WHERE id = 'e-2';
> "
> 
> groups.id is a primary key and has a unique index defined on the same.

What is groups? Your view is named "temp_view", and it's using "users",
not "groups".

> Either way when the view is created, the indexes and the related relations
> of the foreign key references are being dropped. 
> (Same with "UNION").

What do you mean dropped? You had index on column id in table users, and
after view creation you don't have anymore?

Can you please show full example, that I can run on empty database, that
exhibits the problem?

Best regards,

depesz






view thread (6+ messages)  latest in thread

Message-ID: <Zt_wyM5koKKmOmdn@depesz.com>
Permalink:  ../Zt_wyM5koKKmOmdn@depesz.com/
Also on:    postgresql.org/message-id/Zt_wyM5koKKmOmdn@depesz.com

 · 

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: depesz@depesz.com, sanskar@flintk12.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18607: UNION ALL discards all foreign key relations + indexes
  In-Reply-To: <Zt_wyM5koKKmOmdn@depesz.com>

* 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