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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Sequenz mit Ausnahmen



Andreas Kretschmer <akretschmer(at)spamfence(dot)net> schrieb:
> Die Funktion in 'foo_seq.sql':
> create or replace function _foo_seq() returns trigger as $$
> begin
>         if currval('seq_foo') between 5 and 10 then
>                 perform setval('seq_foo', 10);
>         end if;
>         return NULL;
> end;
> $$ language plpgsql;

Nachtrag:

$$-Quoting geht erst ab 8.x, das mußt Du also anpassen. Ich hab grad
keine alte Version zur Hand, das zu probieren...


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group