Re: partitioning / rules - strange behavior - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: partitioning / rules - strange behavior
Date
Msg-id a9c525b712bb1c0cf797c8791dc1cd25@biglumber.com
Whole thread Raw
In response to partitioning / rules - strange behavior  (Tomas Vondra <tv@fuzzy.cz>)
Responses Re: partitioning / rules - strange behavior  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> db=> INSERT INTO sessions(... non-pk columns ...) VALUES (... data ...);
> INSERT 0 0
> db=> SELECT * FROM sessions WHERE id = currval('sessions_id_seq');
> (0 rows)
>
> which seems really strange to me. We're using sequence to generate the
> ids, but that shouldn't be a problem (at least it was not till today).

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');

(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.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200702041952
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFFxoDWvJuQZxSWSsgRAxqLAKDNedJ2pPg9otabsrinS1002SL0XQCeMwyF
8dqMxeB/x4XoZoj2WATZyPc=
=mvMI
-----END PGP SIGNATURE-----



pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: partitioning / rules - strange behavior
Next
From: Tomas Vondra
Date:
Subject: Re: partitioning / rules - strange behavior