can't create index with 'dowcast' row

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема can't create index with 'dowcast' row
Дата
Msg-id 20080124155421.GA24152@apartia.fr
обсуждение исходный текст
Ответы Re: can't create index with 'dowcast' row  (marcelo Cortez <jmdc_marcelo@yahoo.com.ar>)
Re: can't create index with 'dowcast' row  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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,

В списке pgsql-general по дате отправления:

Предыдущее
От: User Map
Дата:
Сообщение: change the default data directory
Следующее
От: Stefan Schwarzer
Дата:
Сообщение: Re: Forgot to dump old data before re-installing machine