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

Squences with letters aswell as numbers

From: "NubeY" <dominic_wormald(at)yahoo(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Squences with letters aswell as numbers
Date: 2006-02-28 16:46:45
Message-ID: 1141145205.432220.183670@v46g2000cwv.googlegroups.com (view raw or flat)
Thread:
Lists: pgsql-novice
At the moment I'm using this kind of sequence to provide a primary key
for some of my tables

create sequence group_seq;
select setval('group_seq', (select max(group_ID) from groups));

However I'd like to create a sequence that has this kind of output

g1
g2
g3
g4
g5

where g doesn't change

and

u1
u2
u3 

where u doesn't change

is there are simple way of doing this?


Responses

pgsql-novice by date

Next:From: crdandridge1Date: 2006-02-28 17:46:51
Subject:
Previous:From: Sean DavisDate: 2006-02-28 11:34:41
Subject: Re: How to enable remote anoymous logins? (+ admin

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