Re: Function PostgreSQL 9.2

From: "drum(dot)lucas(at)gmail(dot)com" <drum(dot)lucas(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Function PostgreSQL 9.2
Date: 2016-04-20 22:33:21
Message-ID: CAE_gQfVzrZ5BwBfo14PLJgJf-im3FPSZ0N0i3EbAZpVx9kja-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
>
>
> If I am following, this duplicates the information in
> companies.client_code_increment, in that they both return the last non-user
> code. Of course this assumes, as David mentioned, that the client is not
> using a numeric code system. Then you are left trying to figure whether a
> number is 'your' number or 'their' number?
>
>>

The customer can add any value into users.code:

code CHARACTER VARYING,

But he also can let it blank/null if he wants to.
That's when the trigger do its job.. Put a value (starting in 1000) in that
column.

Of course that has to be unique, as nobody can use the same value of others.

- I was hoping you cans could help me to start doing the function...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2016-04-20 22:46:02 Re: Function PostgreSQL 9.2
Previous Message Adrian Klaver 2016-04-20 22:26:15 Re: Function PostgreSQL 9.2