Re: BUG #13674: psql: \i from a script run through \e misparses SQL as \i arguments

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "postgresql(at)zr40(dot)nl" <postgresql(at)zr40(dot)nl>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13674: psql: \i from a script run through \e misparses SQL as \i arguments
Date: 2015-10-13 04:21:32
Message-ID: CAKFQuwbigSBfZ=7btysFYqLc1PbP5Bx3T4hxtPYQ-m9vtAGMtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Monday, October 12, 2015, <postgresql(at)zr40(dot)nl> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 13674
> Logged by: Matthijs van der Vleuten
> Email address: postgresql(at)zr40(dot)nl <javascript:;>
> PostgreSQL version: 9.4.5
> Operating system: Mac OS X
> Description:
>
> Reproduction:
>
> 1. Create file a.sql with the following contents:
>
> BEGIN;
> \i b.sql
> ROLLBACK;
>
> 2. Create an empty file b.sql (smallest reproduction; bug also occurs with
> non-empty files)
> 3. In psql, execute: \e a.sql
> 4. In $EDITOR, save and exit
>
> Actual output:
>
> ~/test % psql -Xe
> psql (9.4.5)
> Type "help" for help.
>
> zr40=# \e foo2.sql
> BEGIN;
> BEGIN
> \i: extra argument "ROLLBACK;" ignored
> zr40=#
>
> Expected output:
>
> ~/test % psql -Xe
> psql (9.4.5)
> Type "help" for help.
>
> zr40=# \e foo2.sql
> BEGIN;
> BEGIN
> ROLLBACK;
> ROLLBACK
> zr40=#
>
>
Working as documented. Namely the "...whole buffer as a single line."
part of \e. Hence the warning about not making scripts with this command.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message glauciobb 2015-10-13 19:27:57 BUG #13676: C typedef code generated by ecpg with wrong syntax
Previous Message Tom Lane 2015-10-13 03:49:46 Re: BUG #13670: DST discrepancy between age() and subtraction for timestamptz arguments