Re: [GENERAL] table with sort_key without gaps

2004-12-13 Thread Janning Vygen
Am Samstag, 11. Dezember 2004 20:06 schrieb Bruno Wolff III: On Thu, Dec 09, 2004 at 18:32:19 +0100, Janning Vygen [EMAIL PROTECTED] wrote: id should be positive id should not have gaps within the same account id should start counting by 1 for each account i cant use sequences

Re: [GENERAL] table with sort_key without gaps

2004-12-13 Thread Tino Wildenhain
Hi, On Mon, 2004-12-13 at 10:58 +0100, Janning Vygen wrote: Am Samstag, 11. Dezember 2004 20:06 schrieb Bruno Wolff III: On Thu, Dec 09, 2004 at 18:32:19 +0100, Janning Vygen [EMAIL PROTECTED] wrote: id should be positive id should not have gaps within the same account id should

Re: [GENERAL] table with sort_key without gaps

2004-12-13 Thread Janning Vygen
Am Montag, 13. Dezember 2004 17:37 schrieb Bruno Wolff III: On Mon, Dec 13, 2004 at 10:58:25 +0100, Janning Vygen [EMAIL PROTECTED] wrote: Am Samstag, 11. Dezember 2004 20:06 schrieb Bruno Wolff III: maybe your are right. But with Sequences i thought to have problems when i do inserts

Re: [GENERAL] table with sort_key without gaps

2004-12-13 Thread Bruno Wolff III
On Mon, Dec 13, 2004 at 19:37:41 +0100, Janning Vygen [EMAIL PROTECTED] wrote: ok, i have users which wants to manage their sporting competitions which (simplified) has games and fixtures (in german Spieltage, i hope the word fixtures is understandable). Like German Bundesliga has 9 games

Re: [GENERAL] table with sort_key without gaps

2004-12-13 Thread Frank D. Engel, Jr.
Yeah, that suggestion sounds good as long as you ensure that the sort column has sufficient precision to handle the in-between values. I would suggest checking for value-above and value-below when inserting, then using their midpoint. In the event that there is no value-above, add some

Re: [GENERAL] table with sort_key without gaps

2004-12-13 Thread Bruno Wolff III
On Mon, Dec 13, 2004 at 19:37:41 +0100, Janning Vygen [EMAIL PROTECTED] wrote: the other reason why i wanted gapless sequences was that i would love to use the id in an URL. But this is easy to manage to translate a positional id in an URL to the database id. For this you probably

Re: [GENERAL] table with sort_key without gaps

2004-12-11 Thread Bruno Wolff III
On Thu, Dec 09, 2004 at 18:32:19 +0100, Janning Vygen [EMAIL PROTECTED] wrote: id should be positive id should not have gaps within the same account id should start counting by 1 for each account i cant use sequences because they are producing gaps and doesn't start counting by 1 for

[GENERAL] table with sort_key without gaps

2004-12-10 Thread Janning Vygen
Hi, i have a table like this: create table array ( account text NOT NULL, id int4 NOT NULL, value text NOT NULL, PRIMARY KEY (account, id) ); values like this: acc1,1,'hi' acc1,2,'ho' acc1,3,'ha' acc2,1,'ho' acc3,1,'he' acc3,2,'hu' id should be positive id should not have gaps