Skip site navigation (1) Skip section navigation (2)

Re: increment counter in VIEW

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Oleg <evdakov(at)iwg(dot)uka(dot)de>
Cc: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: increment counter in VIEW
Date: 2006-07-12 19:19:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Wed, Jul 12, 2006 at 17:03:01 +0200,
  Oleg <evdakov(at)iwg(dot)uka(dot)de> wrote:
> Without generate_series my View produces 300 records. if I insert 
> generate_series then I get 90000 because it tries all possible 
> combinations with S.a. I do not know how can I limit it with WHERE.

I don't think generate_series will work well in this case.
If you can do the numbering in the application, that will probably be the
easiest thing to do.

Otherwise you are going to need to get the numbers into the underlying table
or another table that can be joined to the underlying table on a key. And
these numbers will need to be kept up to date. (And deletions will be,
expensive since that will require renumbering rows with higher numbers.)
This also will cause problems for concurrent updates.

In response to

pgsql-novice by date

Next:From: tlmDate: 2006-07-13 00:49:03
Subject: cron job failing with 'database "xyz" is being accessed by other users' errors
Previous:From: Sean DavisDate: 2006-07-12 19:16:21
Subject: Re: postgre linkage with non-postgre db

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group