Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 348BC9FB294 for ; Tue, 23 Jan 2007 07:56:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 66055-05 for ; Tue, 23 Jan 2007 07:56:24 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 5168D9FB26E for ; Tue, 23 Jan 2007 07:56:28 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from www.herakles.homelinux.org (coco2.arach.net.au [203.34.16.107]) by svr4.postgresql.org (Postfix) with ESMTP id B16EE5AF9F5 for ; Tue, 23 Jan 2007 11:56:26 +0000 (GMT) Received: from mail.herakles.homelinux.org (unknown [192.168.7.254]) by www.herakles.homelinux.org (Postfix) with ESMTP id F1D5D5F5306 for ; Tue, 23 Jan 2007 20:56:08 +0900 (WST) Received: from mail2.cds.merseine.nu (unknown [192.168.9.4]) by mail.herakles.homelinux.org (Postfix) with ESMTP id D15A81F767 for ; Tue, 23 Jan 2007 20:56:23 +0900 (WST) Received: from [192.168.9.146] (Bilby.demo.lan [192.168.9.146]) by mail2.cds.merseine.nu (Postfix) with ESMTP id 74F35CAC002 for ; Tue, 23 Jan 2007 20:56:00 +0900 (WST) Message-ID: <45B5F7D0.9080801@herakles.homelinux.org> Date: Tue, 23 Jan 2007 20:56:00 +0900 From: John Summerfield User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20061007 SeaMonkey/1.0.5 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: How to query by column names References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200701/112 X-Sequence-Number: 27264 Jeff Frost wrote: > On Tue, 23 Jan 2007, Josh Williams wrote: > >> From: Jeff Frost >>> On Mon, 22 Jan 2007, Richard Ray wrote: >> ... >> >> That's definitely part of it. I'm assuming the above is an abridged >> example and the OP is doing something dynamic with the query. The >> real trouble is Bash likes to expand the asterisk into a list of every >> file in the current directory when you try to push the command through >> a variable. So it's just a matter of finding a way to escape the * Oh, good grief Charlie Brown: backslash it: \* so: echo select \* from whatsit | psql test >> character to keep Bash from globbing, which unfortunately right now is >> escaping me (no pun intended.) -- Off-list replies unwelcome