Re: psql question - Mailing list pgsql-general

From Tom Lane
Subject Re: psql question
Date
Msg-id 4246.1359589369@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql question  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
Steve Crawford <scrawford@pinpointresearch.com> writes:
> On 01/30/2013 01:51 PM, Little, Douglas wrote:
>> p1gp1=> \set env dev
>> p1gp1=> \i P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql
>> P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql: No such file or directory
>>
>> Any thoughts on how I might get this to work?

> Perhaps try concatenating variables then executing the result.

FWIW, Douglas' original coding works for me in 9.2 and HEAD:

regression=# \set env dev
regression=# \i P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql
P1GP1_ETL_STAGE_TBLS_BIO6113_100.dev.sql: No such file or directory

I think we fixed some bugs associated with expansion of variable names
embedded within larger words, but didn't back-patch for fear of breaking
existing apps in a minor release.  Your alternative looks to me like
it's basically dodging those bugs ...

            regards, tom lane


pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: naming of wal-archives
Next
From: Groshev Andrey
Date:
Subject: Re: trouble with upgrade from 9.0 (many schemas and tables)