move DECLARE_INDEX from indexing.h?

Started by Alvaro Herreraabout 6 years ago3 messageshackers
Jump to latest
#1Alvaro Herrera
alvherre@2ndquadrant.com

In his long bootstrap-reworking thread[1]/messages/by-id/CAJVSVGWO48JbbwXkJz_yBFyGYW-M9YWxnPdxJBUosDC9ou_F0Q@mail.gmail.com John Naylor initially proposed
moving the DECLARE_INDEX lines from indexing.h to each of the
corresponding catalog files. However, in the end that wasn't done;
these lines are still in indexing.h. Is there a reason for this?
Wouldn't it make more sense to have the indexes for pg_attribute appear
in catalog/pg_attribute.h, and so forth?

I was unable to find a rebuttal of the move; maybe it was just
neglected because of fog-of-war.

[1]: /messages/by-id/CAJVSVGWO48JbbwXkJz_yBFyGYW-M9YWxnPdxJBUosDC9ou_F0Q@mail.gmail.com

--
�lvaro Herrera

#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alvaro Herrera (#1)
Re: move DECLARE_INDEX from indexing.h?

On 2020-Mar-06, Alvaro Herrera wrote:

In his long bootstrap-reworking thread[1] John Naylor initially proposed
moving the DECLARE_INDEX lines from indexing.h to each of the
corresponding catalog files. However, in the end that wasn't done;
these lines are still in indexing.h. Is there a reason for this?
Wouldn't it make more sense to have the indexes for pg_attribute appear
in catalog/pg_attribute.h, and so forth?

(In a quick experiment, simply moving the pg_aggregate indexes from
indexing.h to pg_aggregate.h appears to work with no further changes.)

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: move DECLARE_INDEX from indexing.h?

Alvaro Herrera <alvherre@2ndquadrant.com> writes:

In his long bootstrap-reworking thread[1] John Naylor initially proposed
moving the DECLARE_INDEX lines from indexing.h to each of the
corresponding catalog files. However, in the end that wasn't done;
these lines are still in indexing.h. Is there a reason for this?
Wouldn't it make more sense to have the indexes for pg_attribute appear
in catalog/pg_attribute.h, and so forth?

FWIW, I think it's just fine as-is, for the same reason that CREATE INDEX
is a separate command from CREATE TABLE. The indexes on a table are not
part of the table data; to some extent they're an implementation detail.

regards, tom lane