Skip site navigation (1) Skip section navigation (2)

Re: BUG #6301: extra space in psql variable expansion

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Michael Smolsky <sitrash(at)email(dot)com>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6301: extra space in psql variable expansion
Date: 2011-11-18 22:11:37
Message-ID: CAK3UJRHxCGo1tux3cjWx+tUeZ-Yg9N5Z+qtj+UOQ8tes=8Bp0w@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Fri, Nov 18, 2011 at 4:53 PM, Michael Smolsky <sitrash(at)email(dot)com> wrote:
> Could you please also confirm that variable expansion works correctly for
> psql's \i command as well?
>
> Test case (type on psql client prompt):
>
> \set my_dir /some/path/to/sql/script/dir
> \i :my_dir/my-script.sql
>
> I expect the parser to load and execute my-script.sql located within
> /some/path/to/sql/script/dir

Yup, that works on a 9.2dev client:

test=# \set my_dir /tmp/foo/bar/baz
test=# \i :my_dir/test.sql
 ?column?
----------
        1
(1 row)

with test.sql containing the single line "SELECT 1;"

Josh

pgsql-bugs by date

Next:From: Alex HunsakerDate: 2011-11-18 23:10:11
Subject: Re: BUG #6300: duplicate key value violates unique constraint
Previous:From: Tigran MkrtchyanDate: 2011-11-18 21:31:45
Subject: Re: BUG #6300: duplicate key value violates unique constraint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group