Am 2008-09-11 10:03:03, schrieb Roderick A. Anderson:
Whatever happened to pgbash? I see the last update was Feb 2003 but
that was for Pg v7.3.
I have tried it soe times ago with 7.4 but goten to many errors...
...and gaved up.
Thanks, Greetings and nice Day/Evening
Michelle Konzack
Alvaro Herrera wrote:
Doesn't say about variable expansion ... And it seems to be in a
different realm, because the point is that the command is going to have
a single destination (either \-processing or sending it to the server).
Is psql being just lazy here and avoiding parsing the command?
Ok then. Does anyone have any tips or best practices for scripting psql?
I'll probably write some bash scripts to pull csv files over then script
psql to do a COPY into an import schema then run a pl/pgsql procedure, er
function, to do all ETL.
Who else is doing something like this? Can
In article [EMAIL PROTECTED],
Greg Smith [EMAIL PROTECTED] writes:
On Tue, 9 Sep 2008, Artacus wrote:
Can psql access environmental variables or command line params?
$ cat test.sql
select :TEST as input;
$ psql -v TEST=16 -f test.sql
input
---
16
(1 row)
Nice trick, but when I
Harald Fuchs escribió:
Nice trick, but when I try the following variant:
psql -v TEST=16 -c 'select :TEST as input'
I get
ERROR: syntax error at or near :
LINE 1: select :TEST as input
This seems to be contrary to the psql manual page:
These assignments are done during a
Harald Fuchs wrote:
In article [EMAIL PROTECTED],
Greg Smith [EMAIL PROTECTED] writes:
On Tue, 9 Sep 2008, Artacus wrote:
Can psql access environmental variables or command line params?
$ cat test.sql
select :TEST as input;
$ psql -v TEST=16 -f test.sql
input
---
16
(1 row)
Nice
Peter Eisentraut escribió:
psql manual page:
-c command
--command command
Specifies that psql is to execute one command string, command,
and then exit. This is useful in shell scripts.
command must be either a command string that is completely
At 7:13am -0400 on Thu, 11 Sep 2008, Harald Fuchs wrote:
Nice trick, but when I try the following variant:
psql -v TEST=16 -c 'select :TEST as input'
I get [a syntax error]
This seems to be contrary to the psql manual page:
Nope. Take a look at the -c option. Specifically Thus you
Kevin Hunter wrote:
At 7:13am -0400 on Thu, 11 Sep 2008, Harald Fuchs wrote:
Nice trick, but when I try the following variant:
psql -v TEST=16 -c 'select :TEST as input'
I get [a syntax error]
This seems to be contrary to the psql manual page:
Nope. Take a look at the -c option.
-- Original message --
From: Roderick A. Anderson [EMAIL PROTECTED]
Kevin Hunter wrote:
At 7:13am -0400 on Thu, 11 Sep 2008, Harald Fuchs wrote:
Nice trick, but when I try the following variant:
psql -v TEST=16 -c 'select :TEST as input'
I get [a
$ TEST=16; psql -c select $TEST as \input1\;
$ TEST=16; echo select $TEST as \input1\; | psql
Yep that works. My coworker also suggested using EOF to simulate a
psql script.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
Artacus wrote:
I'd like to learn a little more about writing psql scripts does anyone
know of any resources outside of the manual?
Ok then. Does anyone have any tips or best practices for scripting psql?
I'll probably write some bash scripts to pull csv files over then script
psql to do a
On Sep 10, 2008, at 2:46 AM, Artacus wrote:
Who else is doing something like this? Can psql access environmental
variables or command line params? Or do I have to have my bash
script write a psql script every time?
The psql \! command can execute shell commands. You can also use ``,
On Wed, Sep 10, 2008 at 12:46 AM, Artacus [EMAIL PROTECTED] wrote:
Artacus wrote:
I'd like to learn a little more about writing psql scripts does anyone
know of any resources outside of the manual?
Ok then. Does anyone have any tips or best practices for scripting psql?
I'll probably write
This sounds a lot like what I did in my last job using bash for most
things, and php for the more complicated stuff. Wrote a simple oracle
to pgsql table replicator in php that worked pretty well.
Well we do this stuff all the time with Oracle and sql*plus. And I've
heard people hear say
On Wed, Sep 10, 2008 at 10:14 PM, Artacus [EMAIL PROTECTED] wrote:
This sounds a lot like what I did in my last job using bash for most
things, and php for the more complicated stuff. Wrote a simple oracle
to pgsql table replicator in php that worked pretty well.
Well we do this stuff all
On Tue, 9 Sep 2008, Artacus wrote:
Can psql access environmental variables or command line params?
$ cat test.sql
select :TEST as input;
$ psql -v TEST=16 -f test.sql
input
---
16
(1 row)
You can find out more about what you can do with variable substitution at
I'd like to learn a little more about writing psql scripts does anyone
know of any resources outside of the manual?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
18 matches
Mail list logo