Re: partitioning / rules - strange behavior

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: partitioning / rules - strange behavior
Дата
Msg-id 45C6D64B.6060506@fuzzy.cz
обсуждение исходный текст
Ответ на Re: partitioning / rules - strange behavior  ("Greg Sabino Mullane" <greg@turnstep.com>)
Ответы Re: partitioning / rules - strange behavior  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> Looks to me as though you have forgottent the table inheritance part of the
> table partitioning trick. Are you sure that sessions_900000 inherit from
> the sessions table? Does a direct count from the table referenced by the
> rule return a non-zero count? In other words:
>
> SELECT count(*) FROM sessions_900000 where id = currval('sessions_id_seq');

No, the tables are inherited, i.e. there's something like

CREATE TABLE sessions_8000000 (
  CHECK (id BETWEEN 8000000 AND 8499999
) INHERITS (sessions);

I've checked this for all the partitions (we're using three right now)
as well as the direct count (returns nothing).

As I already said - it works until I create a rule for the next
partition (not used yet) - then is suddenly stops working.

> (or some other similar table) may show your "missing" rows. The other
> possibility is that the you are not using sessions_id_seq in the way
> you think you are.

What do you mean? I do a 'SELECT currval(...)' after the insert and it
gives me the right value. It works until I create the next RULE, so this
does not seem as a sequence problem.

Tomas

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

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: partitioning / rules - strange behavior
Следующее
От: Tom Lane
Дата:
Сообщение: Re: partitioning / rules - strange behavior