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