News for hackers. Stuff that matters.
Re:PostgreSQL partitioning explained by pilif on Sunday May 04, 2014 @02:13AM (#7693484)
Sequences are guaranteed to produce unique values. Just manually configure each child table to use the same sequence for the primary key column. Yes, uniqueness won't be enforced on the parent table, but the values will still be unique (unless you manually update them in your queries)
Re:PostgreSQL partitioning explained by trippy_biscuits on Sunday May 04, 2014 @04:26AM (#7693707)
Until the sequence rolls over. Why design a schema with built in failure (an integer PK that overflows)?
Re:PostgreSQL partitioning explained by pilif on Sunday May 04, 2014 @04:33AM (#7693714)
Sequences won't roll over by default. nextval() fails if you're out of values. You can create a sequence which is allowed to roll over (by specifying cycle), but it's not the default.

Yes. It's not optimal and you can shoot yourself in the foot, but it works in its default configuration. I just gave a workable workaround for a problem, I wasn't saying it's the perfect solution (a working unique constraint on the parent table would be)

Re:PostgreSQL partitioning explained by Negitivefrags on Sunday May 04, 2014 @06:41AM (#7693853)
The default sequence size is 64 bit. Even if you are getting 100,000 ids a second from it you wont run out for over 5 million years.