psql variable interpolation from command line

I'm at a loss to explain this one:

$ psql -v AUTHOR="'foo'" -c 'select :AUTHOR;'
ERROR: syntax error at or near ":" at character 8

$ psql -v AUTHOR="'foo'"
....
# select :AUTHOR;
?column?
----------
foo
(1 row)


In other words, why won't variable interpolation work when the "-c" flag is
used?

--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Jeff Boes [ Fr, 01 Oktober 2004 15:24 ] [ ID #453721 ]

Re: psql variable interpolation from command line

Ugh, never mind. I finally saw the reason in the 'psql' documentation. Missed it
the first time. (And the second, and third, ...)

--
Jeff Boes vox 269.226.9550 ext 24
Database Engineer fax 269.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt... Extend your Expertise
Jeff Boes [ Fr, 01 Oktober 2004 15:28 ] [ ID #453722 ]
Datenbanken » comp.databases.postgresql.sql » psql variable interpolation from command line

Vorheriges Thema: Re: Postgres Doubt
Nächstes Thema: multi column foreign key for implicitly unique columns