Re: POLA violation with \c service=

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: POLA violation with \c service=
Дата
Msg-id 20150302222848.GH3291@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: POLA violation with \c service=  (David Fetter <david@fetter.org>)
Список pgsql-hackers
David Fetter wrote:
> On Mon, Mar 02, 2015 at 04:52:37PM -0500, Robert Haas wrote:
> > On Mon, Feb 23, 2015 at 3:56 PM, Alvaro Herrera
> > <alvherre@2ndquadrant.com> wrote:
> > > David Fetter wrote:
> > >
> > >> My thinking behind this was that the patch is a bug fix and intended
> > >> to be back-patched, so I wanted to mess with as little infrastructure
> > >> as possible.  A new version of libpq seems like a very big ask for
> > >> such a case.  You'll recall that the original problem was that
> > >>
> > >>     \c service=foo
> > >>
> > >> only worked accidentally for some pretty narrow use cases and broke
> > >> without much of a clue for the rest.  It turned out that the general
> > >> problem was that options given to psql on the command line were not
> > >> even remotely equivalent to \c, even though they were documented to
> > >> be.
> > >
> > > So, in view of these arguments and those put forward by Pavel
> > > downthread, I think the attached is an acceptable patch for the master
> > > branch.  It doesn't apply to back branches though; 9.4 and 9.3 have a
> > > conflict in tab-complete.c, 9.2 has additional conflicts in command.c,
> > > and 9.1 and 9.0 are problematic all over because they don't have
> > > src/common.  Could you please submit patches adapted for each group of
> > > branches?
> > 
> > I'm fine with this change in master, but I vote against back-patching
> > it.  This is not such an important problem that we need to take the
> > risk of destabilizing existing installations.
> 
> So just to clarify, are you against back-patching the behavior change,
> or the addition to src/common?

Not sure I agree with that.  Currently \c is pretty useless with
services and URIs.

(The recently introduced behavior that it "forgets" the old connection
info when the connection is lost, for example the server crashes, is
pretty unhelpful too.)

> > (Also, src/common is only 2 years old, so how would we back-patch
> > anything touching that past 9.3 anyway?)
> 
> I was hacking something together to add it.  Should I stop?

I think I wasn't very clear.  What I was trying to say was that for all
branches that have src/common we should put the duplicated functions
there, and for older branches we'd just accept the duplication.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Bootstrap DATA is a pita
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: plpgsql versus domains