pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: Amul Sul <sulamul@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
Date: Tue, 11 Mar 2025 09:26:43 +0100
Message-ID: <202503110826.ttskpa5mokuu@alvherre.pgsql> (raw)
In-Reply-To: <CAAJ_b94QgbscAETvo7Dgq7BtCyLRSd0QLS9TRjruomVDUjJo+g@mail.gmail.com>

On 2025-Mar-11, Amul Sul wrote:

> On Mon, Mar 10, 2025 at 11:29 PM Álvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> > I fleshed this out more fully and I think 0001 is good enough to commit.
> 
> The approach looks good to me, but instead of adding a CAS_flags struct, could
> we use macros like SEEN_DEFERRABILITY(bits), SEEN_ENFORCEABILITY(bits),
> etc.? We can simply pass cas_bits to these macros, and to avoid the error
> from processCASbits(), we can pass NULL for constrType.

Ah yeah, I thought of this too at first, but didn't actually code it
because I thought it'd be messier.  Trying to do it naively doesn't
work, because it's not enough to test whether each bit is true or false
-- what you need to know is whether an option was specified for each
bit, in either direction.  So we'd need a separate bitmask, we can't
pass the existing 'bits' mask.  And at that point, it's not any better
to have a bitmask, and a stack-allocated struct of booleans is just
easier to write.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Los dioses no protegen a los insensatos.  Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)





view thread (14+ messages)  latest in thread

Message-ID: <202503110826.ttskpa5mokuu@alvherre.pgsql>
Permalink:  ../202503110826.ttskpa5mokuu@alvherre.pgsql/
Also on:    postgresql.org/message-id/202503110826.ttskpa5mokuu@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, sulamul@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org, peter@eisentraut.org, nathandbossart@gmail.com
  Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
  In-Reply-To: <202503110826.ttskpa5mokuu@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox