pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: how to reset serials
3+ messages / 2 participants
[nested] [flat]

* how to reset serials
@ 2002-06-07 00:03 Joseph Syjuco <joseph@asti.dost.gov.ph>
  2002-06-06 11:48 ` Re: how to reset serials Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 3+ messages in thread

From: Joseph Syjuco @ 2002-06-07 00:03 UTC (permalink / raw)
  To: pgsql-sql

how can i reset my serial field to 0.  Tried using setval but it only
allows setting of my next serial to 2
joseph



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

* Re: how to reset serials
  2002-06-07 00:03 how to reset serials Joseph Syjuco <joseph@asti.dost.gov.ph>
@ 2002-06-06 11:48 ` Bruno Wolff III <bruno@wolff.to>
  2002-06-07 00:51   ` Re: how to reset serials Joseph Syjuco <joseph@asti.dost.gov.ph>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruno Wolff III @ 2002-06-06 11:48 UTC (permalink / raw)
  To: Joseph Syjuco <joseph@asti.dost.gov.ph>; +Cc: pgsql-sql

On Thu, Jun 06, 2002 at 20:03:49 -0400,
  Joseph Syjuco <joseph@asti.dost.gov.ph> wrote:
> how can i reset my serial field to 0.  Tried using setval but it only
> allows setting of my next serial to 2
> joseph



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

* Re: how to reset serials
  2002-06-07 00:03 how to reset serials Joseph Syjuco <joseph@asti.dost.gov.ph>
  2002-06-06 11:48 ` Re: how to reset serials Bruno Wolff III <bruno@wolff.to>
@ 2002-06-07 00:51   ` Joseph Syjuco <joseph@asti.dost.gov.ph>
  0 siblings, 0 replies; 3+ messages in thread

From: Joseph Syjuco @ 2002-06-07 00:51 UTC (permalink / raw)
  To: Bruno Wolff III <bruno@wolff.to>; +Cc: pgsql-sql

thanks for the tip ... im close to dropping and recreating my table
Bruno Wolff III wrote:
> 
> On Thu, Jun 06, 2002 at 20:03:49 -0400,
>   Joseph Syjuco <joseph@asti.dost.gov.ph> wrote:
> > how can i reset my serial field to 0.  Tried using setval but it only
> > allows setting of my next serial to 2
> > joseph
> 
> >From the 7.2.1 documentation:
> SELECT setval('foo', 42);           Next nextval() will return 43
> SELECT setval('foo', 42, true);     Same as above
> SELECT setval('foo', 42, false);    Next nextval() will return 42
> 
> So you want to use (assuming you really want the next value to be 1):
> SELECT setval('your_sequence', 1, false);



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


end of thread, other threads:[~2002-06-07 00:51 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-07 00:03 how to reset serials Joseph Syjuco <joseph@asti.dost.gov.ph>
2002-06-06 11:48 ` Bruno Wolff III <bruno@wolff.to>
2002-06-07 00:51   ` Joseph Syjuco <joseph@asti.dost.gov.ph>

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