This query works great in mysql but I'm trying to run it in postgresql and it's complaining about the IGNORE
keyword, which is not a pg keyword. I'm not sure how to modify it to make it do the same under pg?
DROP TABLE IF EXISTS ct_tmp_u1101_t9;
CREATE TEMPORARY TABLE ct_tmp_u1101_t9(id int primary key, shared int default 0) IGNORE (SELECT 1101 as id);
SELECT shared from ct_tmp_u1101_t9
UNION (SELECT cust_user2role.userid AS userid FROM cust_user2role
INNER JOIN cust_users ON cust_users.id = cust_user2role.userid
INNER JOIN cust_role ON cust_role.roleid = cust_user2role.roleid
WHERE cust_role.parentrole like 'H1::H2::H3::H4::H5::%')
UNION (SELECT groupid FROM cust_groups where groupid in (3,4,2,1005));