Results 1 to 5 of 5

Thread: pl/pgsql

  1. #1
    Join Date
    Dec 2011
    Posts
    2

    Question Unanswered: pl/pgsql

    hello
    i want to create a script which could activate itself when a condition in a table is met. whell my problem is that i didn;t found a way to create a such script, another ideea would be that to create a function which check a table each second and if a condition is met to run another function.
    the last option is acceptabe thus the first one is ideeal
    the real problem is that for second solution (to run a script each second) i found such thing only in oracle pl/sql(dbms sheduler), so i'm asking : is there something similar for pl/pgsql to do that?
    of, if you have a solution for first case (the autocheck) please let me know

  2. #2
    Join Date
    Dec 2011
    Posts
    13
    There is pgAgent (http://www.pgadmin.org/docs/1.8/pgagent.html), have a look.

    Dmitry
    --

    http://www.sqlines.com - Free online SQL conversion tool

  3. #3
    Join Date
    Dec 2011
    Posts
    13
    Quote Originally Posted by rradu View Post
    hello
    i want to create a script which could activate itself when a condition in a table is met.
    Is it DML condition (INSERT/UPDATE/DELETE on table)? Probably you can use a trigger (CREATE TRIGGER). They were invented for this

    Dmitry
    --

    http://www.sqlines.com - Free online SQL conversion tool

  4. #4
    Join Date
    Dec 2011
    Posts
    2
    thanck you for your help but i don't think that will help me:
    in pgadmin i didn't see such thing as interfal of one second, he is mostly like a cron job, with minimum 1 minute interval
    secondly trigers are not a option since this this action will start when a value in a table will be equal with system time, not on a update/delete etc...

    anyway here is oracle's dbms_scheduler they can run a scripteach second, i hope there is a similar thing in postgres to do that

  5. #5
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by rradu View Post
    anyway here is oracle's dbms_scheduler they can run a scripteach second, i hope there is a similar thing in postgres to do that
    That's what pgAgent is.

    See dm1's first answer (it includes the link)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •