[rt-users] Starting Tcket Number

Justis Peters justis at opennms.org
Thu Oct 25 16:02:58 EDT 2001


On Thursday 25 October 2001 03:18 pm, Tam, Thomas wrote:
> Hi
>
> Is there any way to change the Ticket ID number? For example the number
> starts with 1000 instead of 1.

Yes, depending on the DBMS you are using.  If you are using PostgreSQL, you 
would execute the following query from inside of psql:

select setval('tickets_id_seq', 1000);

Depending on the security you setup on PostgreSQL, you may have to 'su 
postgres' first and then run 'psql rt2'.  If you want it all on one command 
line, try the following.  It should execute the query in postgres and drop 
you back to the command line:

bash$ echo 'select setval('tickets_id_seq', 10);' | psql rt2

There should be something similar to this for MySQL users, but I don't know 
if MySQL uses sequences or not (perhaps somebody else knows?).

Before you set the sequence forward, be sure that you want it that high.  You 
can't set it backwards later without causing integrity violations on the 
primary key.

Enjoy, and have a good day!

Justis Peters
Oculan Corp.
justis at oculan.com





More information about the rt-users mailing list