Database Schema Changes

The cluster focuses on challenges with ALTER TABLE operations, such as adding/dropping columns, changing types, downtime, locks, and workarounds like live migrations, transactional changes in PostgreSQL vs. MySQL, and schemaless alternatives.

📉 Falling 0.3x Databases
2,658
Comments
19
Years Active
5
Top Authors
#8975
Topic ID

Activity Over Time

2008
9
2009
32
2010
47
2011
56
2012
94
2013
120
2014
113
2015
138
2016
105
2017
153
2018
182
2019
192
2020
175
2021
225
2022
301
2023
290
2024
243
2025
168
2026
15

Keywords

COLUMN AWS NULL OLTP INPLACE BEAM DEFAULT TABLE SQL YEARS table alter column schema updates data tables sql constraint enum

Sample Comments

DenisM Sep 24, 2014 View on HN

Why is it hard to drop an extra column from a database, or to change its type? ALTER TABLE...

dana321 Feb 19, 2020 View on HN

Yeah, its a pity it doesn't have the ability to do anything more than alter table statements that add to a schema, having to rename the table, create a new schema and copy its contents from the old table can be quite a tricky and troublesome thing to do if you've got a live system running with users on it.

saurik Oct 26, 2010 View on HN

Database servers like PostgreSQL can do the most common updates (add, delete, rename columns) instantly, S they Re abstracting over the underlying data storage. Only changing the type of a column should require reading and writing it, and you can do that change using a new temporary column and renaming it around, rather than using a whole new table. Even the alterations that take time can often be run with MVCC semantics, so existing users won't block. I don't even think MySQL (which is really b

sitharus Dec 10, 2015 View on HN

Or using a more appropriate RDBMS that allows for online and transactional ALTER commands?

nfirvine Dec 10, 2015 View on HN

"Do not perform table alter commands. Table alter commands introduce locks and downtimes. Instead, use live migrations."You know what avoids alter? Going schemaless.

purerandomness Apr 7, 2020 View on HN

Please don't use databases that don't support transactional schema changes. You will hate everything about it.

groby_b Jul 26, 2011 View on HN

Unfortunately, we're still in that time. I don't see "ALTER TABLE" go away any time soon :)

antirez Sep 30, 2009 View on HN

The "missing alter table" problem affects more or less any kind of schema-free DB.

yencabulator Dec 28, 2021 View on HN

Note: no `ALTER TABLE` in their SQL.Sounds like maintaining this over longer term with evolving data would be quite painful.

latchkey Oct 26, 2023 View on HN

That's right up there with changing the purpose of a column in a SQL table, after a certain date.