Paul Tilles <[EMAIL PROTECTED]> writes:
> What I really want to do is the following:

> \set  local_site  `echo  $FXA_LOCAL_SITE
> UPDATE  table_name  SET  office_id =  :local_site;

> This results in the message
>                column  "xxx" does not exist

Yes, because you have no quotes in the value of the variable, so that
update looks to the server like
        UPDATE  table_name  SET  office_id =  xxx;

After some fooling around, the easiest way to get the needed quotes is
to embed them in the echo result:

\set local_site `echo "'$FXA_LOCAL_SITE'"`

BTW, does your psql really let you leave off the trailing ` like
that?  Mine doesn't.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to