Re: Does EXEC_BACKEND mode still need to propagate setlocale settings?

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Does EXEC_BACKEND mode still need to propagate setlocale settings?
Date: 2009-07-08 18:16:35
Message-ID: 24885.1247076995@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The recent bug report about CheckMyDatabase() failing to use
pg_perm_setlocale() led me to look for other uses of setlocale() that
might be wrong. I found two fishy calls in restore_backend_variables().
I am thinking though that the correct fix is to delete them and get
rid of the overhead of transmitting the postmaster's setlocale settings
to child processes this way. A regular backend is going to do
CheckMyDatabase momentarily, and in any case it seems to me that the
postmaster hasn't bothered to change these values off the system defaults
and so there is no need to do anything special to inherit its values.

Comments?

regards, tom lane


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Does EXEC_BACKEND mode still need to propagate setlocale settings?
Date: 2009-07-08 18:46:09
Message-ID: 4A54E971.6060609@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> The recent bug report about CheckMyDatabase() failing to use
> pg_perm_setlocale() led me to look for other uses of setlocale() that
> might be wrong. I found two fishy calls in restore_backend_variables().

I just did the exact same thing but you beat me..

> I am thinking though that the correct fix is to delete them and get
> rid of the overhead of transmitting the postmaster's setlocale settings
> to child processes this way. A regular backend is going to do
> CheckMyDatabase momentarily, and in any case it seems to me that the
> postmaster hasn't bothered to change these values off the system defaults
> and so there is no need to do anything special to inherit its values.

Agreed. In EXEC_BACKEND case, main() sets them to the same system
defaults before restore_backend_variables() is called.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Does EXEC_BACKEND mode still need to propagate setlocale settings?
Date: 2009-07-08 18:51:13
Message-ID: 25608.1247079073@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Tom Lane wrote:
>> I am thinking though that the correct fix is to delete them and get
>> rid of the overhead of transmitting the postmaster's setlocale settings
>> to child processes this way.

> Agreed. In EXEC_BACKEND case, main() sets them to the same system
> defaults before restore_backend_variables() is called.

Right. It would only matter if the postmaster changed them again later,
but so far as I can see it does not. The most likely future change that
would make it do so would be establishing GUC variables to control them,
but we still wouldn't need a special mechanism to transmit the settings.

Will go remove those calls.

regards, tom lane