Re: [HACKERS] postgresql.auto.conf and reload

2014-08-12 Thread Fujii Masao
On Tue, Aug 12, 2014 at 1:23 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Mon, Aug 11, 2014 at 11:08 PM, Fujii Masao masao.fu...@gmail.com wrote: While updating the patch, I found that the ConfigVariable which is removed from list has the fields that the memory has been already

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-11 Thread Fujii Masao
On Sun, Aug 10, 2014 at 3:54 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Aug 8, 2014 at 11:41 AM, Fujii Masao masao.fu...@gmail.com wrote: Yep, right. ParseConfigFp() is not good place to pick up data_directory. What about the attached patch which makes ProcessConfigFile() instead

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-11 Thread Amit Kapila
On Mon, Aug 11, 2014 at 11:08 PM, Fujii Masao masao.fu...@gmail.com wrote: While updating the patch, I found that the ConfigVariable which is removed from list has the fields that the memory has been already allocated but we forgot to free them. So I included the code to free them in the

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-10 Thread Amit Kapila
On Fri, Aug 8, 2014 at 11:41 AM, Fujii Masao masao.fu...@gmail.com wrote: Yep, right. ParseConfigFp() is not good place to pick up data_directory. What about the attached patch which makes ProcessConfigFile() instead of ParseConfigFp() pick up data_directory just after the configuration file

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-10 Thread Amit Kapila
On Sun, Aug 10, 2014 at 12:24 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Aug 8, 2014 at 11:41 AM, Fujii Masao masao.fu...@gmail.com wrote: Yep, right. ParseConfigFp() is not good place to pick up data_directory. What about the attached patch which makes ProcessConfigFile()

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-08 Thread Fujii Masao
On Fri, Aug 8, 2014 at 1:19 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Thu, Aug 7, 2014 at 12:36 PM, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Aug 7, 2014 at 12:36 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 6, 2014 at 1:32 PM, Fujii Masao masao.fu...@gmail.com

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-07 Thread Fujii Masao
On Thu, Aug 7, 2014 at 12:36 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 6, 2014 at 1:32 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jul 29, 2014 at 9:26 PM, Amit Kapila amit.kapil...@gmail.com wrote: The reason is that during startup DataDir is not set by the time

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-07 Thread Fujii Masao
On Thu, Aug 7, 2014 at 12:28 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 6, 2014 at 11:39 AM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Aug 5, 2014 at 12:49 PM, Fujii Masao masao.fu...@gmail.com wrote: On Mon, Aug 4, 2014 at 11:52 PM, Tom Lane t...@sss.pgh.pa.us wrote:

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-07 Thread Amit Kapila
On Thu, Aug 7, 2014 at 12:36 PM, Fujii Masao masao.fu...@gmail.com wrote: On Thu, Aug 7, 2014 at 12:36 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Aug 6, 2014 at 1:32 PM, Fujii Masao masao.fu...@gmail.com wrote: What about picking up only data_directory at the first pass? I

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-06 Thread Fujii Masao
On Tue, Aug 5, 2014 at 12:49 PM, Fujii Masao masao.fu...@gmail.com wrote: On Mon, Aug 4, 2014 at 11:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: The patch chooses the last settings for every parameters and ignores the former settings. But I don't think

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-06 Thread Fujii Masao
On Tue, Jul 29, 2014 at 9:26 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Mon, Jul 28, 2014 at 11:33 PM, Fujii Masao masao.fu...@gmail.com wrote: There is other side effect on this patch. With the patch, when reloading the configurartion file, the server cannot warm an invalid setting

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-06 Thread Amit Kapila
On Wed, Aug 6, 2014 at 11:39 AM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Aug 5, 2014 at 12:49 PM, Fujii Masao masao.fu...@gmail.com wrote: On Mon, Aug 4, 2014 at 11:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: The patch chooses the last

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-06 Thread Amit Kapila
On Wed, Aug 6, 2014 at 1:32 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jul 29, 2014 at 9:26 PM, Amit Kapila amit.kapil...@gmail.com wrote: The reason is that during startup DataDir is not set by the time server processes config file due to which we process .auto.conf file in

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-04 Thread Tom Lane
Fujii Masao masao.fu...@gmail.com writes: The patch chooses the last settings for every parameters and ignores the former settings. But I don't think that every parameters need to be processed this way. That is, we can change the patch so that only PGC_POSTMASTER parameters are processed that

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-04 Thread Fujii Masao
On Tue, Jul 29, 2014 at 3:33 AM, Josh Berkus j...@agliodbs.com wrote: On 07/28/2014 11:03 AM, Fujii Masao wrote: On Sat, Jul 26, 2014 at 1:07 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Jul 25, 2014 at 6:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Jul 9, 2014 at 11:05

Re: [HACKERS] postgresql.auto.conf and reload

2014-08-04 Thread Fujii Masao
On Mon, Aug 4, 2014 at 11:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Fujii Masao masao.fu...@gmail.com writes: The patch chooses the last settings for every parameters and ignores the former settings. But I don't think that every parameters need to be processed this way. That is, we can change

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-29 Thread Amit Kapila
On Mon, Jul 28, 2014 at 11:33 PM, Fujii Masao masao.fu...@gmail.com wrote: There is other side effect on this patch. With the patch, when reloading the configurartion file, the server cannot warm an invalid setting value if it's not the last setting of the parameter. This may cause problematic

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-28 Thread Fujii Masao
On Sat, Jul 26, 2014 at 1:07 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Jul 25, 2014 at 6:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Jul 9, 2014 at 11:05 PM, Amit Kapila amit.kapil...@gmail.com wrote: Okay. As mentioned upthread, I have fixed by ensuring that for

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-28 Thread Josh Berkus
On 07/28/2014 11:03 AM, Fujii Masao wrote: On Sat, Jul 26, 2014 at 1:07 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Fri, Jul 25, 2014 at 6:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Jul 9, 2014 at 11:05 PM, Amit Kapila amit.kapil...@gmail.com wrote: Okay. As mentioned

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-25 Thread Fujii Masao
On Wed, Jul 9, 2014 at 11:05 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Jul 9, 2014 at 10:14 AM, Tom Lane t...@sss.pgh.pa.us wrote: Amit Kapila amit.kapil...@gmail.com writes: On Wed, Jul 9, 2014 at 6:40 AM, Mark Kirkwood mark.kirkw...@catalyst.net.nz wrote: Yes, but even

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-25 Thread Amit Kapila
On Fri, Jul 25, 2014 at 6:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Jul 9, 2014 at 11:05 PM, Amit Kapila amit.kapil...@gmail.com wrote: Okay. As mentioned upthread, I have fixed by ensuring that for duplicate config params, retain only which comes later during parsing. I think

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-23 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: No, ALTER SYSTEM is there now and it needs to work right in its first release. I will go fix this if nobody else does. Just checking -- you didn't get around to dealing with this, right? Not yet... do

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-23 Thread Amit Kapila
On Wed, Jul 23, 2014 at 11:02 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: No, ALTER SYSTEM is there now and it needs to work right in its first release. I will go fix this if nobody else does.

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-21 Thread Alvaro Herrera
Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: 2. *Then*, in a second pass, enforce requirements like can't be changed except at server start. This would also make conf.d much more useful; I wouldn't have to worry as much about overlapping config settings. Sounds like a 9.5

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-21 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: No, ALTER SYSTEM is there now and it needs to work right in its first release. I will go fix this if nobody else does. Just checking -- you didn't get around to dealing with this, right? Not yet... do you want it?

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-09 Thread Amit Kapila
On Wed, Jul 9, 2014 at 10:14 AM, Tom Lane t...@sss.pgh.pa.us wrote: Amit Kapila amit.kapil...@gmail.com writes: On Wed, Jul 9, 2014 at 6:40 AM, Mark Kirkwood mark.kirkw...@catalyst.net.nz wrote: Yes, but even well behaved users will see this type of error, because initdb uncomments

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-09 Thread Christoph Berg
Re: Tom Lane 2014-07-08 28635.1404844...@sss.pgh.pa.us Sounds like a 9.5 feature, though. No, ALTER SYSTEM is there now and it needs to work right in its first release. I will go fix this if nobody else does. I'd like to throw in again that imho this should include ALTER SYSTEM RESET (ALL)

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-09 Thread Josh Berkus
On 07/08/2014 08:18 PM, Amit Kapila wrote: Yes, but even well behaved users will see this type of error, because initdb uncomments certain values (ones that are dead certs for being changed via ALTER SYSTEM subsequently like shared_buffers), and then - bang! your next reload gets that your

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-09 Thread Josh Berkus
On 07/08/2014 06:10 PM, Mark Kirkwood wrote: On 09/07/14 05:13, Josh Berkus wrote: On 07/06/2014 01:27 AM, Christoph Berg wrote: Another could be that during initdb all the uncommented settings be written to postgresql.auto.conf file rather than to postgresql.conf. I think we can do this by

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-09 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: On 07/08/2014 10:07 AM, Robert Haas wrote: I haven't looked at the code in this area too carefully, but it seems to me like the flow ought to be: 1. Read all of the config files and determine what the final value present in each config file is. AFAICS

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Robert Haas
On Sat, Jul 5, 2014 at 10:52 AM, Tom Lane t...@sss.pgh.pa.us wrote: Amit Kapila amit.kapil...@gmail.com writes: Please find the patch attached to address the above concern. I have updated docs, so that users can be aware of such behaviour. I'm in the camp that says that we need to do

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Josh Berkus
On 07/08/2014 10:07 AM, Robert Haas wrote: I haven't looked at the code in this area too carefully, but it seems to me like the flow ought to be: 1. Read all of the config files and determine what the final value present in each config file is. 2. *Then*, in a second pass, enforce

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Josh Berkus
On 07/06/2014 01:27 AM, Christoph Berg wrote: Another could be that during initdb all the uncommented settings be written to postgresql.auto.conf file rather than to postgresql.conf. I think we can do this by changing code in initdb.c-setup_config(). This will ensure that unless user is

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Mark Kirkwood
On 09/07/14 05:13, Josh Berkus wrote: On 07/06/2014 01:27 AM, Christoph Berg wrote: Another could be that during initdb all the uncommented settings be written to postgresql.auto.conf file rather than to postgresql.conf. I think we can do this by changing code in initdb.c-setup_config(). This

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Amit Kapila
On Tue, Jul 8, 2014 at 11:59 PM, Tom Lane t...@sss.pgh.pa.us wrote: No, ALTER SYSTEM is there now and it needs to work right in its first release. I will go fix this if nobody else does. I am planing to provide an initial patch for this issue in a day or so, hope that is not too late. With

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Amit Kapila
On Wed, Jul 9, 2014 at 6:40 AM, Mark Kirkwood mark.kirkw...@catalyst.net.nz wrote: On 09/07/14 05:13, Josh Berkus wrote: Another could be that during initdb all the uncommented settings be written to postgresql.auto.conf file rather than to postgresql.conf. I think we can do this by changing

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-08 Thread Tom Lane
Amit Kapila amit.kapil...@gmail.com writes: On Wed, Jul 9, 2014 at 6:40 AM, Mark Kirkwood mark.kirkw...@catalyst.net.nz wrote: Yes, but even well behaved users will see this type of error, because initdb uncomments certain values (ones that are dead certs for being changed via ALTER SYSTEM

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-06 Thread Christoph Berg
Re: Amit Kapila 2014-07-06 CAA4eK1K=2WCD5ur8c-34NOw+XKg57Q4k0SajwSQXcwciD-=+0...@mail.gmail.com Another could be that during initdb all the uncommented settings be written to postgresql.auto.conf file rather than to postgresql.conf. I think we can do this by changing code in

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-06 Thread Amit Kapila
On Sun, Jul 6, 2014 at 1:57 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-07-06 CAA4eK1K=2WCD5ur8c-34NOw+XKg57Q4k0SajwSQXcwciD-=+0...@mail.gmail.com Another could be that during initdb all the uncommented settings be written to postgresql.auto.conf file rather than to

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-05 Thread Tom Lane
Amit Kapila amit.kapil...@gmail.com writes: Please find the patch attached to address the above concern. I have updated docs, so that users can be aware of such behaviour. I'm in the camp that says that we need to do something about this, not just claim that it's operating as designed.

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-05 Thread Amit Kapila
On Sat, Jul 5, 2014 at 8:22 PM, Tom Lane t...@sss.pgh.pa.us wrote: Amit Kapila amit.kapil...@gmail.com writes: Please find the patch attached to address the above concern. I have updated docs, so that users can be aware of such behaviour. I'm in the camp that says that we need to do

Re: [HACKERS] postgresql.auto.conf and reload

2014-07-04 Thread Amit Kapila
On Fri, Jun 27, 2014 at 9:11 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Thu, Jun 26, 2014 at 1:49 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-26 CAA4eK1+mUTjc=GXJK3bYtSwV2BmBni= phevbqlqkhduv9cw...@mail.gmail.com How about adding a note in Alter System so that

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-26 Thread Christoph Berg
Re: Amit Kapila 2014-06-26 CAA4eK1+mUTjc=GXJK3bYtSwV2BmBni=phevbqlqkhduv9cw...@mail.gmail.com On Wed, Jun 25, 2014 at 7:52 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-25 caa4ek1+f9ztogvvw-wyj2+vt0k8_jxtziqhp8ivb7wdo1w1...@mail.gmail.com I think maintaining values

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-26 Thread Amit Kapila
On Thu, Jun 26, 2014 at 1:49 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-26 CAA4eK1+mUTjc=GXJK3bYtSwV2BmBni= phevbqlqkhduv9cw...@mail.gmail.com On Wed, Jun 25, 2014 at 7:52 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-25

[HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Christoph Berg
I've just run into this: $ psql -p 5433 (that port is configured in postgresql.conf) # alter system set port = 5494; ... restart the server $ psql -p 5494 # select pg_reload_conf(); 2014-06-25 14:22:07 CEST [11297-4] LOG: received SIGHUP, reloading configuration files 2014-06-25 14:22:07

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Amit Kapila
On Wed, Jun 25, 2014 at 6:11 PM, Christoph Berg c...@df7cb.de wrote: I've just run into this: $ psql -p 5433 (that port is configured in postgresql.conf) # alter system set port = 5494; ... restart the server $ psql -p 5494 # select pg_reload_conf(); 2014-06-25 14:22:07 CEST

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Devrim Gündüz
Hi, On Wed, 2014-06-25 at 18:42 +0530, Amit Kapila wrote: This will happen without Alter System as well, if you change the value of port in postgresql.conf and try to load conf file with SIGHUP. You cannot reload PGC_POSTMASTER parameters without server restart. Ok, but Christoph already

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Christoph Berg
Re: Amit Kapila 2014-06-25 caa4ek1log98jvfov9wztqpcdewja+5jr54ttpkiz3xbngjy...@mail.gmail.com On Wed, Jun 25, 2014 at 6:11 PM, Christoph Berg c...@df7cb.de wrote: I've just run into this: $ psql -p 5433 (that port is configured in postgresql.conf) # alter system set port = 5494;

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Amit Kapila
On Wed, Jun 25, 2014 at 6:47 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-25 caa4ek1log98jvfov9wztqpcdewja+5jr54ttpkiz3xbngjy...@mail.gmail.com This will happen without Alter System as well, if you change the value of port in postgresql.conf and try to load conf file with

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Amit Kapila
On Wed, Jun 25, 2014 at 7:45 PM, Amit Kapila amit.kapil...@gmail.com wrote: On Wed, Jun 25, 2014 at 6:47 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-25 caa4ek1log98jvfov9wztqpcdewja+5jr54ttpkiz3xbngjy...@mail.gmail.com This will happen without Alter System as well, if

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Christoph Berg
Re: Amit Kapila 2014-06-25 caa4ek1+f9ztogvvw-wyj2+vt0k8_jxtziqhp8ivb7wdo1w1...@mail.gmail.com The main reason behind such such a behaviour after restart is that there are duplicate entries, one in postgresql.conf and another in postgresql.conf. It always first read postgresql.conf and then

Re: [HACKERS] postgresql.auto.conf and reload

2014-06-25 Thread Amit Kapila
On Wed, Jun 25, 2014 at 7:52 PM, Christoph Berg c...@df7cb.de wrote: Re: Amit Kapila 2014-06-25 caa4ek1+f9ztogvvw-wyj2+vt0k8_jxtziqhp8ivb7wdo1w1...@mail.gmail.com I think maintaining values both in postgresql.conf and by Alter System is not advisable. Possibly, but then the system should