X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9888911F650A for ; Wed, 29 Mar 2006 21:20:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90711-04 for ; Wed, 29 Mar 2006 21:20:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.utiba.com.au (eth2643.vic.adsl.internode.on.net [150.101.158.82]) by postgresql.org (Postfix) with ESMTP id BFD0411F644E for ; Wed, 29 Mar 2006 21:20:17 -0400 (AST) Received: from localhost (scan1.utiba.com.au [127.0.0.1]) by mail.utiba.com.au (Postfix) with ESMTP id 78FD944204 for ; Thu, 30 Mar 2006 11:20:17 +1000 (EST) Received: from mail.utiba.com.au ([127.0.0.1]) by localhost (scan1.utiba.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 16115-09 for ; Thu, 30 Mar 2006 11:20:13 +1000 (EST) Received: from mail1.utiba.com (ser1 [192.168.0.1]) by mail.utiba.com.au (Postfix) with ESMTP id 1E97A44203 for ; Thu, 30 Mar 2006 11:20:13 +1000 (EST) Received: from rotate-the-shield-harmonics.utiba.com (localhost [127.0.0.1]) by mail1.utiba.com (Postfix) with ESMTP id 52763143023 for ; Thu, 30 Mar 2006 11:20:11 +1000 (EST) From: Philip Yarra To: pgsql-hackers@postgresql.org Subject: psql \c error Date: Thu, 30 Mar 2006 11:20:09 +1000 User-Agent: KMail/1.7.2 X-enigma: Naturally a smoked function is living Organization: Utiba Pty Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603301120.09969.philip@utiba.com> X-Utiba-MailScanner-Information: Please contact the Systems Administrator at Utiba for more information X-Utiba-MailScanner: Found to be clean Utiba-MailScanner-MCPCheck: X-MailScanner-From: philip@utiba.com X-Virus-Scanned: amavisd-new at utiba.com.au X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.103 required=5 tests=[AWL=0.103] X-Spam-Score: 0.103 X-Spam-Level: X-Archive-Number: 200603/1250 X-Sequence-Number: 81648 Hi folks, I've found that CVS HEAD psql's \c doesn't quite behave as expected when postmaster is listening on non-default port. In this case I have postmaster listening on port 5434: [pyarra@punky pgsql]$ /usr/local/pgsql-cvs-head/bin/psql -p5434 -dpyarra Welcome to psql 8.2devel, 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 pyarra=# \d No relations found. (correct, nothing in DB 'pyarra') pyarra=# \l List of databases Name | Owner | Encoding -----------+--------+---------- postgres | pyarra | LATIN1 pyarra | pyarra | LATIN1 spctest | pyarra | LATIN1 template0 | pyarra | LATIN1 template1 | pyarra | LATIN1 (5 rows) pyarra=# \c spctest 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.5432"? Previous connection kept pyarra=# \c spctest - - 5434 You are now connected to database "spctest" as user "pyarra" on host "(null)" at port 5434. 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.5432"? Previous connection kept 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.5432"? Previous connection kept spctest=# \d List of relations Schema | Name | Type | Owner --------+------+-------+-------- public | foo | table | pyarra (1 row) (correct, one table in DB 'spctest') The comments in src/bin/psql/command.c, starting at line 192, indicate the new connection should use the current port (5434) but this is not happening. Also note that when port is explicitly specified (\c spctest - - 5434) it does connect to the new DB on the right port, but still prints a spurious error. The comments further down say "default" instead of "current" when the dash is used, so the comments may not be quite right. What behaviour was this change (http://archives.postgresql.org/pgsql-patches/2006-03/msg00154.php) actually supposed to give us? Regards, Philip. -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan ----------------- Utiba Pty Ltd This message has been scanned for viruses and dangerous content by Utiba mail server and is believed to be clean.