pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tender Wang <tndrwang@gmail.com>
Cc: Euler Taveira <euler@eulerto.com>
Cc: tharakan@gmail.com, pgsql-bugs@lists.postgresql.org, Heikki Linnakangas <hlinnaka@iki.fi>
Subject: Re: BUG #18866: Running pg_freespace() on views triggers an Abort
Date: Thu, 27 Mar 2025 12:01:13 -0400
Message-ID: <2052347.1743091273@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMbWs49YbHiBZe-H3yOB0tN2FJDU5Y7Ed2VQ=G=iB_yqByHBkw@mail.gmail.com>
References: <18866-d68926d0f1c72d44@postgresql.org>
	<CAHewXNk6uX0VBROmoMrnKs_AOzbAQo+i9pouUiYj01y50HZRSw@mail.gmail.com>
	<1280897.1742920635@sss.pgh.pa.us>
	<CAHewXNm8rkn9Vu-WhmMQMJS2hSqztbJO1cRv5-+Rp99+k43aJw@mail.gmail.com>
	<b6ea023a-703d-4afa-8561-9e867db1b5f0@app.fastmail.com>
	<1618267.1743004859@sss.pgh.pa.us>
	<CAHewXNkND-jyFhxShh8Zf6ZNZ41V6skiAp_nwNrOBX25Gd02ig@mail.gmail.com>
	<CAMbWs49YbHiBZe-H3yOB0tN2FJDU5Y7Ed2VQ=G=iB_yqByHBkw@mail.gmail.com>

Richard Guo <guofenglinux@gmail.com> writes:
> Not related to this issue but I wonder why blkno is verified after
> the relation is opened.  It can be verified beforehand, no?

It makes sense to me to check the parameters left-to-right, so
I think verifying blkno after relation is fine.  It's not like
there's value in optimizing the failure case.

This does, however, suggest that we ought to check the relkind
immediately after opening the rel, before the blkno check.
I'll adjust the patch that way and push.

			regards, tom lane





view thread (14+ messages)  latest in thread

Message-ID: <2052347.1743091273@sss.pgh.pa.us>
Permalink:  ../2052347.1743091273@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2052347.1743091273@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, guofenglinux@gmail.com, tndrwang@gmail.com, euler@eulerto.com, hlinnaka@iki.fi
  Subject: Re: BUG #18866: Running pg_freespace() on views triggers an Abort
  In-Reply-To: <2052347.1743091273@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