Thanks, quoting does indeed fix it. It's worth noting that comparing the
9.1 and 9.2 documentation, there is no hint that quoting/substitution
behavior changed. Or put another way, the docs say very little about
quoting/substitution behavior in general, aside from one highly confusing
"Note:" block. I do see the quoting change in the 9.2 release notes now
that I look.
On Thu, Apr 18, 2013 at 12:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> nyetter@gmail.com writes:
> > My psql PROMPT1, set through /etc/sysconfig/pgsql/psqlrc, is the
> following:
> > h:%M%040d:%/%040U:%n%040AC:%:AUTOCOMMIT:%040TX:%x%012%R%#%040
>
> You did not show us exactly how you set that, but I speculate that you
> weren't bothering to quote it. 9.2 is more consistent than prior
> versions were about expanding :variable references in backslash
> commands, which means that you'd better quote the reference to
> :AUTOCOMMIT if you don't want it expanded on-the-spot before it goes
> into the prompt string. I'd suggest putting single quotes around the
> argument of \set PROMPT1, viz
>
> \set PROMPT1
> 'h:%M%040d:%/%040U:%n%040AC:%:AUTOCOMMIT:%040TX:%x%012%R%#%040'
>
> regards, tom lane
>