Re: [HACKERS] Someone's broken psql's connection-failure error reporting
On Thu, Feb 13, 2003 at 08:55:23PM -0500, Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: I've done a little bit of cleanup, but that code is still a mess... someone should rewrite these routines. Yes, I looked at it and struggled to get both IPv4 and IPv6 cleanly working. Any ideas on how to improve it? The major problem is the huge amount of #ifdefs, most of which seem to come from the fact that we deal with a list of possible addresses in one case and not the other. It would help a lot if we fixed things so that we dealt with a list in either case --- only a one-element list, if we don't have getaddrinfo, but getaddrinfo2 could hide that and provide a uniform API regardless. I'm actually working on getting rid of all those #ifdef's, but it's going slowly. (I have very little free time.) Kurt ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
[HACKERS] Someone's broken psql's connection-failure error reporting
In CVS tip, I'm getting only an empty string from psql where it should print connection-failure messages. psql 7.3 does this: $ psql -p psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket /tmp/.s.PGSQL.? $ CVS tip does this: $ psql -p psql: $ Have not dug to see if this is the fault of libpq or psql; but there's been a fair amount of hacking lately in libpq's connection handling ... regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] Someone's broken psql's connection-failure error reporting
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: In CVS tip, I'm getting only an empty string from psql where it should print connection-failure messages. [ it works here ] Speculation time: do you have the IPv6 code compiled in? I don't. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] Someone's broken psql's connection-failure error reporting
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: In CVS tip, I'm getting only an empty string from psql where it should print connection-failure messages. [ it works here ] Speculation time: do you have the IPv6 code compiled in? I don't. I have IPv6 enabled in the binary, but not the kernel. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [HACKERS] Someone's broken psql's connection-failure error reporting
Tom Lane wrote: In CVS tip, I'm getting only an empty string from psql where it should print connection-failure messages. psql 7.3 does this: $ psql -p psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket /tmp/.s.PGSQL.? $ CVS tip does this: $ psql -p psql: $ Have not dug to see if this is the fault of libpq or psql; but there's been a fair amount of hacking lately in libpq's connection handling ... I just tried and got an error: $ psql -p psql: could not create socket: No such file or directory This is as of last night's CVS. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html
Re: [HACKERS] Someone's broken psql's connection-failure error reporting
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Speculation time: do you have the IPv6 code compiled in? I don't. I have IPv6 enabled in the binary, but not the kernel. Sure enough, the IPV6 patch had broken error handling in the non-IPV6 path. I've done a little bit of cleanup, but that code is still a mess... someone should rewrite these routines. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [HACKERS] Someone's broken psql's connection-failure error reporting
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: Speculation time: do you have the IPv6 code compiled in? I don't. I have IPv6 enabled in the binary, but not the kernel. Sure enough, the IPV6 patch had broken error handling in the non-IPV6 path. I've done a little bit of cleanup, but that code is still a mess... someone should rewrite these routines. Yes, I looked at it and struggled to get both IPv4 and IPv6 cleanly working. Any ideas on how to improve it? -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup.| Newtown Square, Pennsylvania 19073 ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [HACKERS] Someone's broken psql's connection-failure error reporting
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: I've done a little bit of cleanup, but that code is still a mess... someone should rewrite these routines. Yes, I looked at it and struggled to get both IPv4 and IPv6 cleanly working. Any ideas on how to improve it? The major problem is the huge amount of #ifdefs, most of which seem to come from the fact that we deal with a list of possible addresses in one case and not the other. It would help a lot if we fixed things so that we dealt with a list in either case --- only a one-element list, if we don't have getaddrinfo, but getaddrinfo2 could hide that and provide a uniform API regardless. The SSL patch is contributing a lot of ugliness too. It would be more functional as well as cleaner if someone rewrote that code to work in non-blocking style (which AFAICT should be feasible with the openssl API, it just wasn't done). regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html