Search Postgresql Archives

can't create index with 'dowcast' row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

To constraint unique'ness of my visitors to a 24h periode I tried 
created a index including the 'date' part of the created_on timestamp:

	CREATE UNIQUE INDEX visit_idx ON visit_buffer USING btree (id_session, 
	id_story, created_on::date);

	psql:visit_pkey.sql:5: ERROR:  syntax error at or near "::"
	LINE 1: ...buffer USING btree (id_session, id_story, created_on::date);

and this:

	CREATE UNIQUE INDEX visit_idx ON visit_buffer USING btree (id_session, id_story, extract(date from created_on));
	psql:visit_pkey.sql:4: ERROR:  functions in index expression must be marked IMMUTABLE

How can I achieve what I am trying?

Thanks,

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux