> 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-commands cannot 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 before I 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 the runtime of the psql command.