Re: Suggested improvement : Adjust SEQUENCES to accept an INCREMENT of functionname(parameters) instead of an integer - Mailing list pgsql-general

From Shaun Thomas
Subject Re: Suggested improvement : Adjust SEQUENCES to accept an INCREMENT of functionname(parameters) instead of an integer
Date
Msg-id Pine.LNX.4.33L2.0106220822240.14272-100000@hamster.lee.net
Whole thread Raw
In response to Suggested improvement : Adjust SEQUENCES to accept an INCREMENT of functionname(parameters) instead of an integer  (Justin Clift <aa2@bigpond.net.au>)
List pgsql-general
On Fri, 22 Jun 2001, Justin Clift wrote:

> For my example, I'd use this to add random positive increments (specifically
> to avoid easy predictability of the sequence), but it would be quite flexible.

It's called a trigger.  Just take out the sequence, and build a trigger
that does this for you.   That's why Postgres has them, after all.


--
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. Thomas                INN Database Programmer              |
| Phone: (309) 743-0812          Fax  : (309) 743-0830                |
| Email: sthomas@townnews.com    AIM  : trifthen                      |
| Web  : hamster.lee.net                                              |
|                                                                     |
|     "Most of our lives are about proving something, either to       |
|      ourselves or to someone else."                                 |
|                                           -- Anonymous              |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



pgsql-general by date:

Previous
From: Mike Haberman
Date:
Subject: Adding Foreign Key constraints outside of table def.
Next
From: "Patrick Collin"
Date:
Subject: newbie cursor problem