Re: pasting a lot of commands to psql

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dmitry Shalashov <skaurus(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: pasting a lot of commands to psql
Date: 2016-07-07 20:31:26
Message-ID: CAHyXU0yZbxDKEO=ORK7223abc2a2zvyuRMhhiGC-ucJ67aOrLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jul 7, 2016 at 2:48 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> Merlin Moncure wrote:
>> On Thu, Jul 7, 2016 at 1:18 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>> > Tom Lane wrote:
>> >
>> >> You might have better luck with "psql -n", or maybe not.
>> >
>> > I've wished sometimes for a "\set READLINE off" psql metacommand for
>> > this kind of thing. It's pretty annoying when the text being pasted
>> > contains tabs and readline uses to do completion.
>>
>> Agreed. I've looked at this problem extensively and concur that
>> readline is the culprit; I don't think there's any solution on our end
>> besides filing a bug with the readline. I also agree with the
>> upthread suggestion that the best workaround today is to \e into a
>> non-readline based editor (vim qualifies). Having said that, at least
>> on linux/gnome, very long pastes can cause severe performance issues
>> as well. So for large pastes I go with psql -f.
>
> Hmm, I was doing megabyte-long pastes (longest one over 5 MB) just a few
> weeks ago and was pleasantly surprised to discover that they worked just
> fine with no noticeable performance problem. I was pasting skype logs
> directly from the Linux skype client window into an xterm running cat,
> with obviously no readline involved.

Might be a 'xterm vs Mate Terminal' problem. Using raw xterm
performance is great. I like some of the creature comforts of the
mate terminal though.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2016-07-07 20:40:37 Re: pasting a lot of commands to psql
Previous Message John R Pierce 2016-07-07 20:09:02 Re: pasting a lot of commands to psql