[GENERAL] Adding a not null constraint faster

2014-05-17 Thread Joe Van Dyk
Is there a way to add a NOT NULL constraint to a column without having to lock the table while a sequential read happens? Seems like it should be possible to add an index on the column for null values, like: create index on t using btree(col_name) where col_name is null; Then when adding the not

[GENERAL] 9.4 beta - pg_get_viewdef() and WITH CHECK OPTION

2014-05-17 Thread Thomas Kellerer
Hello, when playing with 9.4 beta I noticed that the result of pg_get_viewdef() will not include the new WITH CHECK OPTION clause when the view was created using it. Is that intended (if so: why?) or is this an oversight/bug? Regards Thomas -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] Adding a not null constraint faster

2014-05-17 Thread Alvaro Herrera
Joe Van Dyk wrote: > Is there a way to add a NOT NULL constraint to a column without having > to lock the table while a sequential read happens? > > Seems like it should be possible to add an index on the column for > null values, like: > create index on t using btree(col_name) where col_name is n