From: Kazuyuki Maejima <kmaejima@oak.ocn.ne.jp>
To: T E Schmitz <mailreg@numerixtechnology.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: psql -F <TAB>
Date: Thu, 16 Nov 2006 23:31:57 +0900
Message-ID: <455C765D.7030504@oak.ocn.ne.jp> (raw)
In-Reply-To: <455C5B6E.1070403@joeconway.com>
References: <455C4918.4020604@numerixtechnology.de>
<20061116115812.GB19298@alvh.no-ip.org>
<455C54FE.5090902@numerixtechnology.de>
<455C5B6E.1070403@joeconway.com>
Joe Conway wrote:
> Try:
> psql -A -t -U $DBUSER -d $DB -c "$QUERY" -F $'\t'
That's excellent, but please let me post a different way :)
by passing commands from stdin:
#!/bin/sh
cat <<EOT | psql -q -A -t -U $DBUSER -d $DB
\f '\t'
$QUERY
EOT
I think this will work even if your /bin/sh is not bash
(like FreeBSD and NetBSD).
Cheers,
Kazuyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kmaejima@oak.ocn.ne.jp, mailreg@numerixtechnology.de
Subject: Re: psql -F <TAB>
In-Reply-To: <455C765D.7030504@oak.ocn.ne.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox