Lists: | pgsql-hackers |
---|
From: | Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-04 20:00:25 |
Message-ID: | 436BBDD9.2090501@amsoftwaredesign.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi,
I have been playing around with pg_reload_conf() and the pg_settings view.
I understand that the pg_settings view, if updated, applies to the
current session only.
However I was under the impression that if I did a pg_reload_conf(), the
pg_settings view would be updated at that time, but that does not seem to
happen.
I am running on win32, but the same thing happens on Linux.
If I restart the Postgresql service then the pg_settings view contains
the changes I made to the postgresql.conf file.
Any ideas, does this seem like a possible bug? It just seems to me that
pg_settings should be updated if a pg_reload_conf() is executed.
Thanks,
Tony
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 00:18:22 |
Message-ID: | 18807.1131149902@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> writes:
> However I was under the impression that if I did a pg_reload_conf(), the
> pg_settings view would be updated at that time, but that does not seem to
> happen.
It works for me ...
regression=# select setting from pg_settings where name = 'constraint_exclusion';
setting
---------
off
(1 row)
-- edit postgresql.conf in another window, set constraint_exclusion = on
regression=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
regression=# select setting from pg_settings where name = 'constraint_exclusion';
setting
---------
on
(1 row)
regards, tom lane
From: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 02:36:44 |
Message-ID: | dkh5r8$2s8$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
news:18807(dot)1131149902(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> writes:
>> However I was under the impression that if I did a pg_reload_conf(), the
>> pg_settings view would be updated at that time, but that does not seem to
>> happen.
I repeated Tony's result (Win32):
Welcome to psql 8.1RC1, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
test=# select setting from pg_settings where name = 'constraint_exclusion';
setting
---------
off
(1 row)
test=# select pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
test=# select setting from pg_settings where name = 'constraint_exclusion';
setting
---------
off
(1 row)
test=# LOG: received SIGHUP, reloading configuration files
test=# select setting from pg_settings where name = 'constraint_exclusion';
setting
---------
off
(1 row)
test=# select setting from pg_settings where name = 'constraint_exclusion';
setting
---------
on
(1 row)
-- Seems that's due to delay of process SIGHUP ...
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 02:51:38 |
Message-ID: | 436C1E3A.5090708@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Qingqing Zhou wrote:
>
>test=# LOG: received SIGHUP, reloading configuration files
>
>test=# select setting from pg_settings where name = 'constraint_exclusion';
> setting
>---------
> off
>(1 row)
>
>test=# select setting from pg_settings where name = 'constraint_exclusion';
> setting
>---------
> on
>(1 row)
>
>
>-- Seems that's due to delay of process SIGHUP ...
>
>
>
>
What's the delay? 1s? 5? 10?
cheers
andrew
From: | Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view |
Date: | 2005-11-05 02:55:37 |
Message-ID: | Pine.LNX.4.58.0511042153340.3999@eon.cs |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
>
> What's the delay? 1s? 5? 10?
>
Delay is the time difference we kill a signal and the time we really
process it. We kill at once, but only process it at proper idle time. In
my test, the delay is 2 seconds or so. I am looking into the problem - not
sure the exact details now though ...
Regards,
Qingqing
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 03:10:38 |
Message-ID: | 8070.1131160238@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> I repeated Tony's result (Win32):
Hmm, some delay in the signal being recognized in our Win32 signal
implementation? Why would that be?
regards, tom lane
From: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 03:36:51 |
Message-ID: | dkh9bu$qon$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote
>
> Hmm, some delay in the signal being recognized in our Win32 signal
> implementation? Why would that be?
>
I believe this is a disease for all platforms, not only Windows. This is
because the signals are asynchoronized. Think when you returned from
kill(SIGHUP), you can't suppose that Postmaster already got it. Now when you
do your next command very fast, then there is a chance you didn't receive
the forwarded SIGHUP from Postmaster. But windows does make the disease
easier to be seen.
Regards,
Qingqing
From: | Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> |
---|---|
To: | |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 04:49:01 |
Message-ID: | 436C39BD.5040905@amsoftwaredesign.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Andrew Dunstan wrote:
>
>
> Qingqing Zhou wrote:
>
>>
>> test=# LOG: received SIGHUP, reloading configuration files
>>
>> test=# select setting from pg_settings where name =
>> 'constraint_exclusion';
>> setting
>> ---------
>> off
>> (1 row)
>>
>> test=# select setting from pg_settings where name =
>> 'constraint_exclusion';
>> setting
>> ---------
>> on
>> (1 row)
>>
>>
>> -- Seems that's due to delay of process SIGHUP ...
>>
>>
>>
>>
>
> What's the delay? 1s? 5? 10?
>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
>
hmm, I waited for at least 1 minute after doing the reload and it was
never updated.
It seemed at the time that the only way to get a updated pg_settings
view was to actually restart the
server. I plan on doing some more testing on Saturday.
Tony
From: | Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-05 06:39:16 |
Message-ID: | Pine.LNX.4.58.0511050102090.5757@eon.cs |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Fri, 4 Nov 2005, Tony Caduto wrote:
>
> hmm, I waited for at least 1 minute after doing the reload and it was
> never updated. It seemed at the time that the only way to get a updated
> pg_settings view was to actually restart the server. I plan on doing
> some more testing on Saturday.
>
Did you set "constraint_exclusion = on", then comment it
"#constraint_exclusion = on" in the .conf file? If so, then
ProcessConfigFile() will ignore this line since it is a comment, instead
of setting back its value to "off". Try to do set "constraint_exclusion =
off" explicitely, see if long delay ever happens.
Btw, is this considered a bug of ProcessConfigFile()? To fix it, we can
call InitializeGUCOptions() somewhere but I am not sure which values
should be untouched, like ConfigFileName ...
Regards,
Qingqing
From: | "William ZHANG" <uniware(at)zedware(dot)org> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible problem with pg_reload_conf() and view pg_settings |
Date: | 2005-11-07 09:09:04 |
Message-ID: | dkn5jc$208s$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
I have tested on pgsql-8.1-beta3 on Windows 2003.
It works fine.
I changed the line in postmaster.conf between "on" and "off".
(Remember to save it each time). And paste the two lines in
psql to see the results.
select pg_reload_conf();
select setting from pg_settings where name = 'constraint_exclusion';
"Tony Caduto" <tony_caduto(at)amsoftwaredesign(dot)com> wrote
> Hi,
> I have been playing around with pg_reload_conf() and the pg_settings view.
>
> I understand that the pg_settings view, if updated, applies to the current
> session only.
> However I was under the impression that if I did a pg_reload_conf(), the
> pg_settings view would be updated at that time, but that does not seem to
> happen. I am running on win32, but the same thing happens on Linux.
>
> If I restart the Postgresql service then the pg_settings view contains the
> changes I made to the postgresql.conf file.
>
> Any ideas, does this seem like a possible bug? It just seems to me that
> pg_settings should be updated if a pg_reload_conf() is executed.
>
>
> Thanks,
>
> Tony
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>