I try to do: CREATE RULE ndicti AS ON INSERT TO ndict DO INSTEAD INSERT INTO 'ndict_' || (NEW.word_id & 255) VALUES( NEW.url_id, NEW.word_id, NEW.intag); I got an error on 'ndict_' . I did not found the right syntax.
In fact I discover that
SELECT * FROM / INSERT INTO table
doesn't accept function that returns the name of the table as table, but only function that returns rows....
I'm dead.
Does this feature, is possible or plan ? Is there a trick to do it ?
You could call a plpgsql function and inside that use EXECUTE (or use pltcl or some other interpreted language).
Not sure what you're doing will help you much though. Are you aware that you can have partial indexes?
CREATE INDEX i123 ON ndict WHERE (word_id & 255)=123;
That might be what you're after, but it's difficult to be sure without knowing what problem you're trying to solve.
--
Richard Huxton
Archonet Ltd
---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster