Workaround or user defined type - Mailing list pgsql-novice

From Juan Jose Natera Abreu
Subject Workaround or user defined type
Date
Msg-id 01110615385701.00494@juanjose
Whole thread Raw
Responses Re: Workaround or user defined type
Re: Workaround or user defined type
Re: Workaround or user defined type
List 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

pgsql-novice by date:

Previous
From: David Link
Date:
Subject: IS NULL
Next
From: Tom Lane
Date:
Subject: Re: IS NULL