Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
1k views

Why do my RDS read IOPS drop after a certain period of time?

I am trying to add non-null constraints on several columns in a table with about 70,000,000 rows. Each statement is just ALTER TABLE table_name ALTER COLUMN column_name SET NOT NULL;, and each ...
Kris Harper's user avatar
3 votes
1 answer
473 views

Does "alter table … set data type" functionally differ from "alter table … type"?

The docs show [SET DATA] TYPE which implies the SET DATA part is optional, but the 9.1 release notes also imply that SET DATA TYPE may be different: Allow ALTER TABLE ... SET DATA TYPE to avoid ...
davemyron's user avatar
  • 133
0 votes
0 answers
771 views

Possibility of using self-referential foreign key to create hierarchical comments

I am an accidental DBA and have a question regarding the table structure of a website I maintain (postgresql 9.6 backend). Imagine a typical content website (let's call it 'Links'), where users post ...
Hassan Baig's user avatar
  • 2,039
4 votes
0 answers
1k views

How costly is changing column datatype in PostgreSQL?

I'm currently evaluating PostgreSQL for an app we are developing which comes with a weird usecase. We want to allow clients to create new fields which in turn will create new columns in a client-...
navinpai's user avatar
  • 141
1 vote
1 answer
532 views

Query Performance When Dropping Multiple Columns

In PostgreSQL, is there any performance gain when using a single ALTER TABLE statement to drop multiple columns, instead of using a separate statement to drop each column? ALTER TABLE table DROP ...
Tamer Shlash's user avatar
8 votes
2 answers
24k views

Add column with default in postgresql without table level lock

Have such a problem - table with over 20mln rows. When i add new column with default - postgresql lock table for over 40 minutes so my application stop working for this time. So instead of ALTER ...
Vova's user avatar
  • 183