From: Tom Lane <tgl@sss.pgh.pa.us>
To: Japin Li <japinli@hotmail.com>
Cc: adrien.gilmore+pg@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17376: Adding unique column with a function() default results in "could not read block 0 in file" error
Date: Fri, 21 Jan 2022 12:36:44 -0500
Message-ID: <1196187.1642786604@sss.pgh.pa.us> (raw)
In-Reply-To: <MEYP282MB166905F8F98ED50AD619CB54B65B9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
References: <17376-07b867ccc817828f@postgresql.org>
<MEYP282MB166905F8F98ED50AD619CB54B65B9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
Japin Li <japinli@hotmail.com> writes:
> On Fri, 21 Jan 2022 at 17:22, PG Bug reporting form <noreply@postgresql.org> wrote:
>> The error message content returned is what I suspect of being a bug, not so
>> much that this SQL didn't work.
> +1. The error message makes user confused IMO, maybe we can fix it, but I have
> no idea for this. Any suggestion is welcomed.
Yeah. Ideally we'd throw an error along the lines of "can't access a
table that's in process of being altered". The SELECT inside the function
is not part of the ALTER TABLE machinery and ought to be locked out.
However, I fear we don't have adequate infrastructure to tell which
table accesses *are* part of the ALTER TABLE machinery and which aren't.
Maybe it'd be sufficient to check for an active ALTER TABLE in the
parser, but I'm not sure.
regards, tom lane
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: tgl@sss.pgh.pa.us, japinli@hotmail.com, adrien.gilmore+pg@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17376: Adding unique column with a function() default results in "could not read block 0 in file" error
In-Reply-To: <1196187.1642786604@sss.pgh.pa.us>
* 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