473,379 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 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 2245
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 AUTO_INCREMENT; But get an error message certainly since my...
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 time. I already have a cursor, updating...
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 has 26 fields, 9 indexes but no Primary Key at...
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 ('2', 'km4n7s28ehiFizeYupm93Q', '1','2','3'); ERROR:...
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 the table. so, i get a constraint violation...
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 null references other, FK_ANOTHEROID 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 table. Access returns an error like "Syntax error...
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 know this is very subjective. Some scripts I found...
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 that user are shown as db2 =get authorizations...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.