Re: Add PQsendSyncMessage() to libpq

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Add PQsendSyncMessage() to libpq
Дата
Msg-id 20230503100357.35enoibsgtsqvsjt@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Add PQsendSyncMessage() to libpq  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Add PQsendSyncMessage() to libpq  (Anton Kirilov <antonvkirilov@gmail.com>)
Re: Add PQsendSyncMessage() to libpq  (Michael Paquier <michael@paquier.xyz>)
Re: Add PQsendSyncMessage() to libpq  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Список pgsql-hackers
On 2023-May-02, Robert Haas wrote:

> On Mon, May 1, 2023 at 8:42 PM Michael Paquier <michael@paquier.xyz> wrote:
> > Another thing that may matter in terms of extensibility?  Would a
> > boolean argument really be the best design?  Could it be better to
> > have instead one API with a bits32 and some flags controlling its
> > internals?
> 
> I wondered that, too. If we never add any more Boolean parameters to
> this function then that would end up a waste, but maybe we will and
> then it will be genius. Not sure what's best.

I agree that adding a flag is the way to go, since it improve chances
that we won't end up with ten different functions in case we decide to
have eight other behaviors.  One more function and we're done.  And
while I can't think of any use for a future flag, we (I) already didn't
of this one either, so let's not make the same mistake.

We already have 'int' flag masks in PQcopyResult() and
PQsetTraceFlags().  We were using bits32 initially for flag stuff in the
PQtrace facilities, until [1] reminded us that we shouldn't let c.h
creep into app-land, so that was turned into plain 'int'.

[1]
https://www.postgresql.org/message-id/TYAPR01MB2990B6C6A32ACF15D97AE94AFEBD0%40TYAPR01MB2990.jpnprd01.prod.outlook.com

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"No nos atrevemos a muchas cosas porque son difíciles,
pero son difíciles porque no nos atrevemos a hacerlas" (Séneca)



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Support logical replication of DDLs
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Add two missing tests in 035_standby_logical_decoding.pl