Re: ToDo: API for SQL statement execution other than SPI

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ToDo: API for SQL statement execution other than SPI
Date: 2016-06-29 06:51:45
Message-ID: CAMsr+YFcxSSzUV+UNpy23Y9cVhSGHF97Mfkj+2LqheqPFZpRFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29 June 2016 at 13:55, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:

> Hi
>
> I am writing two background workers - autoreindex and scheduler. In Both I
> need to execute queries from top level. I had to wrote redundant code
> https://github.com/okbob/autoreindex/blob/master/utils.c autoreindex_execute_sql_command
> .Same code is in pglogical. Some statements - like VACUUM or REINDEX
> CONCURRENTLY is not possible call from SPI.
>
> Can be nice to have this function in core.
>

I strongly agree. In particular, something that can clean up and recover
from ERRORs. Right now you have to borrow a bunch of PostgresMain.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Ignatov 2016-06-29 10:43:32 Strange behavior of some volatile function like random(), nextval()
Previous Message Amit Kapila 2016-06-29 06:51:37 Re: Rename max_parallel_degree?