Re: Don't allocate IndexAmRoutine dynamically?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Don't allocate IndexAmRoutine dynamically?
Date: 2019-06-25 20:15:17
Message-ID: 11288.1561493717@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> I think it might be worthwhile require that IndexAmRoutine returned by
> amhandler are allocated statically.

+1. Could only be an issue if somebody were tempted to have time-varying
entries in them, but it's hard to see why that could be a good idea.

Should we enforce this for *all* handler objects? If only index AMs,
why only them?

> It seems to me like there's not that many index AMs out there, so
> changing the signature of amhandler() to require returning a const
> pointer to a const object ought to both be enough of a warning, and not
> too big a burden.

One too many "consts" there. Pointer to const object seems fine.
The other part is either meaningless or will cause problems.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-06-25 20:32:07 Re: [PATCH] Incremental sort (was: PoC: Partial sort)
Previous Message Pavel Stehule 2019-06-25 20:05:17 sigmod article about ANSI SQL 2016 features