pg_config wrongly marked as not parallel safe?

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Joe Conway <mail(at)joeconway(dot)com>
Subject: pg_config wrongly marked as not parallel safe?
Date: 2018-11-26 23:45:21
Message-ID: 20181126234521.rh3grz7aavx2ubjv@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Triggered by the thread at [1] I looked for functions marked as
immutable but not parallel safe.

postgres[19492][1]=# SELECT oid::regprocedure, provolatile, proparallel FROM pg_proc WHERE provolatile = 'i' AND proparallel != 's';
┌─────────────┬─────────────┬─────────────┐
│ oid │ provolatile │ proparallel │
├─────────────┼─────────────┼─────────────┤
│ pg_config() │ i │ r │
└─────────────┴─────────────┴─────────────┘
(1 row)

# pg_config
{ oid => '3400', descr => 'pg_config binary as a function',
proname => 'pg_config', prorows => '23', proretset => 't', proparallel => 'r',
prorettype => 'record', proargtypes => '', proallargtypes => '{text,text}',
proargmodes => '{o,o}', proargnames => '{name,setting}',
prosrc => 'pg_config' },

so that function is marked as immutable but not parallel safe, without
an explanation for that odd combination.

Now obviously I don't think it practially matters for pg_config(), but
it seems unnecessarily confusing as a general matter.

I think we probably should fix this specific case, and then add a check
to opr_sanity.sql or such.

As far as I can tell pg_config() was marked as such since its addition
in [2]. Joe, I assume this wasn't intentional?

Greetings,

Andres Freund

[1] https://www.postgresql.org/message-id/CA+6d-n4dOakgLu2gsTfk9uD2CC9ueNCg+z_mnXA2-=Qaod1Wuw@mail.gmail.com
[2] http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a5c43b886942e96ec5c745041f2d6a50c3205147

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2018-11-26 23:47:47 Re: IMMUTABLE and PARALLEL SAFE function markings
Previous Message Andres Freund 2018-11-26 23:39:40 Re: IMMUTABLE and PARALLEL SAFE function markings