Re: Simple question about running a function.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Simple question about running a function.
Дата
Msg-id CAKFQuwYvFhfuLiAfjef-nB-abrY12bgr4oD0we=vMkjNmoT81g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Simple question about running a function.  (SQL Padawan <sql_padawan@protonmail.com>)
Ответы Re: Simple question about running a function.  (SQL Padawan <sql_padawan@protonmail.com>)
Список pgsql-novice
On Fri, Nov 26, 2021 at 10:37 AM SQL Padawan <sql_padawan@protonmail.com> wrote:


It's something to do with output - SELECT obviously returns something, whereas INSERT doesn't - but that's not strictly true. It returns success or failure?

SELECT returns a result set (table), Insert doesn't
    INSERT INTO tab VALUES (100) RETURNING *;

Unless you use RETURNING...


How do I tell psql/PL/pgSQL that I want to suppress the output for
the test?

By doing exactly what the error message told you.  Use PERFORM instead of SELECT...on the exact query whose output you wish to ignore, not an indirect caller.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Simple question about running a function.
Следующее
От: SQL Padawan
Дата:
Сообщение: Re: Simple question about running a function.