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:01:33
Message-ID: CAKFQuwa4__dKp7p9SjE-gf+ZmPbqs2MNOz9UcA-4o2xPsR17Tg@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:
>
> <domain definition> ::=
> CREATE DOMAIN <domain name> [ AS ] <predefined type>
> [ <default clause> ]
> [ <domain constraint>... ]
> [ <collate clause> ]
>
> While SQL does also have a CREATE TYPE command, domains are not
> among the kinds of type it can make. So that separation is
> very much per spec.
>
>
> I don't personally find the doc changes proposed here to be a good idea.
> 001 seems to add a lot of verbosity and not much else.

The intent is to add accuracy, which means verbosity given the non-obvious
choice made in the current implementation.

> 002 invents terms
> used nowhere else in our docs, which seems more confusing than anything
> else.

Fair point - was hoping it would be discussion starter.

It is very badly in need of copy-editing, as well.
>

I'll look at it with fresh eyes...

Also, I think the phrase you are looking for might be "type category".
>

Actually what I want is "Type type (typtype)" according to pg_type but that
seemed like an implementation detail that would be undesirable to use here
so I tried to give it a different name. Type category (typcategory)
already has a meaning.

Using "type definition" to mean that seems completely wrong. Deciding
> that capitalized Type means something special is something I might expect
> to find in one of the more abstruse philosophers, but it's not a great
> idea in the Postgres manual ... especially when you then use different
> terminology elsewhere.
>

I very well may have been inconsistent but coupled with the above point
"type of the Type" seems easier to follow compared to "type of the type" if
I were to change "type definition" to "type of the Type".

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-09-17 00:03:34 Re: pgindent vs dtrace on macos
Previous Message Tom Lane 2020-09-16 23:55:17 Re: pgindent vs dtrace on macos