Re: [INTERFACES] Roadmap for FE/BE protocol redesign

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [INTERFACES] Roadmap for FE/BE protocol redesign
Date: 2003-03-21 18:33:08
Message-ID: 14365.1048271588@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> My concern is bloating the API for all languages based on libpq, and
> psql and stuff like that. Heck, even pgadmin would have to have a
> button for it because a SET couldn't control it.

Peter's point, AIUI, is that that is a good thing.

The problem with SET for autocommit is that every client program has to
*know*, without question, which setting it is using. Autocommit is just
about as dangerous as a GUC variable that, say, silently swaps the
meanings of INSERT and DELETE --- if you don't know which setting you
are using then you will get the wrong results.

Thus it is not "convenient" to allow autocommit to be set in all the
weird and wonderful ways that we allow GUC variables to be set; it's
more like handing a razor blade to a baby. We've already found out that
all client-side apps have to explicitly force autocommit to the setting
they want, or they break. How is that a good thing?

I think we *should* go back to the assumption that libpq-based programs
see autocommit-on behavior unless they take specific action to prevent
it. And that means that the client program has to take action to select
autocommit off, not that the admin can flick a switch remotely that will
affect clients.

The real point is that both the client application and the client
library need to know what the autocommit behavior is. This is why
adding autocommit to the library APIs is the right thing, not the wrong
thing. When there are ways other than a library API call to set the
autocommit behavior, then one party or the other is out of the loop
about what the current behavior is, and that gets us right back into the
same mess.

Basically I think that Peter is arguing that autocommit as a GUC
variable is a wrong and dangerous idea. And I'm forced to agree.
I was wrong to put it in, and I'm now willing to take it out again.
At the time it seemed like a reasonable shortcut around changing the
protocol --- but now that we're changing the protocol anyway, it's
better to get rid of the shortcut.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 2003-03-21 21:06:31 [Fwd: Bug#184566: security threat to postgresql applications]
Previous Message Bruce Momjian 2003-03-21 18:06:24 Re: [INTERFACES] Roadmap for FE/BE protocol redesign

Browse pgsql-interfaces by date

  From Date Subject
Next Message ff 2003-03-21 19:53:45 persistent variables between cross-calls in C functions
Previous Message Bruce Momjian 2003-03-21 18:06:24 Re: [INTERFACES] Roadmap for FE/BE protocol redesign