pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Allowing ALTER TYPE to change storage strategy
Date: Sat, 29 Feb 2020 22:37:14 +0100
Message-ID: <20200229213714.7osohwlvup24ugd2@development> (raw)
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>

On Fri, Feb 28, 2020 at 08:35:33PM -0500, Tom Lane wrote:
>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.
>

Yeah, I have no problem believing that.

>> 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.
>

Yeah, I don't plan to do this in v1 (and I have no immediate plan to
work on it after that). But I wonder how is the deadlock risk any
different compared e.g. to DROP TYPE ... CASCADE?

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (20+ messages)  latest in thread

Message-ID: <20200229213714.7osohwlvup24ugd2@development>
Permalink:  ../20200229213714.7osohwlvup24ugd2@development/
Also on:    postgresql.org/message-id/20200229213714.7osohwlvup24ugd2@development

 · 

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

* 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