agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
perform setval() fails?
2+ messages / 2 participants
[nested] [flat]

* perform setval() fails?
@ 2020-11-20 17:00 Sebastien FLAESCH <sf@4js.com>
  2020-11-20 17:01 ` Re: perform setval() fails? Christophe Pettus <xof@thebuild.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Sebastien FLAESCH @ 2020-11-20 17:00 UTC (permalink / raw)
  To: pgsql-sql@lists.postgresql.org

Hello!

What I am missing here?


test1=> perform setval('mytab1_pkey_seq',5000,false);
ERROR:  syntax error at or near "perform"
LINE 1: perform setval('mytab1_pkey_seq',5000,false);
         ^



test1=> select setval('mytab1_pkey_seq',5000,false);
  setval
--------
    5000
(1 row)



Seb





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

* Re: perform setval() fails?
  2020-11-20 17:00 perform setval() fails? Sebastien FLAESCH <sf@4js.com>
@ 2020-11-20 17:01 ` Christophe Pettus <xof@thebuild.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Christophe Pettus @ 2020-11-20 17:01 UTC (permalink / raw)
  To: Sebastien FLAESCH <sf@4js.com>; +Cc: pgsql-sql@lists.postgresql.org



> On Nov 20, 2020, at 09:00, Sebastien FLAESCH <sf@4js.com> wrote:
> test1=> perform setval('mytab1_pkey_seq',5000,false);
> ERROR:  syntax error at or near "perform"
> LINE 1: perform setval('mytab1_pkey_seq',5000,false);

PERFORM is a PL/pgSQL operation, and can only be used within a PL/pgSQL function.  For a direct call to PostgreSQL, SELECT is the right operation.

--
-- Christophe Pettus
   xof@thebuild.com






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


end of thread, other threads:[~2020-11-20 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 17:00 perform setval() fails? Sebastien FLAESCH <sf@4js.com>
2020-11-20 17:01 ` Christophe Pettus <xof@thebuild.com>

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