473,763 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.members hip_status
Table "general.member ship_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_featu red | integer | default 0 |
| num_leads_pic | integer | default 0 |
| deleted | boolean | not null default false |
+--------------------+-----------------------+------------------------+
Indexes:
"user_profile_p roduct_id" unique, btree (userid, profile_id,
product_id) WHERE (deleted IS FALSE)

tradein_clients =#
tradein_clients =# ALTER TABLE general.members hip_status drop column
profile_id cascade;
NOTICE: drop cascades to rule _RETURN on view active_membersh ip_status
NOTICE: drop cascades to view active_membersh ip_status
ALTER TABLE
Time: 992.921 ms
tradein_clients =# \d general.members hip_status
Table "general.member ship_status"
+--------------------+-----------------------+------------------------+
| Column | Type | Modifiers |
+--------------------+-----------------------+------------------------+
| userid | integer | not null |
| product_id | integer | not null |
| num_inq | integer | default 0 |
| listing | character varying(50) | |
| num_leads_featu red | 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 2288
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.ph a.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
11495
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 id-column is primary key and references other tables as well. How can I come around this problem? Need help /Martin
1
7595
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 collation on all tables (fields) in database. The problem is, before I will to update the collations, I need to drop all constrains and pk's.
4
10565
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 all! There are no table relationships defined in this database, no Natural keys, only Surrogate keys in the database. 1- Maybe an odd question but is it normal to have 1/3 of the table's fields as indexes? Is this a valid question or it really
1
2696
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: Index idx_blk_id_addr is not a btree When I deleted and recreated the table, it worked fine. Any ideas?
7
19393
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 doing a simple set col1 = 'x' where col1 = 'y' attempted (in general terms; col1 & col2 are the PK)
10
26139
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 null references another, FK_LASTLYOID bigint not null references lastly, unique (FK_OTHEROID,FK_ANOTHEROID))
1
3234
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 in CONSTRAINT clause". Some how access does not like "ON DELETE CASCADE" any help is much appreciated ALTER TABLE TData
8
5211
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 would reindex if the LogicalFragmenation is over 30%. I have some tables that are 98% (I'm guessing really bad). I know it all depends.. more as a learning point: I found a table that had over 30% logicalfragmentation, I dropped the indexes,...
3
6684
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 Administrative Authorizations for Current User
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.