Top "Alter-table" questions

The "ALTER TABLE" is a SQL statement that allows you to make schema changes to a database table (i.e. add, drop or alter columns from an existing table).

Does adding a null column to a postgres table cause a lock?

I think I read somewhere that running an ALTER TABLE foo ADD COLUMN baz text on a postgres database will …

postgresql alter-table
Alter Table Move command - ORACLE

Consider i have TABLE1 in Tablespace TS1. I have another Tablespace TS2. What is the difference between the below three …

oracle11g alter-table tablespace
How to alter "REFERENCES" in PostgreSQL?

How can I alter the reference to a table in PostgreSQL when the table name has been changed? Say I …

postgresql foreign-keys ddl alter-table
Warning: A long semaphore wait

For the past 4 days I have had massive problems with my nightly updates, except for 1 night were it all went …

mysql sql innodb alter-table full-text-indexing
Optimizing MySQL for ALTER TABLE of InnoDB

Sometime soon we will need to make schema changes to our production database. We need to minimize downtime for this …

mysql alter-table performance
SQL Server: ALTER with ADD new column

I have the following statement in SQL Server: ALTER TABLE [dbo].[TruckTbl] ADD [TruckState] [bit] NULL DEFAULT 0; What this will …

sql sql-server alter-table
MySQL Drop foreign key Error 152

I am trying to drop a number of foreign keys using: ALTER TABLE `table` DROP FOREIGN KEY `fk_table_users1` , …

mysql foreign-keys alter-table
alter table add ... before `code`?

ALTER TABLE tada_prod.action_6_weekly ADD COLUMN id INT NULL AUTO_INCREMENT UNIQUE AFTER member_id; works, so i …

mysql alter-table
SQL: ALTER COLUMN to shorter CHAR(n) type

I'm working with MS SQL SERVER 2003. I want to change a column in one of my tables to have fewer …

sql alter-table alter-column
Add a column if it doesn't exist to all tables?

I'm using SQL Server 2005/2008. I need to add a column to a table if it does not yet exist. This …

sql sql-server tsql sql-server-2008 alter-table