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: (view raw, whole thread or download thread mbox)
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'),

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-2017 The PostgreSQL Global Development Group