From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7746 invoked from network); 15 Sep 2004 09:59:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Sep 2004 09:59:09 -0000 Received: (qmail 31402 invoked from network); 15 Sep 2004 09:59:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Sep 2004 09:59:03 -0000 Received: (qmail 29002 invoked by alias); 15 Sep 2004 09:58:19 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7996 Received: (qmail 28991 invoked from network); 15 Sep 2004 09:58:19 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Sep 2004 09:58:19 -0000 Received: (qmail 30195 invoked from network); 15 Sep 2004 09:57:53 -0000 Received: from happygiraffe.net (81.6.215.59) by a.mx.sunsite.dk with SMTP; 15 Sep 2004 09:57:51 -0000 Received: from localhost (localhost.happygiraffe.net [127.0.0.1]) by happygiraffe.net (Postfix) with ESMTP id C2019B8C4; Wed, 15 Sep 2004 10:57:50 +0100 (BST) Received: from happygiraffe.net ([127.0.0.1]) by localhost (ppe.happygiraffe.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 63325-04; Wed, 15 Sep 2004 10:57:50 +0100 (BST) Received: by happygiraffe.net (Postfix, from userid 1001) id 51794B8BA; Wed, 15 Sep 2004 10:57:50 +0100 (BST) Date: Wed, 15 Sep 2004 10:57:50 +0100 To: Peter Stephenson Cc: zsh-users@sunsite.dk Subject: Re: PostgreSQL completion Message-ID: <20040915095750.GA64349@ppe.happygiraffe.net> References: <20040915064031.GA52150@ppe.happygiraffe.net> <200409150928.i8F9S3lL008566@news01.csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200409150928.i8F9S3lL008566@news01.csr.com> User-Agent: Mutt/1.5.6i From: dom@happygiraffe.net (Dominic Mitchell) X-Virus-Scanned: by amavisd-new at happygiraffe.net X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_40 autolearn=no version=2.63 X-Spam-Hits: -0.0 On Wed, Sep 15, 2004 at 10:28:03AM +0100, Peter Stephenson wrote: > Dominic Mitchell wrote: > > 1. I use psql to get information from the database. But what happens > > if psql spits out an error? At the moment, it just messes up the > > display... > > The usual method is simply to add 2>/dev/null to the command. If you > want to be smarter about errors you need to work harder. Aha, good point. I'll do that. No need to be too clever, the same error will be displayed at some point anyway. > > 2. How do you complete either a hostname or a path at the same point? > > PostgreSQL accepts either a hostname or a directory containing a socket > > after -h. > > The easy way is _alternative, assuming you have functions for both > cases. _ssh does (after a bit of editing): > > _alternative \ > 'hosts:remote host name:_ssh_hosts' \ > 'users:login name:_ssh_users -qS@' Excellent, I shall do that. I tried looking for an example, I'll have to try harder next time. :-) -Dom