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

Re: Sequence on a char(6) column

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Roland Giesler <roland(at)giesler(dot)za(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Sequence on a char(6) column
Date: 2005-12-14 14:26:47
Message-ID: c2d9e70e0512140626g769f7d90weaefa48014c87d95@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 12/14/05, Roland Giesler <roland(at)giesler(dot)za(dot)net> wrote:
> Is it possible to create a sequence like 'ABC012','ABC013', etc. in a
> char(6) column?
>

i guess you can do something like:


create sequence seq1;

create table tt (
...
fld1 char(6) default 'str' || nextval('seq1'),
...
);

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

pgsql-novice by date

Next:From: Luiz K. MatsumuraDate: 2005-12-14 19:05:08
Subject: Re: TEMPORARY TABLE in a PL/pgSQL function
Previous:From: Roland GieslerDate: 2005-12-14 14:23:14
Subject: Sequence on a char(6) column

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