On Sun, 20 Sep 2009, Abel Camarillo wrote:
#!/bin/sh
dbname=
user=
password=
In general it's better to use the .pgpass/PGPASSFILE mechanism:
http://www.postgresql.org/docs/current/static/libpq-pgpass.html
to cache passwords like this, if you can't eliminate the need for them
altogether thro
On Sun, Sep 20, 2009 at 04:49:03PM -0500, Alex Gadea wrote:
> I am using psql to call an external sql file that executes a simple select
> count(*):
>
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variable available to the shell script
> once the external
On Sun, 2009-09-20 at 16:49 -0500, Alex Gadea wrote:
> I am using psql to call an external sql file that executes a simple
> select count(*):
>
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variable available to the shell
> script once the external sql file
On Sun, Sep 20, 2009 at 4:42 PM, Alex Gadea wrote:
> Yes, I'd like to do it via Perl, but I don't have control over the server and
> the admins who do may balk at the idea of loading the necessary db modules.
Was in the same position as you. Only language allowed on our
production dbs was bash.
t: Sunday, September 20, 2009 6:21:05 PM GMT -05:00 US/Canada Eastern
Subject: Re: [GENERAL] How to get variable out to shell script
On Sun, Sep 20, 2009 at 04:49:03PM -0500, Alex Gadea wrote:
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variab
On Sun, Sep 20, 2009 at 04:49:03PM -0500, Alex Gadea wrote:
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variable available to the shell
> script once the external sql file completes execution.
Just tell psql not to output any surrounding stuff and then jus
On Sun, 2009-09-20 at 16:49 -0500, Alex Gadea wrote:
> I am using psql to call an external sql file that executes a simple
> select count(*):
>
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variable available to the shell
> script once the external sql file
On Sun, Sep 20, 2009 at 3:49 PM, Alex Gadea wrote:
> I am using psql to call an external sql file that executes a simple select
> count(*):
>
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variable available to the shell script
> once the external sql file comp