Re: Allow workers to override datallowconn

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: Allow workers to override datallowconn
Date: 2018-02-22 18:24:21
Message-ID: 22769.1519323861@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Attached is a patch that adds new Override versions of the functions to
> connect to a database from a background worker.

> Another option would be to just add the parameter directly to the regular
> connection function, and not create separate functions. But that would make
> it an incompatible change. And since background workers are commonly used
> in extensions, that would break a lot of extensions out there. I figured
> it's probably not worth doing that, and thus added the new functions. What
> do others think about that?

Meh. We change exported APIs in new major versions all the time. As
long as it's just a question of an added parameter, people can deal
with it. You could take the opportunity to future-proof a little by
making this option be the first bit in a flags parameter, so that at
least future boolean option additions don't require another API break
or a whole new set of redundant functions.

> Are there any other caveats in doing that this actually makes it dangerous
> to just allow bypassing it for extensions?

Don't think so; we autovacuum such DBs anyway don't we?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-02-22 18:26:48 Re: SHA-2 functions
Previous Message Tom Lane 2018-02-22 18:03:13 Re: ERROR: left and right pathkeys do not match in mergejoin