suppress notices from inside a stored a plpgqsl function

From: David Gauthier <dfgpostgres(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: suppress notices from inside a stored a plpgqsl function
Date: 2023-11-27 20:51:34
Message-ID: CAEs=6D=m6Gqc0jHQhysOa0t5aBc=NkMhf+eWKExscoSxqWf8zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi:

I have a plpgsql function that has this...

drop table if exists tmp_diff_blkviews;

Even with the "if exists", I still get...

NOTICE: table "tmp_diff_blkviews" does not exist, skipping
CONTEXT: SQL statement "drop table if exists tmp_diff_blkviews"
PL/pgSQL function dvm.blkview_diffs(character varying,character varying)
line 6 at SQL statement

I want to suppress that. Even if the temp table exists, I don't want to
hear about how it had to delete the table. Just delete it if it exists and
be quiet about it.

This function is being called through perl/dbi. So client side command line
set options, or anything like that, is no good. Is there way to control
messaging from inside the function ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-11-27 21:00:19 Re: suppress notices from inside a stored a plpgqsl function
Previous Message Tom Lane 2023-11-27 20:41:50 Re: IPV6 issue