pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
new serial type
2+ messages / 2 participants
[nested] [flat]

* new serial type
@ 2001-01-13 10:42  Rolf Johansson <rojo@nocrew.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Rolf Johansson @ 2001-01-13 10:42 UTC (permalink / raw)
  To: pgsql-sql

Is there some function to change the serial type to, instead of reading
a next-value, read the maxium value in a column and then add x? If, for
some reason, the sequence is not updated (when I'm doing COPY into a
table), I'll have to recreate the sequence. Instead, it would be much
more simple just to take the max()+x value for a new type of serial type.

/Rolf



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: new serial type
@ 2001-01-13 11:37  Kaare Rasmussen <kar@webline.dk>
  parent: Rolf Johansson <rojo@nocrew.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Kaare Rasmussen @ 2001-01-13 11:37 UTC (permalink / raw)
  To: pgsql-sql

Den lørdag 13. januar 2001 11:42 skrev Rolf Johansson:
> Is there some function to change the serial type to, instead of reading
> a next-value, read the maxium value in a column and then add x? If, for

You can use setval(sequence, number) and MAX(number) in combination.

-- 
Kaare Rasmussen            --Linux, spil,--        Tlf:        3816 2582
Kaki Data                tshirts, merchandize      Fax:        3816 2501
Howitzvej 75               Åben 14.00-18.00        Email: kar@webline.dk
2000 Frederiksberg        Lørdag 11.00-17.00       Web:      www.suse.dk



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-01-13 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-13 10:42 new serial type Rolf Johansson <rojo@nocrew.org>
2001-01-13 11:37 ` Kaare Rasmussen <kar@webline.dk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox