psql removes dashed comments - Mailing list pgsql-general

From Boris Zentner
Subject psql removes dashed comments
Date
Msg-id DE9FE8CF-ABB4-4AA1-BCB5-B7F240374FFD@2bz.de
Whole thread Raw
Responses Re: psql removes dashed comments  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: psql removes dashed comments  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: psql removes dashed comments  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Hi,

I was wondering why psql loose dashed comments and what can be done about this misbehaviour.

I get often some sql, paste it into psql run and edit it via \e. A few iterations until everything works.
But psql removes the comments and creates a lot extra work to restore the comments and changes to the query.

Here is an example:

# start psql, paste something run it, edit \e, rerun and so on. At the end all dashed comments are removed.


psql -Xe postgres
psql (14.1)
Type "help" for help.

postgres=# select 1, -- one
 2, /* two */
 3 -- three
;
select 1,
 2, /* two */
 3
;
 ?column? | ?column? | ?column?
----------+----------+----------
        1 |        2 |        3
(1 row)

postgres=# \e
select 1,
 2, /* two */
 3
;
 ?column? | ?column? | ?column?
----------+----------+----------
        1 |        2 |        3
(1 row)

--
Boris





pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Resources on modeling ordered hierachies?
Next
From: Adrian Klaver
Date:
Subject: Re: psql removes dashed comments