-2

I have this function

I have this function:

how i use it without a trigger ?

2
  • Please include code and output as content for your question, not as pictures or external links. Commented Dec 13, 2018 at 16:18
  • Please read meta.stackoverflow.com/questions/285551/… and the accepted answer Commented Dec 13, 2018 at 19:26

2 Answers 2

0

There are a few possible alternatives doing so without a trigger, it depends on when you want to call this function.

using cron:

*/15 * * * * psql -d mydatabase -c "interv()"

using LISTEN: https://www.postgresql.org/docs/current/sql-listen.html

Sign up to request clarification or add additional context in comments.

1 Comment

Also, please refer to this topic. It talks about MVs, but I see this as a similar concept stackoverflow.com/questions/29437650/…
-2

Functions are used throughout your database, they can be called from within stored procedures as well. Functions should return something. So if you have a date in one format and want to convert it into a different format, you can create a function that does just that, and 'call' that function within a stored procedure, for example.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.