So I need a query that would null the content in specific field. That's quite easy, but I need it with a limit that I would specify. For selecting the field with LIMIT and FOR UPDATE SKIP LOCKED I know the query. I need something similar but with UPDATE. Here what I've come with:
UPDATE e_message SET message = null FROM (SELECT * FROM e_message where created < :created ORDER BY :created LIMIT :limit FOR UPDATE SKIP LOCKED)
I specify the created and limit variables in java.
Would this work or did I do something wrong?