pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jaime Casanova <jcasanov@systemguards.com.ec>
To: Puneet Sharma <puneet.orcl@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #17189: Index not created when primary key created
Date: Tue, 21 Sep 2021 03:23:48 -0500
Message-ID: <20210921082348.GA12405@ahch-to> (raw)
In-Reply-To: <CALETbT9ZZPyLAc4+OU=hD5xP0c3iywFq0n-DqoOYwjVEOq8aGg@mail.gmail.com>
References: <17189-521a1b29d9727929@postgresql.org>
	<CAKFQuwYf-rNmNenHsT3Vy=v-OMkDtin25yaxcSNwAbxmRki+tA@mail.gmail.com>
	<CALETbT9ZZPyLAc4+OU=hD5xP0c3iywFq0n-DqoOYwjVEOq8aGg@mail.gmail.com>

On Tue, Sep 21, 2021 at 11:34:37AM +0530, Puneet Sharma wrote:
> Hi David,
> 
> Is it different from postgres 12 version and postgres 12.8 version.
> 
> When we are creating composite primary key default constraint has been
> created but not index like oracle.
> 

no, it's not different.

"""
postgres=# select version();
                                        version
----------------------------------------------------------------------------------------
 PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
(1 row)

postgres=# create table t1(a int, b int, c int, primary key (a,b,c));
CREATE TABLE
postgres=# select indexrelid::regclass::text from pg_index
postgres-#  where indrelid = 't1'::regclass and indisprimary;
 indexrelid
------------
 t1_pkey
(1 row)
"""

this has worked the right way for a long time, I would even say more
than 20 years. It's not suddenly failing.

As Hubert asked, please provide the output of `\d table_name`, or maybe
execute this query:

"""
select indexrelid::regclass::text from pg_index 
 where indrelid = 'table_name'::regclass
   and indisprimary;
"""

-- 
Jaime Casanova
Director de Servicios Profesionales
SystemGuards - Consultores de PostgreSQL





view thread (7+ messages)  latest in thread

Message-ID: <20210921082348.GA12405@ahch-to>
Permalink:  ../20210921082348.GA12405@ahch-to/
Also on:    postgresql.org/message-id/20210921082348.GA12405@ahch-to

 · 

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: jcasanov@systemguards.com.ec, puneet.orcl@gmail.com, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17189: Index not created when primary key created
  In-Reply-To: <20210921082348.GA12405@ahch-to>

* 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