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

Fwd: Re: increment counter in VIEW

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Novice Postgresql-list <pgsql-novice(at)postgresql(dot)org>
Subject: Fwd: Re: increment counter in VIEW
Date: 2006-07-13 13:55:13
Message-ID: 20060713135513.68572.qmail@web31806.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
oops,  forgot to reply all.
> > Dear All,
> > Thank you very much for your answers. I just want to summarize:
> > 1. create sequence:
> >     CREATE SEQUENCE myseq;
> > 
> > 2. insert sequence function calls into VIEW:
> > CREATE OR REPLACE VIEW my_view AS SELECT
> >       nextval('myseq')::text AS test,
> >        knoten.knoten,
> > FROM
> >         setval('myseq',1),
> >         knoten knoten
> > WHERE
> >          knoten.knoten::text = knoten_flaeche.knoten::text;
> > 
> > In Postgres it seems to work fine, but not yet in my application.
> > My doubt is about setval('myseq',1). I am not sure that it will always 
> > works fine when I access view from my application. For example when I 
> > call on_update rule.
> 
> Maybe use a set returning function.  So people on the list call it a store procedure.
> http://www.postgresql.org/docs/8.1/interactive/xfunc-sql.html
> 
> This way to can add for than one SQL statement to the fuction.  1 to reset your sequence and 1
> to
> display your query.
> 
> Regards,
> 
> Richard Broersma Jr.
> 


pgsql-novice by date

Next:From: Anastasios HatzisDate: 2006-07-13 14:49:14
Subject: Re: The name of the game (was Re: postgre linkage
Previous:From: OlegDate: 2006-07-13 09:55:52
Subject: Re: increment counter in VIEW

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