How to get response message

From: Rama Krishnan <raghuldrag(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: How to get response message
Date: 2022-06-10 16:37:44
Message-ID: CAJWX+EN9uyyjOBwCRt0o5m1Oh7+2O1zTEYLKvsCoXw_HT7UXzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I am want to delete old records using function so my senior has function
like below but I want to get response of this particular inside query
wheter it is successful or failure

How to get response of the function status

create or replace function data_purge() returns void as$$
Declare
Begin
Drop table test_old;
Create table test_old as select * from sales where bill_date<now()
-interval '1 year';

Delete table sales where sales_id in (select sales_id from test_old;

End;
$$ language plpgsql;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-06-10 16:47:40 Re: How to get response message
Previous Message Nitesh Nathani 2022-06-10 16:04:30 multiple entries for synchronous_standby_names