Re: question about return value when selecting next id from postgresql using nextval

2008-09-30 Thread Merrick
Thank you, I was doing this: def encode_id(id): ... number = id charset = string.letters + string.digits base = len(charset) count = 0 while number: digit = number % base ... and kept getting an error, when I did this: id = row[0] encode_id(id) I didn't realize

Re: question about return value when selecting next id from postgresql using nextval

2008-09-30 Thread Malcolm Tredinnick
On Tue, 2008-09-30 at 15:08 -0700, Merrick wrote: > If I run the following query on psql: > > SELECT nextval('redirect_link_id_seq'); > > it returns an integer, say 5 > > when I do the following with the django shell I get a different > result: > > >>> def get_next_id(): > ... cursor =

question about return value when selecting next id from postgresql using nextval

2008-09-30 Thread Merrick
If I run the following query on psql: SELECT nextval('redirect_link_id_seq'); it returns an integer, say 5 when I do the following with the django shell I get a different result: >>> def get_next_id(): ... cursor = connection.cursor() ... cursor.execute("SELECT