pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ludwig Isaac Lim <ludz_lim@yahoo.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Error when pasting function blocks into psql
Date: Wed, 6 Jul 2022 12:24:00 +0000 (UTC)
Message-ID: <1797402460.2041897.1657110240951@mail.yahoo.com> (raw)
References: <1797402460.2041897.1657110240951.ref@mail.yahoo.com>

Hello:
I noticed that I'm getting errors when copy and pasting code for stored procedure from Windows directly into psql running in putty.
To reproduce create a procedure that has multiple statements with each statements having multiple lines, similar to the ones below:
CREATE OR REPLACE PROCEDURE test()AS$$     UPDATE                     table1      SET                   field1 = ?;

       -- more SQL statements$$LANGUAGE SQL;
Copy and paste from Windows editor (or IDE) to a psql running in a Putty. Chances are it will complain of syntax error. The error doesn't appear when I copy and paste it to an empty file in vim, and the run:
psql -f <file name>
Is there a way of prevent this kind of error when pasting directly into psql? I'm using the latest version of PostgreSQL (server and client. Version 14.4)
Thank you in advance,Ludwig Lim

view thread (4+ messages)  latest in thread

Message-ID: <1797402460.2041897.1657110240951@mail.yahoo.com>
Permalink:  ../1797402460.2041897.1657110240951@mail.yahoo.com/
Also on:    postgresql.org/message-id/1797402460.2041897.1657110240951@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ludz_lim@yahoo.com
  Subject: Re: Error when pasting function blocks into psql
  In-Reply-To: <1797402460.2041897.1657110240951@mail.yahoo.com>
  References: <1797402460.2041897.1657110240951.ref@mail.yahoo.com> <1797402460.2041897.1657110240951@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox