Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Update pg_cron documentation with examples for calling function #26186

Merged
merged 5 commits into from May 22, 2024

Conversation

thibault-chausson
Copy link
Sponsor Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

Documentation update for the pg_cron extension.

What is the current behavior?

When we use CALL to call a function, an error occurs.

jobid runid job_pid database username command status return_message start_time end_time
1 1 731000 postgres postgres CALL reset_user_quotas() failed ERROR: reset_user_quotas() is not a procedure\nLINE 1: CALL reset_user_quotas()\n ^\nHINT: To call a function, use SELECT.\n 2024-05-08 03:30:00.15997+00 2024-05-08 03:30:00.164664+00

What is the new behavior?

jobid runid job_pid database username command status return_message start_time end_time
1 1 731000 postgres postgres CALL reset_user_quotas() failed ERROR: reset_user_quotas() is not a procedure\nLINE 1: CALL reset_user_quotas()\n ^\nHINT: To call a function, use SELECT.\n 2024-05-08 03:30:00.15997+00 2024-05-08 03:30:00.164664+00
1 2 736555 postgres postgres SELECT reset_user_quotas() succeeded 1 row 2024-05-09 03:30:00.086112+00 2024-05-09 03:30:00.092458+00

Additional context

To assist other users, I have updated the documentation to use SELECT to call a function, and CALL for a stored procedure.

Additionally, I specified that the cron.schedule() function can be used to modify a cron : pg_cron documentation.

Copy link

vercel bot commented May 12, 2024

@thibault-chausson is attempting to deploy a commit to the Supabase Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@charislam charislam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charislam charislam enabled auto-merge (squash) May 13, 2024 18:52
Copy link

vercel bot commented May 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 7:54pm
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 7:54pm
zone-www-dot-com ❌ Failed (Inspect) May 14, 2024 7:54pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
studio ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 7:54pm
studio-self-hosted ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 7:54pm

@thibault-chausson
Copy link
Sponsor Contributor Author

You're welcome @charislam!
I'm sorry I updated my branch, but I didn't think Vercel authorized a particular commit.
Sorry again!

@charislam
Copy link
Contributor

No problem @thibault-chausson! For the future, it's best not to push to the branch after approval (unless of course you want to make more changes 😄), otherwise we have to reapprove the Vercel checks.

But it's a very minor problem, so don't worry about it! We appreciate your help!

@thibault-chausson
Copy link
Sponsor Contributor Author

thibault-chausson commented May 14, 2024

Thanks for these explanations!
What is "zone-www-dot-com" ?

@charislam
Copy link
Contributor

Ahh, that's the main supabase.com website. That failure looks like a fluke, I just reran the check and hopefully this will merge 🤞🏼

@charislam charislam merged commit f5324af into supabase:master May 22, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants