pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: ERROR: no NOT NULL constraint found to drop
Date: Wed, 12 Apr 2023 09:31:51 +0900
Message-ID: <ZDX79xxrpmbDo5vx@paquier.xyz> (raw)
In-Reply-To: <4031605.1681134419@sss.pgh.pa.us>
References: <CAMbWs48astPDb3K+L89wb8Yju0jM_Czm8svmU=Uzd+WM61Cr6Q@mail.gmail.com>
	<ZDPA8BJ4YgZymdoY@paquier.xyz>
	<4031605.1681134419@sss.pgh.pa.us>

On Mon, Apr 10, 2023 at 09:46:59AM -0400, Tom Lane wrote:
> It's still good to know about it for next time.  The issue I guess is
> that LIKE with no options propagates column attnotnull bits, but not
> constraints, so we now have an inconsistency: t2.c has attnotnull set
> but there is nothing in pg_constraint to justify it.  It seems to me
> we're going to have to think about what we want to happen in this
> case.  In a green field we'd probably not propagate NOT NULL unless
> told to copy constraints ... but is it okay to break functional
> compatibility with the old behavior?

I am not sure about that, TBH, though I would tend to not break
compatibility just for the sake of breaking it.  Anyway, shouldn't we
have a test that does a DROP NOT NULL after a LIKE copies it?  At
least, we'll be able to track that.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (4+ messages)

Message-ID: <ZDX79xxrpmbDo5vx@paquier.xyz>
Permalink:  ../ZDX79xxrpmbDo5vx@paquier.xyz/
Also on:    postgresql.org/message-id/ZDX79xxrpmbDo5vx@paquier.xyz

 · 

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-bugs@postgresql.org
  Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, guofenglinux@gmail.com, alvherre@alvh.no-ip.org, pgsql-bugs@lists.postgresql.org
  Subject: Re: ERROR: no NOT NULL constraint found to drop
  In-Reply-To: <ZDX79xxrpmbDo5vx@paquier.xyz>

* 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