pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: feichanghong@qq.com
Subject: BUG #17879: ERROR:  unrecognized node type: 2139062143
Date: Thu, 30 Mar 2023 02:36:25 +0000
Message-ID: <17879-b7dfb5debee58ff5@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17879
Logged by:          Fei Changhong
Email address:      feichanghong@qq.com
PostgreSQL version: 15.2
Operating system:   CentOS7 with kernel version 5.10
Description:        

We have noticed that an error "ERROR: unrecognized node type:2139062143"
occurs when creating a table with a SEQUENCE column after an event trigger
of type ddl_command_end has already been created. This error can be
reproduced using the following SQL statement, and please note that the
"--enable-cassert" option must be included during configuration.
···
-- CREATE EVENT TRIGGER
CREATE TABLE mytable (id serial primary key, name text);
CREATE OR REPLACE FUNCTION log_ddl_commands() RETURNS event_trigger AS $$
DECLARE
	obj record;
BEGIN
	FOR obj IN SELECT * FROM pg_event_trigger_ddl_commands() WHERE command_tag
<> 'SELECT' LOOP
		RAISE NOTICE 'Command: % Object: %', obj.command_tag,
obj.object_identity;
	END LOOP;
END;
$$ LANGUAGE plpgsql;
CREATE EVENT TRIGGER ddl_log_trigger ON ddl_command_end EXECUTE FUNCTION
log_ddl_commands();
-- Create a table with a SEQUENCE column
CREATE TABLE mytable1(id INT GENERATED ALWAYS AS IDENTITY (SEQUENCE NAME
test_seq));
···

We have identified the root cause as follows: 
In the generateSerialExtraStmts function, the memory space for the seqoption
list has been freed, but the options member of the Constraint still points
to that memory address, which caused an error during the copyObject
operation in the EventTriggerCollectSimpleCommand function.



view thread (3+ messages)  latest in thread

Message-ID: <17879-b7dfb5debee58ff5@postgresql.org>
Permalink:  ../17879-b7dfb5debee58ff5@postgresql.org/
Also on:    postgresql.org/message-id/17879-b7dfb5debee58ff5@postgresql.org

 · 

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, feichanghong@qq.com
  Subject: Re: BUG #17879: ERROR:  unrecognized node type: 2139062143
  In-Reply-To: <17879-b7dfb5debee58ff5@postgresql.org>

* 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