By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,334 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,334 IT Pros & Developers. It's quick & easy.

alter table cascade does not give notice about dropped indexes

P: n/a

Hi,

Looks like alter table does not tells about the indexes it dropped
PG version: 7.4.3

Regds
mallah.

tradein_clients=# \d general.membership_status
Table "general.membership_status"
+--------------------+-----------------------+------------------------+
| Column | Type | Modifiers |
+--------------------+-----------------------+------------------------+
| userid | integer | not null |
| profile_id | integer | not null |
| product_id | integer | not null |
| num_inq | integer | default 0 |
| listing | character varying(50) | |
| num_leads_featured | integer | default 0 |
| num_leads_pic | integer | default 0 |
| deleted | boolean | not null default false |
+--------------------+-----------------------+------------------------+
Indexes:
"user_profile_product_id" unique, btree (userid, profile_id,
product_id) WHERE (deleted IS FALSE)

tradein_clients=#
tradein_clients=# ALTER TABLE general.membership_status drop column
profile_id cascade;
NOTICE: drop cascades to rule _RETURN on view active_membership_status
NOTICE: drop cascades to view active_membership_status
ALTER TABLE
Time: 992.921 ms
tradein_clients=# \d general.membership_status
Table "general.membership_status"
+--------------------+-----------------------+------------------------+
| Column | Type | Modifiers |
+--------------------+-----------------------+------------------------+
| userid | integer | not null |
| product_id | integer | not null |
| num_inq | integer | default 0 |
| listing | character varying(50) | |
| num_leads_featured | integer | default 0 |
| num_leads_pic | integer | default 0 |
| deleted | boolean | not null default false |
+--------------------+-----------------------+------------------------+

tradein_clients=#
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Rajesh Kumar Mallah <ma****@trade-india.com> writes:
Looks like alter table does not tells about the indexes it dropped


This is intentional --- we don't require you to say CASCADE to get rid
of an index, either. I don't recall the exact reasoning anymore, but
if you consult the mailing list archives (probably from the 7.3 beta
period) you can find the discussions that led up to doing it that way.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2

P: n/a
Tom Lane wrote:
Rajesh Kumar Mallah <ma****@trade-india.com> writes:

Looks like alter table does not tells about the indexes it dropped
This is intentional --- we don't require you to say CASCADE to get rid
of an index, either.


I initailly ran the alter table without cascade option ,

it told me there is a dependent view.

I did cascade , it droped the view and it also dropped a
multicolumn index that contained the column.

I notified me about the dropped view but not about
the index.

Is that ok ?

Regds
Mallah.

I don't recall the exact reasoning anymore, but
if you consult the mailing list archives (probably from the 7.3 beta
period) you can find the discussions that led up to doing it that way.

regards, tom lane

--

regds
Mallah.

Rajesh Kumar Mallah
+---------------------------------------------------+
| Tradeindia.com (3,11,246) Registered Users |
| Indias' Leading B2B eMarketPlace |
| http://www.tradeindia.com/ |
+---------------------------------------------------+
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3

P: n/a
Rajesh Kumar Mallah wrote:
Tom Lane wrote:
Rajesh Kumar Mallah <ma****@trade-india.com> writes:

Looks like alter table does not tells about the indexes it dropped


This is intentional --- we don't require you to say CASCADE to get rid
of an index, either.


I initailly ran the alter table without cascade option ,

it told me there is a dependent view.

I did cascade , it droped the view and it also dropped a
multicolumn index that contained the column.

I notified me about the dropped view but not about
the index.

Is that ok ?


I think so. We consider the index to be bound to the table, while the
view is more distinct and could include other table references as well.

--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.