Hello,
On 2025-Jan-15, jian he wrote:
> we cannot error out AlterDomainAddConstraint for cases like ALTER
> DOMAIN ADD CHECK NO INHERIT.
> because "NO INHERIT" is actually a separate Constraint Node, and
> AlterDomainAddConstraint
> can only handle one Constraint node.
I had forgotten this threa
I have committed the part of this patch that removes the switch
statement in AlterDomainAddConstraint(). That one is dead code.
I'll study the other discussion a bit more. I agree the current code
isn't satisfactory.
On Wed, Jan 15, 2025 at 12:37 AM Alvaro Herrera wrote:
>
> Hello,
>
> On 2024-Dec-09, jian he wrote:
>
> > ALTER DOMAIN ADD CONSTRAINT syntax more simple than CREATE DOMAIN.
>
> Your proposed patch makes the code simpler, yes, but I think it also
> makes the error messages worse. I don't think th
Hello,
On 2024-Dec-09, jian he wrote:
> ALTER DOMAIN ADD CONSTRAINT syntax more simple than CREATE DOMAIN.
Your proposed patch makes the code simpler, yes, but I think it also
makes the error messages worse. I don't think that's an improvement
from the user point of view.
--
Álvaro Herrera
hi.
ALTER DOMAIN ADD CONSTRAINT syntax more simple than CREATE DOMAIN.
So in gram.y, I changed DomainConstraintElem to the following:
DomainConstraintElem:
CHECK '(' a_expr ')'
{
Constraint *n = makeNode(Constraint);
n->contype =
On Fri, Dec 6, 2024 at 10:48 PM Alvaro Herrera wrote:
>
> On 2024-Dec-06, jian he wrote:
>
> > basically processCASbits
> > from
> > processCASbits($3, @3, "NOT NULL")
> > processCASbits($5, @5, "CHECK")
> > to
> > processCASbits($3, @3, "DOMAIN with NOT NULL")
> > processCASbits($5, @5, "DOMAIN w
On 2024-Dec-06, jian he wrote:
> basically processCASbits
> from
> processCASbits($3, @3, "NOT NULL")
> processCASbits($5, @5, "CHECK")
> to
> processCASbits($3, @3, "DOMAIN with NOT NULL")
> processCASbits($5, @5, "DOMAIN with CHECK")
This doesn't actually work from a translation point of view,
hi.
attached patch refactor AlterDomainAddConstraint
* change the error message:
alter domain d_int add constraint nn not null no inherit;
from
ERROR: NOT NULL constraints cannot be marked NO INHERIT
to
ERROR: DOMAIN with NOT NULL constraints cannot be marked NO INHERIT
basically processCASbits