update subject_cloud set count = count + 1 from (select subject from subjects where sku = '9780520241329') as subs where subs.subject = subject_cloud.subject;
delete from product_categories where category IN (select distinct category from product_categories PC LEFT JOIN categories C on PC.category = C.code WHERE code is NULL);
MySQL example:
delete PC from product_categories PC left join products P on PC.sku = P.sku where P.sku is NULL;
delete C from categories C left join product_categories PC on C.code = PC.category where C.parent > 0 and PC.category is NULL;
insert into form_elements(code,name,label,component,widget) select nextval('form_elements_code_seq'),name,label,'register',widget from form_elements where component = 'shippingaddress';
Drupal module authors appear to be oblivious of PostgreSQL as they are using MySQL specific functions all over the place. Most of these problems can be solved by mimic MySQL functions by adding custom PostgreSQL functions. Drupal itself supplies a bunch of routines through the database installation routine.