Skip site navigation (1) Skip section navigation (2)

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 (view raw, whole thread or download thread mbox)
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 


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


pgsql-novice by date

Next:From: Tom LaneDate: 2001-11-06 19:49:14
Subject: Re: IS NULL
Previous:From: David LinkDate: 2001-11-06 18:52:05
Subject: IS NULL

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group