Error when pasting function blocks into psql

Поиск
Список
Период
Сортировка
От Ludwig Isaac Lim
Тема Error when pasting function blocks into psql
Дата
Msg-id 1797402460.2041897.1657110240951@mail.yahoo.com
обсуждение исходный текст
Ответы Re: Error when pasting function blocks into psql  (Francisco Olarte <folarte@peoplecall.com>)
Re: Error when pasting function blocks into psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: ADD COLUMN ts tsvector GENERATED too slow
Следующее
От: Matthias Apitz
Дата:
Сообщение: Re: lifetime of the old CTID