ALTER COLUMN, trading a DOMAIN for its base datatype

From: C GG <cgg0007(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: ALTER COLUMN, trading a DOMAIN for its base datatype
Date: 2017-07-19 20:17:37
Message-ID: CAJXW-z87Mc9RHrpnOGeVB=tAoEVgoxrbTfe_LHZkxT7-gd=OTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm (still) trying to transition out from under the uniqueidentifier
contrib module to the native uuid datatype. I seem to be able to create a
domain for uniqueidentifier:

CREATE DOMAIN public.uniqueidentifier AS uuid;

and then use pg_restore to reload my data without the contrib module.

I'd like for my final step to be to

ALTER TABLE foo ALTER COLUMN my_uuid TYPE uuid;

... Is PostgreSQL smart enough to not have to rewrite the table and simply
shed the domain for the underlying datatype?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-07-19 20:28:34 Re: ALTER COLUMN, trading a DOMAIN for its base datatype
Previous Message David G. Johnston 2017-07-19 19:21:54 Re: ~/.psqlrc file is ignored