Re: Proposal: add error message in backend/catalog/index.c

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Ioseph Kim <pgsql-kr(at)postgresql(dot)kr>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: add error message in backend/catalog/index.c
Date: 2016-12-19 21:37:33
Message-ID: 2fd303ec-826a-7c9f-c092-5c282d5d50f6@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/13/16 1:15 AM, Ioseph Kim wrote:
> I propose to append an error message when index name and table name are
> same.
>
>
> example:
>
> postgres(at)postgres=# create table t (a int not null, constraint t primary
> key (a));
> ERROR: relation "t" already exists

The code to detect that would probably be fairly complicated for such a
rare case.

A more principled approach might be to create an error context for the
index creation so that you can tell what is going on when the error happens.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2016-12-19 22:11:03 Re: Proposal for changes to recovery.conf API
Previous Message Peter Eisentraut 2016-12-19 21:35:13 Re: pg_basebackups and slots