By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,302 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,302 IT Pros & Developers. It's quick & easy.

psql: How to make :HOST expand in a "\!" command?

P: n/a
I have a SQL script that needs to invoke a non-SQL command, so I'm using ...

\! some_cmd arg arg arg

However, when the SQL script is invoked for a different PostgreSQL host,
e.g.,

$ psql -h HOSTNAME -f SCRIPTNAME

the :HOST variable is set correctly, but there doesn't seem to be a way
to pass :HOST to the external command. That is,

\! PGHOST=:HOST some_cmd arg arg arg

fails because ":HOST" is not expanded.

--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.