On 29 June 2011 07:42, Susanne Ebrecht wrote:

I recognised this problem already some years ago using FreeBSD
and Debian - but I ran into it again yesterday and I am not sure if
this is psql related or not postgresql related at all.

Let me explain:
OS - Ubuntu 10.10
PostgreSQL 9.0.3

Together with other stuff I coded a PL/PgSQL function by using emacs.
Function has had round about 200-300 lines of code.

For testing reason I marked the function code  and copy / pasted it into

I got random confusing error message.
Messages like problem with the word IF or with an equal sign.
Messages that you usually get when you forget a semicolon or an END.
Sometimes I got "Function created" - but then on testing if function works
I got error messages like a table couldn't be found because the table name
was truncated.

Even without changing something at the code - every time I copy / paste the
function into psql - I got a different error message.
The given line number for the error always higher then 100.

By using df+ I compared the pasted function with the original and figured
that after more then 100 somewhere in the middle a line wasn't pasted
The last signs of the line just were truncated.
Or an additional line with a single sign like 'g' or 'b' was added.

Always just a single line. The code after that line was pasted correct

It looks like psql get a hiccup when you copy/paste more then 100 lines at

When I copy / paste the original code into a separate file in emacs or vi -
all was
copy /pasted correct.
Were emacs/vi running in a terminal?
Also when I used psql -f to upload the code all worked fine.

Is that a psql bug?
I don't think so.
It also worked to copy paste the function into psql in smaller pieces.
First the first 100 lines - then the next 100 lines and so on.

Has somebody an idea here why this happens?
I've seen behaviour like this too, but with things other than psql.
e.g. I've definitely seen it with MySQL. So I don't think it is
specific to psql. I don't know what causes it, but it is annoying and
I also end up either pasting the code in pieces or saving to a file
and loading it instead.

I haven't checked to see if it's only a single line that gets
corrupted or exactly how it gets corrupted, but otherwise it sounds
like the same problem you are seeing.

I'm not sure where the problem lies. Gnome Terminal? SSH (client? server?)

I think I have tried e.g. rxvt to see if that worked better and as far
as I remember I also encountered the problem there, but I might be
remembering incorrectly.

Michael Wood <esiotrot@gmail.com>

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 4 | next ›
Discussion Overview
grouppgsql-novice @
postedJun 29, '11 at 6:44a
activeJun 29, '11 at 10:24a

2 users in discussion

Susanne Ebrecht: 2 posts Michael Wood: 2 posts



site design / logo © 2021 Grokbase