Re: psql removes dashed comments - Mailing list pgsql-general

From Boris Zentner
Subject Re: psql removes dashed comments
Date
Msg-id DC789296-C915-4265-914E-C488E3936B09@2bz.de
Whole thread Raw
In response to Re: psql removes dashed comments  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
> I was wondering why psql loose dashed comments and what can be done about this misbehaviour.
>
> postgres=# \e
>
>
> Because \e treats the query buffer as a single line of code and dashed comments cannot be used, just like
meta-commandscannot be used. 
>
> Including a filename should establish the behavior you desire.
>
Thanks David! \e filename does indeed help a bit but the file must exists and I have to type and invent the filename
beforeI start. 
My workaround was \! vim xyz.sql but it is not satisfying.

Without thinking to depth about this, maybe a new meta command could help?
Something like \eee to fill an initially empty temporary file from the query buffer on the first call and reuse it over
theruntime of the psql command. 


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: psql removes dashed comments
Next
From: Tom Lane
Date:
Subject: Re: psql removes dashed comments