Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints

Поиск
Список
Период
Сортировка
Искать
От
Nico Williams
Тема
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints
Дата
Msg-id
20180712005054.GD9712@localhost
Ответ на
Список
Дерево обсуждения
[HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
[HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Robbie Harwood <rharwood@redhat.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Robbie Harwood <rharwood@redhat.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Dmitry Dolgov <9erthalion6@gmail.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Andres Freund <andres@anarazel.de>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option forconstraints Andreas Joseph Krogh <andreas@visena.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Nico Williams <nico@cryptonector.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option for constraints Vik Fearing <vik.fearing@2ndquadrant.com>
Re: [HACKERS] [PATCH] WIP Add ALWAYS DEFERRED option forconstraints Andreas Joseph Krogh <andreas@visena.com>
On Wed, Jul 11, 2018 at 01:41:12PM -0500, Nico Williams wrote:
> > > @@ -5538,17 +5568,24 @@ ConstraintAttributeSpec:
> > >  					int		newspec = $1 | $2;
> > >  
> > >  					/* special message for this case */
> > > -					if ((newspec & (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED)) == (CAS_NOT_DEFERRABLE | CAS_INITIALLY_DEFERRED))
> > > +					if ((newspec & CAS_NOT_DEFERRABLE) &&
> > > +						(newspec & (CAS_INITIALLY_DEFERRED | CAS_ALWAYS_DEFERRED)))
> > >  						ereport(ERROR,
> > >  								(errcode(ERRCODE_SYNTAX_ERROR),
> > >  								 errmsg("constraint declared INITIALLY DEFERRED must be DEFERRABLE"),
> > >  								 parser_errposition(@2)));
> > >  					/* generic message for other conflicts */
> > > +					if ((newspec & CAS_ALWAYS_DEFERRED) &&
> > > +						(newspec & (CAS_INITIALLY_IMMEDIATE)))
> > > +						ereport(ERROR,
> > > +								(errcode(ERRCODE_SYNTAX_ERROR),
> > > +								 errmsg("conflicting constraint properties 1"),
> > > +								 parser_errposition(@2)));
> > >  					if ((newspec & (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE)) == (CAS_NOT_DEFERRABLE | CAS_DEFERRABLE) ||
> > >  						(newspec & (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED)) == (CAS_INITIALLY_IMMEDIATE | CAS_INITIALLY_DEFERRED))
> > >  						ereport(ERROR,
> > >  								(errcode(ERRCODE_SYNTAX_ERROR),
> > > -								 errmsg("conflicting constraint properties"),
> > > +								 errmsg("conflicting constraint properties 2"),
> > 
> > I'd prefer you just repeat the message (or make them more situationally
> > descriptive), rather than appending a number.  (Repeating error messages
> > is in keeping with the style here.)
> 
> Oy, I forgot about these.  The number was a bread crumb I forgot to
> cleanup :(  So sorry about that.

So, I'm tempted not to add new messages that will require translation,
leaving these as "conflicting constraint properties".

But I'm perfectly happy to make these more informative too if that's
desired.  I just don't know what the expectations are regarding message
catalog translation.  Any advice?

Nico
-- 

В списке pgsql-hackers по дате отправления
От: David Rowley
Дата:
От: Nico Williams
Дата:
FAQ