[GRNERAL] drop domain xx cascade - Mailing list pgsql-general

From hx.li
Subject [GRNERAL] drop domain xx cascade
Date
Msg-id hjomu2$m9b$1@news.hub.org
Whole thread Raw
List 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





pgsql-general by date:

Previous
From: Jayadevan M
Date:
Subject: Re: general questions postgresql performance config
Next
From: Pavel Stehule
Date:
Subject: Re: dynamic crosstab