Re: Issue in pg_catalog.pg_indexes view definition - Mailing list pgsql-hackers

From Dilip Kumar
Subject Re: Issue in pg_catalog.pg_indexes view definition
Date
Msg-id CAFiTN-t5amfEtmz0RBtTVVtD9whd=-g_RYOHaXSAp-oVVvjUAA@mail.gmail.com
Whole thread Raw
In response to Re: Issue in pg_catalog.pg_indexes view definition  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Issue in pg_catalog.pg_indexes view definition
List pgsql-hackers

On Thu, Jul 14, 2016 at 1:37 PM, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
Can we say that pg_get_indexdef() has "side-effects" because it can error
like this?  Shouldn't such a function be marked *volatile*?  Because if I
do so by updating pg_proc, the plan changes (perhaps) to a safe one in
this context:

That is another option, but by nature this function is not actually volatile, because if clause is on pg_index indexrelid then it can be pushed down.

So I think changing the view definition and calling this function on indexrelid will remove the error. So I think
correct fix is to change view definition, as I proposed in above patch.

Any other opinion on this ?

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: unexpected psql "feature"
Next
From: Dilip Kumar
Date:
Subject: Re: Issue in pg_catalog.pg_indexes view definition