Deletion not working
Created by: ilu33
delete from conv where guid = 'd69f2e...08cbfcc7b' and uid = 17 limit 1; returned false
ERROR: syntax error at or near "limit"
LINE 1: ...08cbfcc7b' and uid = 17 limit 1;
^
"limit 1" will not work in postgres that way. A possible command could be:
DELETE FROM conv WHERE ctid IN ( SELECT ctid FROM conv where guid = '%s' and uid = %d ORDER BY created LIMIT 1 )
But isn't guid and uid already unique? Is "limit 1" really necessary? Removing it would solve the postgres problem. But wouldn't it be better to enforce uniqueness in the table definition?