Re: DROP relation IF EXISTS Docs and Tests - Bug Fix

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: DROP relation IF EXISTS Docs and Tests - Bug Fix
Date: 2020-09-17 00:12:29
Message-ID: CAKFQuwYb+_q+=B63YwdP0w9V2Gt8t3mgakUuNRn8vY8saX06Bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 16, 2020 at 4:42 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > My main point here is that writing "CREATE TYPE typename AS DOMAIN" would
> > be expected, with the appropriate sub-specification, similar to "CREATE
> > TYPE typename AS RANGE".
>
> Well, that point seems entirely invented. CREATE DOMAIN is in the
> SQL standard:
>

And I'm writing for the user who sees that both "CREATE DOMAIN" and "CREATE
TYPE AS RANGE" exist, and that there is no "CREATE RANGE", and wonders why
if domains are simply a variant of a type, like ranges are, why doesn't
CREATE TYPE just create those as well - or, rather, are there any material
differences. I choose to include an observation that, no, they are not
materially different in terms of being abstract types.

It struck me as odd that it wasn't just CREATE TYPE AS DOMAIN and so in my
patch I thought to comment upon the oddity - and in doing so emphasize that
the DROP behavior for DOMAINS is no different than the types created by the
CREATE TYPE command.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-09-17 00:19:26 Re: Gripes about walsender command processing
Previous Message Alvaro Herrera 2020-09-17 00:03:34 Re: pgindent vs dtrace on macos