pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed10.4 upgrade, function markings, and template0
8+ messages / 5 participants
[nested] [flat]
* 10.4 upgrade, function markings, and template0
@ 2018-05-14 20:42 Dominic Jones <jonesd@xmission.com>
0 siblings, 2 replies; 8+ messages in thread
From: Dominic Jones @ 2018-05-14 20:42 UTC (permalink / raw)
To: pgsql-general
Good afternoon,
The PostgreSQL 10.4 upgrade involves changes to some function markings (see release notes, E.1.2, second and third bullet points for specifics). One way to make these changes is to use `ALTER FUNCTION` to change the functions in your existing databases. While this was mainly straightforward, I'm unclear on whether the `template0` database must be changed in this manner or if it is automatically updated when the upgrade is applied. The documentation indicates that in general you shouldn't manually change the `template0` database.
--
Dominic Jones <jonesd@xmission.com>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-14 20:58 David G. Johnston <david.g.johnston@gmail.com>
parent: Dominic Jones <jonesd@xmission.com>
1 sibling, 0 replies; 8+ messages in thread
From: David G. Johnston @ 2018-05-14 20:58 UTC (permalink / raw)
To: Dominic Jones <jonesd@xmission.com>; +Cc: pgsql-general
On Mon, May 14, 2018 at 1:42 PM, Dominic Jones <jonesd@xmission.com> wrote:
> Good afternoon,
>
> The PostgreSQL 10.4 upgrade involves changes to some function markings
> (see release notes, E.1.2, second and third bullet points for specifics).
> One way to make these changes is to use `ALTER FUNCTION` to change the
> functions in your existing databases. While this was mainly
> straightforward, I'm unclear on whether the `template0` database must be
> changed in this manner or if it is automatically updated when the upgrade
> is applied. The documentation indicates that in general you shouldn't
> manually change the `template0` database.
>
If you ever go and CREATE DATABASE TEMPLATE template0 you will not get the
correct markings unless you've updated template0 (w/o TEMPLATE template0
you pull from template1, probably want to update that as well).
​Related quest​ion - the post-installation instructions that are part of
the news releases seem like something that should be part of the release
notes...but they are not.
David J.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-14 21:02 Tom Lane <tgl@sss.pgh.pa.us>
parent: Dominic Jones <jonesd@xmission.com>
1 sibling, 2 replies; 8+ messages in thread
From: Tom Lane @ 2018-05-14 21:02 UTC (permalink / raw)
To: Dominic Jones <jonesd@xmission.com>; +Cc: pgsql-general
Dominic Jones <jonesd@xmission.com> writes:
> The PostgreSQL 10.4 upgrade involves changes to some function markings (see release notes, E.1.2, second and third bullet points for specifics). One way to make these changes is to use `ALTER FUNCTION` to change the functions in your existing databases. While this was mainly straightforward, I'm unclear on whether the `template0` database must be changed in this manner or if it is automatically updated when the upgrade is applied. The documentation indicates that in general you shouldn't manually change the `template0` database.
Yes, you'd need to fix it in template0 as well, or you risk
subsequently-created databases not having the fix. See previous
minor releases where we've given more painstaking detail about
applying catalog corrections, e.g. 9.6.4:
https://www.postgresql.org/docs/current/static/release-9-6-4.html
I didn't bother with spelling it all out in full detail this time,
which maybe was a mistake, but I felt that probably most users
wouldn't need to bother with these changes at all (unlike the case
where a catalog correction is security-related).
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-14 21:10 Adrian Klaver <adrian.klaver@aklaver.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 8+ messages in thread
From: Adrian Klaver @ 2018-05-14 21:10 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Dominic Jones <jonesd@xmission.com>; +Cc: pgsql-general
On 05/14/2018 02:02 PM, Tom Lane wrote:
> Dominic Jones <jonesd@xmission.com> writes:
>> The PostgreSQL 10.4 upgrade involves changes to some function markings (see release notes, E.1.2, second and third bullet points for specifics). One way to make these changes is to use `ALTER FUNCTION` to change the functions in your existing databases. While this was mainly straightforward, I'm unclear on whether the `template0` database must be changed in this manner or if it is automatically updated when the upgrade is applied. The documentation indicates that in general you shouldn't manually change the `template0` database.
>
> Yes, you'd need to fix it in template0 as well, or you risk
> subsequently-created databases not having the fix. See previous
> minor releases where we've given more painstaking detail about
> applying catalog corrections, e.g. 9.6.4:
>
> https://www.postgresql.org/docs/current/static/release-9-6-4.html
>
> I didn't bother with spelling it all out in full detail this time,
> which maybe was a mistake, but I felt that probably most users
> wouldn't need to bother with these changes at all (unlike the case
> where a catalog correction is security-related).
Well what is nice about the news release is you can cut and past the
entire list of commands and do the updates en masse.
>
> regards, tom lane
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-14 21:22 Tom Lane <tgl@sss.pgh.pa.us>
parent: Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 2 replies; 8+ messages in thread
From: Tom Lane @ 2018-05-14 21:22 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: Dominic Jones <jonesd@xmission.com>; pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 05/14/2018 02:02 PM, Tom Lane wrote:
>> I didn't bother with spelling it all out in full detail this time,
>> which maybe was a mistake, but I felt that probably most users
>> wouldn't need to bother with these changes at all (unlike the case
>> where a catalog correction is security-related).
> Well what is nice about the news release is you can cut and past the
> entire list of commands and do the updates en masse.
It'd be nice to have some more-automated way of doing this type of
correction. Ordinary scripting doesn't look very promising, because
I don't see an easy way to deal with the need to connect to every
database in the cluster; that seems to depend on a lot of local
characteristics about usernames and authentication.
Maybe it'd be worth building some sort of infrastructure that would
allow this to be done at a lower level. It's not hard to imagine
an autovacuum-like or bgworker-based thingy that could run around
and apply a given SQL script in every database, bypassing the usual
worries about authentication and connections-disabled databases.
That seems like a lot of work for a need that only comes up once in
awhile, but perhaps it'd have more applications than just catalog
corrections.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-14 21:30 Adrian Klaver <adrian.klaver@aklaver.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 8+ messages in thread
From: Adrian Klaver @ 2018-05-14 21:30 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Dominic Jones <jonesd@xmission.com>; pgsql-general
On 05/14/2018 02:22 PM, Tom Lane wrote:
> Adrian Klaver <adrian.klaver@aklaver.com> writes:
>> On 05/14/2018 02:02 PM, Tom Lane wrote:
>>> I didn't bother with spelling it all out in full detail this time,
>>> which maybe was a mistake, but I felt that probably most users
>>> wouldn't need to bother with these changes at all (unlike the case
>>> where a catalog correction is security-related).
>
>> Well what is nice about the news release is you can cut and past the
>> entire list of commands and do the updates en masse.
>
> It'd be nice to have some more-automated way of doing this type of
> correction. Ordinary scripting doesn't look very promising, because
> I don't see an easy way to deal with the need to connect to every
> database in the cluster; that seems to depend on a lot of local
> characteristics about usernames and authentication >
> Maybe it'd be worth building some sort of infrastructure that would
> allow this to be done at a lower level. It's not hard to imagine
> an autovacuum-like or bgworker-based thingy that could run around
> and apply a given SQL script in every database, bypassing the usual
> worries about authentication and connections-disabled databases.
> That seems like a lot of work for a need that only comes up once in
> awhile, but perhaps it'd have more applications than just catalog
> corrections.
That would be helpful given that a major version has a 5 year supported
life span. I can see folks not deciding to do the manual work at the
minor release because at that time it does not apply and the work does
not seem worth it. Then at some point in the future conditions change
and they wonder why things are not working the way they should. I know I
would be grateful.
>
> regards, tom lane
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-14 21:51 Dominic Jones <jonesd@xmission.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 8+ messages in thread
From: Dominic Jones @ 2018-05-14 21:51 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general
On Mon, 14 May 2018 17:02:25 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dominic Jones <jonesd@xmission.com> writes:
> > The PostgreSQL 10.4 upgrade involves changes to some function markings (see release notes, E.1.2, second and third bullet points for specifics). One way to make these changes is to use `ALTER FUNCTION` to change the functions in your existing databases. While this was mainly straightforward, I'm unclear on whether the `template0` database must be changed in this manner or if it is automatically updated when the upgrade is applied. The documentation indicates that in general you shouldn't manually change the `template0` database.
>
> Yes, you'd need to fix it in template0 as well, or you risk
> subsequently-created databases not having the fix. See previous
> minor releases where we've given more painstaking detail about
> applying catalog corrections, e.g. 9.6.4:
>
> https://www.postgresql.org/docs/current/static/release-9-6-4.html
>
> I didn't bother with spelling it all out in full detail this time,
> which maybe was a mistake, but I felt that probably most users
> wouldn't need to bother with these changes at all (unlike the case
> where a catalog correction is security-related).
>
> regards, tom lane
>
Yes, the link does address the issue and answer the question. It looks like I didn't see the previous upgrade's discussion because the change to which it was tied didn't appear to be relevant to the database deployment involved.
--
Dominic Jones <jonesd@xmission.com>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: 10.4 upgrade, function markings, and template0
@ 2018-05-15 02:40 Michael Paquier <michael@paquier.xyz>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 8+ messages in thread
From: Michael Paquier @ 2018-05-15 02:40 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; Dominic Jones <jonesd@xmission.com>; pgsql-general
On Mon, May 14, 2018 at 05:22:39PM -0400, Tom Lane wrote:
> Maybe it'd be worth building some sort of infrastructure that would
> allow this to be done at a lower level. It's not hard to imagine
> an autovacuum-like or bgworker-based thingy that could run around
> and apply a given SQL script in every database, bypassing the usual
> worries about authentication and connections-disabled databases.
A portion of the infrastructure is already available for background
workers which can use BGWORKER_BYPASS_ALLOWCONN since Postgres 11 to
enforce connections to databases even if an administrator disables
connections to it.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2018-05-15 02:40 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 20:42 10.4 upgrade, function markings, and template0 Dominic Jones <jonesd@xmission.com>
2018-05-14 20:58 ` David G. Johnston <david.g.johnston@gmail.com>
2018-05-14 21:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-05-14 21:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-05-14 21:22 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-05-14 21:30 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-05-15 02:40 ` Michael Paquier <michael@paquier.xyz>
2018-05-14 21:51 ` Dominic Jones <jonesd@xmission.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox