472,347 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,347 software developers and data experts.

alter table cascade does not give notice about dropped indexes


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
3 2136
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lannsjo | last post by:
I need to change my primary key column type from smallint to int. I have tried: ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL...
1
by: Matik | last post by:
Hello, I need to change collation in my database (more databases acctualy). Therefore, I wanted to make a script, which will do it at one more...
4
by: serge | last post by:
I ran into a table that is used a lot. Well less than 100,000 records. Maybe not a lot of records but i believe this table is used often. The table...
1
by: Jon Earle | last post by:
Hi, Had a problem with PsotgreSQL v7.3.4. I had a table that, after a while, decided to give me a fit: db=> insert into blocklist values...
7
by: robert | last post by:
i need to update a column which is a member of the PK on this table. there are some thousands of rows to be updated, many more thousand already in...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not...
1
by: Jens | last post by:
Hi, Does anyone know if it is possible to alter an access table through ODBC. I am using the following SQL statement to add a foreign key to a...
8
by: rcamarda | last post by:
I thought I would delve into index fragmentation and I found some great sql from many posters (thanks Erland!). My question is how bad is bad? I...
3
by: Rahul B | last post by:
Hi, I have a user UCLDEV1 which is a part of staff and a group(db2schemagrp1) to which i have not given any permissions. The authorizations of...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.