2010/2/10 Ben Campbell <b...@scumways.com>

> I settled on:
>
> CREATE TABLE needs_indexing (
>  article_id integer REFERENCES article(id) PRIMARY KEY
> );
>
> The primary key-ness enforces uniqueness, and any time I want to add an
> article to the queue I just make sure I do a DELETE before the INSERT. Bound
> to be more efficient ways to do it, but it works.
>
> better use

INSERT INTO needs_indexing (article_id)
SELECT NEW.id
WHERE NOT EXISTS ( SELECT 42 FROM needs_indexing WHERE article_id = NEW.id
);





-- 
Filip Rembiałkowski
JID,mailto:filip.rembialkow...@gmail.com
http://filip.rembialkowski.net/

Reply via email to