Re: [GENERAL] Refreshing functional index

2012-10-08 Thread Grzegorz Tańczyk
"BEFORE INSERT" was the problem here, "AFTER INSERT" works fine Thanks for all answers. -- Regards, Grzegorz W dniu 2012-08-31 20:41, Grzegorz Tańczyk pisze: Hello, W dniu 2012-08-31 20:25, David Johnston pisze: The question becomes how do you update the "item id" on the "groups" table wh

Re: [GENERAL] Refreshing functional index

2012-08-31 Thread Grzegorz Tańczyk
Hello, W dniu 2012-08-31 20:25, David Johnston pisze: The question becomes how do you update the "item id" on the "groups" table when you add new records to "items". I have a trigger on items table: CREATE TRIGGER items_insert BEFORE INSERT ON items FOR EACH ROW EXECUTE PROCEDURE ite

Re: [GENERAL] Refreshing functional index

2012-08-31 Thread David Johnston
>>Grzegorz>> Hello, W dniu 2012-08-29 23:06, Merlin Moncure pisze: Well, the only reason what you're trying to do works at all is because the database isn't stricter about double checking to see if your stuff is IMMUTABLE: it isn't, so of course it doesn't work. How about a trigger on the child

Re: [GENERAL] Refreshing functional index

2012-08-31 Thread Grzegorz Tańczyk
Hello, W dniu 2012-08-29 23:06, Merlin Moncure pisze: Well, the only reason what you're trying to do works at all is because the database isn't stricter about double checking to see if your stuff is IMMUTABLE: it isn't, so of course it doesn't work. How about a trigger on the child table that

[GENERAL] Refreshing functional index

2012-08-30 Thread Grzegorz Tańczyk
Hello, I have a problem with functional index feature in Postgres 8.3 There are two tables, lets call them: PARENTS and CHILDREN(with timestamp column) I created functional index on parents with function, which selects max value of timestamp from child elements(for given parent_id). The pr

Re: [GENERAL] Refreshing functional index

2012-08-29 Thread Merlin Moncure
On Wed, Aug 29, 2012 at 4:01 PM, Grzegorz Tańczyk wrote: > Hello, > > I have a problem with functional index feature in Postgres 8.3 > > There are two tables, lets call them: PARENTS and CHILDREN(with timestamp > column) > > I created functional index on parents with function, which selects max va

Re: [GENERAL] Refreshing functional index

2012-08-29 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Grzegorz Tanczyk Sent: Wednesday, August 29, 2012 5:02 PM To: pgsql-general@postgresql.org Subject: [GENERAL] Refreshing functional index Hello, I have a problem with functional index feature in

[GENERAL] Refreshing functional index

2012-08-29 Thread Grzegorz Tańczyk
Hello, I have a problem with functional index feature in Postgres 8.3 There are two tables, lets call them: PARENTS and CHILDREN(with timestamp column) I created functional index on parents with function, which selects max value of timestamp from child elements(for given parent_id). The pr