Re: Function PostgreSQL 9.2

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Function PostgreSQL 9.2
Дата
Msg-id 571808F6.3030707@aklaver.com
обсуждение исходный текст
Ответ на Re: Function PostgreSQL 9.2  ("drum.lucas@gmail.com" <drum.lucas@gmail.com>)
Ответы Re: Function PostgreSQL 9.2  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Re: Function PostgreSQL 9.2  ("drum.lucas@gmail.com" <drum.lucas@gmail.com>)
Список pgsql-general
On 04/20/2016 03:33 PM, drum.lucas@gmail.com wrote:
>
>
>     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.

Understood, but what happens if the customer has been using a code of:

... 998, 999, 1000

They then left the code null on the next two items and your function
stuck in 1001 and 1002. Then they figured out what they wanted to do
with the codes on their end but wanted the items to have codes of 1002,
1001 for the items you coded 1001, 1002 respectively.

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

Unique within a customer, which is what your code implied or unique
across all customers?

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

Well, I am with David on this, either the customer is totally in charge
of the codes or you are. The thought of mixing systems gives me a headache.


--
Adrian Klaver
adrian.klaver@aklaver.com


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Function PostgreSQL 9.2
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created