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

* reset sequence
@ 2002-09-11 20:02 Ricardo Javier Aranibar León <ricardo_jal@hotmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Ricardo Javier Aranibar León @ 2002-09-11 20:02 UTC (permalink / raw)
  To: pgsql-sql

Hi List,

I need that somebody help me.
First, I use PostgreSQL 7.0.3 for linux.
I need reset my sequence but that it begin in 1 again when a use nextval.
And I have been search in http://archives.postgresql.org/ about reset 
sequence but I obtain this information:
   SELECT setval('name_sequence', 1, false);

Now when I execute this command I have a message ERROR.
"ERROR: Function 'setval(unknow, int4, bool)' does not exist. Unable to 
identify a function that satisfies the given argument types. You may need to 
add explicit typecast".


_________________________________________________________________
MSN. Más Útil cada Día. http://www.msn.es/intmap/




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

* Re: reset sequence
@ 2002-09-12 10:28 Michael Paesold <mpaesold@gmx.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paesold @ 2002-09-12 10:28 UTC (permalink / raw)
  To: Ricardo Javier Aranibar León <ricardo_jal@hotmail.com>; +Cc: pgsql-sql

Ludwig Lim wrote:

> --- Ricardo Javier Aranibar León
> <ricardo_jal@hotmail.com> wrote:
> > Hi List,
> >
> > I need that somebody help me.
> > First, I use PostgreSQL 7.0.3 for linux.
> > I need reset my sequence but that it begin in 1
> > again when a use nextval.
> > And I have been search in
> > http://archives.postgresql.org/ about reset
> > sequence but I obtain this information:
> >    SELECT setval('name_sequence', 1, false);
>
> try SELECT setval('name_sequence',1);

That will probably set the current value to 1, which will result in a
nextval of 2, which is perhaps not what Ricardo wanted.

> Maybe setval(<text>,<bigint>,<bool>) doesn't exist in
> 7.0.3.

\df setval
in psql should output all possible parameter combinations for setval.

Regards,
Michael Paesold





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


end of thread, other threads:[~2002-09-12 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11 20:02 reset sequence Ricardo Javier Aranibar León <ricardo_jal@hotmail.com>
2002-09-12 10:28 Re: reset sequence Michael Paesold <mpaesold@gmx.at>

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