Обсуждение: Drop Cascade of Domains

Поиск
Список
Период
Сортировка

Drop Cascade of Domains

От
elein
Дата:
I have a table which contains three
columns of domain X.

If I drop the domain X with cascade,
the table remains with no columns.

Is this the proper behaviour?

It seems to me that any action which
results in an invalid object should be
forbidden.  On the other hand, with
alter table working well, I am loathe
to argue a table with no columns is
an invalid argument.

Is there a previous rule on this issue?

--elein

============================================================
elein@varlena.com        Varlena, LLC        www.varlena.com

          PostgreSQL Consulting, Support & Training

PostgreSQL General Bits   http://www.varlena.com/GeneralBits/
=============================================================
"Free your mind the rest will follow" -- En Vogue

Re: Drop Cascade of Domains

От
Peter Eisentraut
Дата:
elein writes:

> It seems to me that any action which
> results in an invalid object should be
> forbidden.  On the other hand, with
> alter table working well, I am loathe
> to argue a table with no columns is
> an invalid argument.

While not allowed according to the SQL standard, we have decided that
tables with zero columns are valid, and the behavior of all commands and
side effects has been aligned with that.

--
Peter Eisentraut   peter_e@gmx.net


Re: Drop Cascade of Domains

От
Tom Lane
Дата:
elein <elein@varlena.com> writes:
> I have a table which contains three
> columns of domain X.
> If I drop the domain X with cascade,
> the table remains with no columns.
> Is this the proper behaviour?

Yes, we agreed some time ago that that is the best thing to do.

            regards, tom lane