Thread: [HACKERS] relkind check in DefineIndex

[HACKERS] relkind check in DefineIndex

From
Alvaro Herrera
Date:
The relkind check in DefineIndex has grown into an ugly rats nest of
'if' statements.  I propose to change it into a switch, as per the
attached.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

Re: [HACKERS] relkind check in DefineIndex

From
Robert Haas
Date:
On Fri, Oct 13, 2017 at 12:38 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> The relkind check in DefineIndex has grown into an ugly rats nest of
> 'if' statements.  I propose to change it into a switch, as per the
> attached.

wfm

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] relkind check in DefineIndex

From
Amit Langote
Date:
On 2017/10/14 4:32, Robert Haas wrote:
> On Fri, Oct 13, 2017 at 12:38 PM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> The relkind check in DefineIndex has grown into an ugly rats nest of
>> 'if' statements.  I propose to change it into a switch, as per the
>> attached.
> 
> wfm

+1

Thanks,
Amit



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] relkind check in DefineIndex

From
Michael Paquier
Date:
On Mon, Oct 16, 2017 at 2:56 PM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> On 2017/10/14 4:32, Robert Haas wrote:
>> On Fri, Oct 13, 2017 at 12:38 PM, Alvaro Herrera
>> <alvherre@2ndquadrant.com> wrote:
>>> The relkind check in DefineIndex has grown into an ugly rats nest of
>>> 'if' statements.  I propose to change it into a switch, as per the
>>> attached.
>>
>> wfm
>
> +1

+1. There is as well CreateTrigger(), analyze_rel() or
ATRewriteCatalogs() that do similar things but those are not using
multiple layers of checks.
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers