Re: pgsql: Add a non-strict version of jsonb_set

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Add a non-strict version of jsonb_set
Date: 2020-01-19 17:35:45
Message-ID: 20200119173545.GA30971@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Fri, Jan 17, 2020 at 06:41:02PM -0500, Tom Lane wrote:
> Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> writes:
> >> On Jan 17, 2020, at 12:44 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> Shoulda been a catversion bump in here, if only for protocol's sake.
>
> > I'd love to have a git pre-commit hook that would warn about this, it
> > seems to happen several times a year, and I know I've transgressed
> > more than once. Not sure what the rules should be, something like if
> > you changed src/include/catalog/* but not
> > src/include/catalog/catversion.h ?
>
> Meh. I think that would lead to forced catversion bumps even when
> not necessary (ex: when just correcting description strings).
> The cure could easily be worse than the disease.
>
> In reality, the only reason for repeated catversion bumps during
> development is to warn fellow developers that they have to do
> an initdb after a git pull. That's certainly a valuable courtesy,
> but the sky generally isn't going to fall if you forget.
>
> I'd be okay with a hook that there was a way to override ("yes,
> I know what I'm doing, this doesn't require a catversion change").
> But there's no way to do that is there?

I'm pretty sure there is. The program called by the commit hook can
prompt the user for input. Something that says

Are you sure you want to push this without a catalog bump? (N/y)

with the corresponding machinery for defaults would do it.

Best,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-01-19 17:46:19 Re: pgsql: Add a non-strict version of jsonb_set
Previous Message Heikki Linnakangas 2020-01-19 11:57:02 pgsql: Remove separate files for the initial contents of pg_(sh)descrip