Workaround or user defined type

From: Juan Jose Natera Abreu <jnatera(at)net-uno(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Workaround or user defined type
Date: 2001-11-06 19:38:57
Message-ID: 01110615385701.00494@juanjose
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello people,

I am working on a trouble ticket system in Perl, usually those systems
identify a ticket by a string composed of DDMMYYYY-SERIAL, (DD = day,
MM= month, YYYY= year, SERIAL= a serial number for the date string).

I am not sure how to generate these identifiers, in case I generate
them manually i must provide a mechanism to insure the sequence, like
locking the table for reading/writing, get the last value, insert the
new one and then release the lock. However i think this could be a big
performance killer. Any ideas?

The other option I see, is creating a user defined type that will take
care of keeping the sequence for me. I read the apropiate page at the
programmers manual, but i think i would need more information. Any
resources?

Regards,

Juan Jose
--
fortune generated signature:
Brook's Law: Adding manpower to a late software project makes it later

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2001-11-06 19:49:14 Re: IS NULL
Previous Message David Link 2001-11-06 18:52:05 IS NULL