ALTER TABLE error - Could not read block 0 - Mailing list pgsql-bugs

From Robins Tharakan
Subject ALTER TABLE error - Could not read block 0
Date
Msg-id CAEP4nAzLjxr+OTAZagJMm29wda_Yk5UzT-vpOrohq4pmMsg3DQ@mail.gmail.com
Whole thread Raw
List pgsql-bugs
Hi,

While testing SQLSmith, I see that executing the following SQL on the regression database gives an unexpected error. It doesn't crash the engine, nonetheless I thought reporting it doesn't hurt (This tool is new to me, so do let me know if I am doing something wrong here).

Steps to reproduce:
==================

ubuntu@laptop:$ git log | head -3
commit 77c1537f512e6ac2513f8695c795dc94cbf207ee
Author: Michael Paquier <michael@paquier.xyz>
Date:   Mon Aug 24 16:46:52 2020 +0900
ubuntu@laptop:$ dropdb --if-exists tempdel && createdb tempdel
ubuntu@laptop:$ ./pg_regress --use-existing --schedule=serial_schedule --dbname=tempdel >/dev/null
ubuntu@laptop:$ psql -c "SELECT version();" postgres
                                                version
--------------------------------------------------------------------------------------------------------
 PostgreSQL 14devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
(1 row)

ubuntu@laptop:$ psql -c "ALTER TABLE ONLY public.pline ALTER COLUMN slotname SET DATA TYPE TEXT USING cast(null as bpchar), ALTER COLUMN comment SET DATA TYPE TEXT USING public.pslot_backlink_view(cast(public.pline.backlink as bpchar));" tempdel
ERROR:  could not read block 0 in file "base/13550023/13569741": read only 0 of 8192 bytes
CONTEXT:  SQL statement "select * from PLine where slotname = "outer".rec.backlink"
PL/pgSQL function pslot_backlink_view(character) line 20 at SQL statement

-
robins tharakan

pgsql-bugs by date:

Previous
From: Mukesh Chhatani
Date:
Subject: Re: Logical replication stalling for large tables with heavy write activity - Pg11
Next
From: Robins Tharakan
Date:
Subject: ALTER TABLE ALTER COLUMN SET TYPE crash