Monthly Archives: November 2013

QNAP USB external 3tb drive does not work

This is because you must use parted instead of fdisk to format the drive. parted /dev/sdta (parted) mklabel gpt mklabel gpt Warning: The existing disk label on /dev/sdta will be destroyed and all data on this disk will be lost. … Continue reading

Posted in Linux | Comments Off on QNAP USB external 3tb drive does not work

How to fix postgres sequences that are causing integrity errors.

Save this to a sql file: SELECT ‘SELECT SETVAL(‘ ||quote_literal(quote_ident(S.relname))|| ‘, MAX(‘ ||quote_ident(C.attname)|| ‘)+1) FROM ‘ ||quote_ident(T.relname)|| ‘;’ FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C WHERE S.relkind = ‘S’ AND S.oid = D.objid AND … Continue reading

Posted in postgres | Comments Off on How to fix postgres sequences that are causing integrity errors.

How to see currently executing queries in postgres 9.2

SELECT query,xact_start,query_start FROM pg_stat_activity;

Posted in postgres | Comments Off on How to see currently executing queries in postgres 9.2