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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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