Can You Drop a Column in Aurora DSQL?

0
3
Asked By CuriousCoder42 On

I've been experimenting with DSQL and tried using the standard SQL command to drop a column: `ALTER TABLE mytable DROP COLUMN mycolumn;`. However, I got an error saying that this command isn't supported. From what I can gather from the documentation, it seems that the only modification I can make to a table is adding columns, not dropping them. Is that correct? If so, why is the `DROP` function not available?

3 Answers

Answered By InsightfulIvy On
Answered By DataDude99 On

Yeah, you're right about that. It seems like a pretty basic SQL command, but dropping a column in a production environment can lead to significant issues like table locks and cascading effects. So, I understand why Aurora DSQL doesn't support it. When you're scaling up, the best strategy is often to just remove the column from your queries and treat it as if it's gone, or plan a more complicated table copy and replace if you need to.

Answered By TechieTimmy On

I haven’t tried DSQL yet, but it appears that removing a column is just a feature they haven't added yet. It’s strange not to have that flexibility, especially since everyone has different needs. Still, in production, how often do you really need to remove columns? It seems that it’s not a frequent use case for most people.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.