[GRNERAL] drop domain xx cascade

From: "hx(dot)li" <fly2nn(at)126(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: [GRNERAL] drop domain xx cascade
Date: 2010-01-27 06:36:43
Message-ID: hjomu2$m9b$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,

I test it as follow:
--------------------
TEST=# select version();
version
-------------------------------------------------------------
PostgreSQL 8.4.1, compiled by Visual C++ build 1400, 32-bit
(1 row)

TEST=# CREATE DOMAIN MY_DOMAIN AS DECIMAL (5, 2);
CREATE DOMAIN
TEST=# CREATE TABLE TT(tt_c MY_DOMAIN);
CREATE TABLE
TEST=# \d TT
Table "public.tt"
Column | Type | Modifiers
--------+-----------+-----------
tt_c | my_domain |

TEST=# CREATE VIEW V_TT AS SELECT * FROM TT;
CREATE VIEW
TEST=# \d V_TT
View "public.v_tt"
Column | Type | Modifiers
--------+-----------+-----------
tt_c | my_domain |
View definition:
SELECT tt.tt_c
FROM tt;

TEST=# DROP DOMAIN MY_DOMAIN CASCADE;
NOTICE: drop cascades to 3 other objects
DETAIL: drop cascades to table tt column tt_c
drop cascades to view v_tt
drop cascades to view v_tt column tt_c
DROP DOMAIN
TEST=# \d TT
Table "public.tt"
Column | Type | Modifiers
--------+------+-----------

-----------------------------------------------------------------

But, SQL standard(sql92 or sql2008) said:
---------------
Let C be any column descriptor that includes DN, let T be the table
described by the table descriptor that includes C, and let TN be the table
name of T. C is modified as follows:
a) DN is removed from C. A copy of the data type descriptor of D is included
in C.
b) If C does not include a <default clause> and the domain descriptor of D
includes a <default clause>,then a copy of the <default clause> of D is
included in C.

My question is: When run "DROP DOMAIN MY_DOMAIN CASCADE", if Whether
postgresql will permit from the SQL standard ?

So, I expect the result is (after drop domain):
---------------------------------
TEST=# \d TT
Table "public.TT"
Column | Type | Modifiers
--------+--------------+-----------
tt_c | numeric(5,2) |

Any help is appreciated!
Hx.li

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2010-01-27 07:13:28 Re: dynamic crosstab
Previous Message Jayadevan M 2010-01-27 06:04:37 Re: general questions postgresql performance config