Обсуждение: tcpip_socket vs -i
I'm trying to find out the true behavior of postgres in regards to accepting tcpip socket connections. According to the documentation, I should be able to start postmaster with just "pg_ctl start" then specify tcpip_socket = on (or possibly tcpip_socket = true, I tried both) in postgresql.conf and have tcp_ip socket connections working, however after a multitude of different attempts I found no way to get tcpip sockets to work unless I started the postmaster with -i. I understand that the command line options would override the conf file in cases of conflict, but does the mere omission of -i override any attempts to use sockets otherwise? I would hope that not specifying -i would allow me to turn socket connections on and off via the conf file, without a restart of the database, but what is happening in practice seems to be going against what is in the docs. Anyone know for sure? Robert Treat Auction Management Solutions, Inc. Tampa, FL
The .conf file is not read automagically as far as I know. You need to restart pg to reread it. So any changes made afterstarting pg, really have not effect until the next time you restart it. cheers, --t. On Sun, 24 Feb 2002, Robert Treat wrote: > I'm trying to find out the true behavior of postgres in regards to accepting > tcpip socket connections. According to the documentation, I should be able > to start postmaster with just "pg_ctl start" then specify tcpip_socket = on > (or possibly tcpip_socket = true, I tried both) in postgresql.conf and have > tcp_ip socket connections working, however after a multitude of different > attempts I found no way to get tcpip sockets to work unless I started the > postmaster with -i. I understand that the command line options would > override the conf file in cases of conflict, but does the mere omission > of -i override any attempts to use sockets otherwise? I would hope that not > specifying -i would allow me to turn socket connections on and off via the > conf file, without a restart of the database, but what is happening in > practice seems to be going against what is in the docs. Anyone know for > sure? > > Robert Treat > Auction Management Solutions, Inc. > Tampa, FL > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >
"Robert Treat" <robertt@auctionsolutions.com> writes: > I'm trying to find out the true behavior of postgres in regards to accepting > tcpip socket connections. According to the documentation, I should be able > to start postmaster with just "pg_ctl start" then specify tcpip_socket = on > (or possibly tcpip_socket = true, I tried both) in postgresql.conf and have > tcp_ip socket connections working, however after a multitude of different > attempts I found no way to get tcpip sockets to work unless I started the > postmaster with -i. Works fine for me. Are you sure the postmaster is looking at the same postgresql.conf that you think it's looking at? Or ... not to insult your intelligence, but ... did you remove the '#' comment marker from the line that sets tcpip_socket? regards, tom lane
Hey, that did insult my intellegence! :) I did get it working without the "-i" but it seems you cannot do this "on the fly" via pg_ctl reload, that you have to at least do a restart (either via pg_ctl or stop/start of postmaster) to get this going. Note this is contrary to something like turning on debugging output, which can be done via reload. It's a suttle difference, but one that probably should be mentioned in the docs somewhere. Robert > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Tom Lane > Sent: Sunday, February 24, 2002 5:31 PM > To: Robert Treat > Cc: Pgsql-General@Postgresql. Org > Subject: Re: [GENERAL] tcpip_socket vs -i > > > "Robert Treat" <robertt@auctionsolutions.com> writes: > > I'm trying to find out the true behavior of postgres in regards > to accepting > > tcpip socket connections. According to the documentation, I > should be able > > to start postmaster with just "pg_ctl start" then specify > tcpip_socket = on > > (or possibly tcpip_socket = true, I tried both) in > postgresql.conf and have > > tcp_ip socket connections working, however after a multitude of > different > > attempts I found no way to get tcpip sockets to work unless I > started the > > postmaster with -i. > > Works fine for me. Are you sure the postmaster is looking at the same > postgresql.conf that you think it's looking at? > > Or ... not to insult your intelligence, but ... did you remove the '#' > comment marker from the line that sets tcpip_socket? > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >
"Robert Treat" <robertt@auctionsolutions.com> writes: > I did get it working without the > "-i" but it seems you cannot do this "on the fly" via pg_ctl reload, that > you have to at least do a restart (either via pg_ctl or stop/start of > postmaster) to get this going. Oh, I misunderstood your complaint then. That's correct, socket setup happens only at postmaster start --- you can't change the port number on-the-fly either ;-). I believe this is documented accurately in the Admin Guide; note the comments that say that various parameters can be set only at server start. regards, tom lane