pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: r.zharkov@postgrespro.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17465: Wrong error message while trying to change system column type.
Date: Mon, 18 Apr 2022 11:36:51 -0400
Message-ID: <2283491.1650296211@sss.pgh.pa.us> (raw)
In-Reply-To: <17465-f2a554a6cb5740d3@postgresql.org>
References: <17465-f2a554a6cb5740d3@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> accidentally I tried to change a system column data type on Windows and got
> a strange error message "no owned sequence found":

> postgres=# alter table t1 alter column cmin type text;
> ERROR:  no owned sequence found
> postgres=# alter table t1 alter column cmax type text;
> ERROR:  cannot alter system column "cmax"

Yeah, same here.

> I think the ATParseTransformCmd() function needs the same check as the check
> in the ATPrepAlterColumnType() function.

That seems pretty duplicative.  I think it's sufficient to do something
like

-                    if (TupleDescAttr(tupdesc, attnum - 1)->attidentity)
+                    if (attnum > 0 &&
+                        TupleDescAttr(tupdesc, attnum - 1)->attidentity)

in the faulty code, and let the actual error message come out where
it does now.

Will fix, thanks for the report!

			regards, tom lane





view thread (2+ messages)

Message-ID: <2283491.1650296211@sss.pgh.pa.us>
Permalink:  ../2283491.1650296211@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2283491.1650296211@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, r.zharkov@postgrespro.ru, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17465: Wrong error message while trying to change system column type.
  In-Reply-To: <2283491.1650296211@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