Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rblyb-00Gv07-12 for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Feb 2024 18:33:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rblyZ-00Ao2j-LC for pgsql-hackers@arkaria.postgresql.org; Sun, 18 Feb 2024 18:33:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rblyZ-00Ao2a-49 for pgsql-hackers@lists.postgresql.org; Sun, 18 Feb 2024 18:33:19 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rblyR-007P0K-6Y for pgsql-hackers@postgresql.org; Sun, 18 Feb 2024 18:33:17 +0000 Received: from [10.4.12.143] (unknown [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.rybakina@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 4CB61E20DC1 for ; Sun, 18 Feb 2024 21:33:07 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1708281187; bh=0aRtxoSzJfAsjAupE7NxxC4tejc10XnIb+0kmbWOb58=; h=Message-ID:Date:User-Agent:To:From:Subject:From; b=cUNF+Ih5RcipqKnQSsdhIOdWqtZlswKnMxV1pTmQn8pxGjbwJaJs8+OPXmaACfq0M t1SCrBRo1abTBwWabhEtU+LLRDZdY6fAaU3P0tBsw3mYJzzd7ZtuQu8VETYq2DBHE3 8ld2l6bCh3MxCgEFRsN6dpK9WjbUHm+afidNg/PI2NASG0gPr+Rfo0mDEwmvmv9U72 C+JorTC2APeF2DboFArK1X8QiDVQbWwlnFexdw3VO6GiLdq5R8JxYv5GFCrubpp3aA tpRWEHH11KPUw+BAQSZ3F8JXTreNrbSrhxhtB0/F9MuDH3T/qDH96JQ6IYUYFCcgu7 JDC/I40Yy5+Og== Message-ID: <4d65a385-7efa-4436-a825-0869f89d9d92@postgrespro.ru> Date: Sun, 18 Feb 2024 21:33:07 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Pgsql Hackers From: Alena Rybakina Subject: Running the fdw test from the terminal crashes into the core-dump Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, hackers! After starting the server (initdb + pg_ctl start) I ran a regress test create_misc.sql ('\i src/test/regress/sql/create_misc.sql') and, after that, I ran the fdw test ('\i contrib/postgres_fdw/sql/postgres_fdw.sql') in the psql, and it failed in the core-dump due to the worked assert. To be honest, such a failure occurred only if the fdw extension was not installed earlier. script to reproduce the error: ./configure CFLAGS='-g -ggdb -O0' --enable-debug --enable-cassert --prefix=`pwd`/tmp_install && make -j8 -s install export CDIR=$(pwd) export PGDATA=$CDIR/postgres_data rm -r $PGDATA mkdir $PGDATA ${CDIR}/tmp_install/bin/initdb -D $PGDATA >> log.txt ${CDIR}/tmp_install/bin/pg_ctl -D $PGDATA -l logfile start ${CDIR}/tmp_install/bin/psql -d postgres -f src/test/regress/sql/create_misc.sql && ${CDIR}/tmp_install/bin/psql -d postgres -f contrib/postgres_fdw/sql/postgres_fdw.sql The query, where the problem is: -- MERGE ought to fail cleanly merge into itrtest using (select 1, 'foo') as source on (true)   when matched then do nothing; Coredump: #5  0x0000555d1451f483 in ExceptionalCondition (conditionName=0x555d146bba13 "requiredPerms != 0", fileName=0x555d146bb7b0 "execMain.c",     lineNumber=654) at assert.c:66 #6  0x0000555d14064ebe in ExecCheckOneRelPerms (perminfo=0x555d1565ef90) at execMain.c:654 #7  0x0000555d14064d94 in ExecCheckPermissions (rangeTable=0x555d1565eef0, rteperminfos=0x555d1565efe0, ereport_on_violation=true) at execMain.c:623 #8  0x0000555d140652ca in InitPlan (queryDesc=0x555d156cde50, eflags=0) at execMain.c:850 #9  0x0000555d140644a8 in standard_ExecutorStart (queryDesc=0x555d156cde50, eflags=0) at execMain.c:266 #10 0x0000555d140641ec in ExecutorStart (queryDesc=0x555d156cde50, eflags=0) at execMain.c:145 #11 0x0000555d1432c025 in ProcessQuery (plan=0x555d1565f3e0,     sourceText=0x555d1551b020 "merge into itrtest using (select 1, 'foo') as source on (true)\n  when matched then do nothing;", params=0x0,     queryEnv=0x0, dest=0x555d1565f540, qc=0x7fffc9454080) at pquery.c:155 #12 0x0000555d1432dbd8 in PortalRunMulti (portal=0x555d15597ef0, isTopLevel=true, setHoldSnapshot=false, dest=0x555d1565f540, altdest=0x555d1565f540,     qc=0x7fffc9454080) at pquery.c:1277 #13 0x0000555d1432d0cf in PortalRun (portal=0x555d15597ef0, count=9223372036854775807, isTopLevel=true, run_once=true, dest=0x555d1565f540,     altdest=0x555d1565f540, qc=0x7fffc9454080) at pquery.c:791 #14 0x0000555d14325ec8 in exec_simple_query ( --Type for more, q to quit, c to continue without paging--     query_string=0x555d1551b020 "merge into itrtest using (select 1, 'foo') as source on (true)\n  when matched then do nothing;") at postgres.c:1273 #15 0x0000555d1432ae4c in PostgresMain (dbname=0x555d15555ab0 "aaa", username=0x555d15555a98 "alena") at postgres.c:4645 #16 0x0000555d14244a5d in BackendRun (port=0x555d1554b3b0) at postmaster.c:4440 #17 0x0000555d14244072 in BackendStartup (port=0x555d1554b3b0) at postmaster.c:4116 #18 0x0000555d142405c5 in ServerLoop () at postmaster.c:1768 #19 0x0000555d1423fec2 in PostmasterMain (argc=3, argv=0x555d1547fcf0) at postmaster.c:1467 #20 0x0000555d140f3122 in main (argc=3, argv=0x555d1547fcf0) at main.c:198 This error is consistently reproduced. To be honest, I wasn't able to fully figure out the reason for this, but it seems that this operation on partitions should not be available at all? alena@postgres=# SELECT relname, relkind FROM pg_class where relname='itrtest';  relname | relkind ---------+---------  itrtest | p (1 row) -- Regards, Alena Rybakina Postgres Professional: http://www.postgrespro.com The Russian Postgres Company