pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Allowing ALTER TYPE to change storage strategy
Date: Fri, 28 Feb 2020 20:35:33 -0500
Message-ID: <9226.1582940133@sss.pgh.pa.us> (raw)
In-Reply-To: <20200229012511.7h23frunvvxwai7q@development>
References: <20200228004440.b23ein4qvmxnlpht@development>
	<4872.1582916389@sss.pgh.pa.us>
	<20200229012511.7h23frunvvxwai7q@development>

Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> I think we might check if there are any attributes with the given data
> type, and allow the change if there are none. That would still allow the
> change when the type is used only for things like function parameters
> etc. But we'd also have to check for domains (recursively).

Still has race conditions.

> One thing I haven't mentioned in the original message is CASCADE. It
> seems useful to optionally change storage for all attributes with the
> given data type. But I'm not sure it's actually a good idea, and the
> amount of code seems non-trivial (it'd have to copy quite a bit of code
> from ALTER TABLE).

You'd need a moderately strong lock on each such table, which means
there'd be serious deadlock hazards.  I'm dubious that it's worth
troubling with.

			regards, tom lane





view thread (20+ messages)  latest in thread

Message-ID: <9226.1582940133@sss.pgh.pa.us>
Permalink:  ../9226.1582940133@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9226.1582940133@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com
  Subject: Re: Allowing ALTER TYPE to change storage strategy
  In-Reply-To: <9226.1582940133@sss.pgh.pa.us>
  References: <20200228004440.b23ein4qvmxnlpht@development> <4872.1582916389@sss.pgh.pa.us> <20200229012511.7h23frunvvxwai7q@development> <9226.1582940133@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