Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

Users.id and Groups.id

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


ptomblin at xcski

May 7, 2012, 10:54 AM

Post #1 of 2 (257 views)
Permalink
Users.id and Groups.id

I noticed that the database schema specifies different sequences for
the id fields in the users and groups tables. However, it appears
that RT doesn't actually use those sequences - "select
currval('user_id_seq')" returns 1 even though I have a bunch of users
created. The other thing I noticed is that the users.id and groups.id
don't have any common numbers - i.e. I've got users with ids 26, 28
and 32, and groups with ids of 27, 29 and 31. Can I rely on that
being true, or is it just a coincidence?

--
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


tjrc at sanger

May 7, 2012, 11:14 AM

Post #2 of 2 (246 views)
Permalink
Re: Users.id and Groups.id [In reply to]

On 7 May 2012, at 18:54, Paul Tomblin wrote:

> I noticed that the database schema specifies different sequences for
> the id fields in the users and groups tables. However, it appears
> that RT doesn't actually use those sequences - "select
> currval('user_id_seq')" returns 1 even though I have a bunch of users
> created. The other thing I noticed is that the users.id and groups.id
> don't have any common numbers - i.e. I've got users with ids 26, 28
> and 32, and groups with ids of 27, 29 and 31. Can I rely on that
> being true, or is it just a coincidence?

It might be true (since both users and groups have an entry in the Principals table) but the purist in me is screaming "assume it isn't true". If you assume it isn't true, whatever code you're considering writing will always work. If you assume it is true, and it later turns out not to be, you're going to get burned. It might also be one of those things where it's true on one database backend, but not on another.

What are you actually trying to do?

Tim

--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.