Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Soumyadeep Chakraborty <soumyadeep2007(at)gmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, pgsql-hackers(at)postgresql(dot)org, Ashwin Agrawal <ashwinstar(at)gmail(dot)com>, vanjared(at)vmware(dot)com, Alexander Lakhin <exclusion(at)gmail(dot)com>
Subject: Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
Date: 2024-03-28 15:58:31
Message-ID: 202403281558.xk5pgf7ur3dq@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-Mar-26, Justin Pryzby wrote:

> Looks right. That's how I originally wrote it, except for the
> "stmt->accessMethod != NULL" case.
>
> I prefered my way - the grammar should refuse to set stmt->accessMethod
> for inappropriate relkinds. And you could assert that.

Hmm, I didn't like this at first sight, because it looked convoluted and
baroque, but I compared both versions for a while and I ended up liking
yours more than mine, so I adopted it.

> I also prefered to set "accessMethodId = InvalidOid" once, rather than
> twice.

Grumble. I don't like initialization at declare time, so far from the
code that depends on the value. But the alternative would have been to
assign right where this blocks starts, an additional line. I pushed it
like you had it.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"This is what I like so much about PostgreSQL. Most of the surprises
are of the "oh wow! That's cool" Not the "oh shit!" kind. :)"
Scott Marlowe, http://archives.postgresql.org/pgsql-admin/2008-10/msg00152.php

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-03-28 15:59:21 Re: [PATCH] plpython function causes server panic
Previous Message Tom Lane 2024-03-28 15:50:30 Re: [PATCH] plpython function causes server panic