Tag Info

New answers tagged

2

Tip: use psql's -E flag to get it to show you how what queries it is issuing for e.g. its \dm meta-command, and adjust from there. Here's a rough and not at all cleaned-up query, but it should do the trick... WITH matviews_with_keys AS ( SELECT c.oid, c.relname, c2.relname AS idx_name FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, ...


1

In this case, if you cant serialize this in the application code you can use try/catch or an applock begin tran if APPLOCK_TEST ('public','idx_create','exclusive') = 1 begin EXEC sp_getapplock @Resource = 'idx_create', @lockmode = 'Exclusive', @DbPrincipal='public' print 'I can do it' -- EXEC ...


0

There is a document in the PostgreSQL Wiki that show some problems which can occur with certain combinations of transactions at the REPEATABLE READ transaction isolation level, and how they are avoided at the SERIALIZABLE transaction isolation level beginning with PostgreSQL version 9.1. It also includes an example of how it could be possible for a ...


1

I have mentioned ALGORITHM=INPLACE in two other posts Mar 27, 2014 : When tables are locked does MySQL queue queries? Feb 12, 2015 : How to evolve MySQL schema while maintaining integrity In the second post, I named some caveats on using online DDL The online schema change feature uses the folder mapped in tmpdir. Make sure the copy of the table can ...


0

if you would want to allow read writes when Altering you might want to your percona online schema change tool from percona. This tool is safe to use when altering the table. http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html Hope this helps



Top 50 recent answers are included