Re: custom serial number - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: custom serial number
Date
Msg-id 20081118094222.GD19076@a-kretschmer.de
Whole thread Raw
In response to Re: custom serial number  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Responses Re: custom serial number
List pgsql-sql
am  Tue, dem 18.11.2008, um 10:37:23 +0100 mailte Pavel Stehule folgendes:
> Hello
> 
> what do you wont to do exactly?
> 
> you can try -
> 
> create sequence s;
> postgres=# create sequence s;
> CREATE SEQUENCE
> postgres=# select to_char(current_date, 'yyyymmdd') ||
> trim(to_char(nextval('s'), '0000'));
>    ?column?
> --------------
>  200811180002
> (1 row)

What's wrong with your sequence, it starts with 2?


SCNR *g*

Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


pgsql-sql by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: custom serial number
Next
From: "Pavel Stehule"
Date:
Subject: Re: custom serial number