postgresql 是否可以设置posgresql cron作业来调用supabsae edge函数?

xuo3flqw  于 2022-12-18  发布在  PostgreSQL
关注(0)|答案(1)|浏览(168)

我正在尝试使用postresql和supbase边缘函数设置CRON作业。是否可能?此边缘函数正在将数据插入到表中,当使用curl调用时,它工作正常。我发现有http扩展可以对posgresql使用GET或POST。使用此函数时,我收到此错误:

  1. ERROR: function http_post(unknown) does not exist
  2. LINE 4: http_post(
  3. ^
  4. HINT: No function matches the given name and argument types. You might need to add explicit type casts.

这是我的posgresql函数:

  1. select
  2. cron.schedule(
  3. 'api-test-insert',
  4. '15 * * * *',
  5. $$
  6. select status
  7. from
  8. http_post(
  9. '<supabase edge function endpoint URL>'
  10. )
  11. $$
  12. );

感谢您的帮助!
我尝试使用POST和GET来获取结果。我在posgresql cron作业中使用伪API检查GET方法,它返回了成功,并按预期从API返回了一行。我尝试使用GET和POST获取边缘函数,并收到了上述错误结果。

相关问题