Supabase SQL编辑器上游请求超时

huangapple go评论67阅读模式
英文:

Supabase SQL Editor upstream request timeout

问题

我试图为近 150,000 行创建一个 tsvector 列并添加索引。

alter table notices add column fts_en tsvector GENERATED ALWAYS AS (
   to_tsvector(
        'simple', 
        id || ' ' ||  
        coalesce(title->>'en', '') || ' ' ||  
        array_to_string_immutable(title_short, ' '::text) 
     )  
    ) STORED;

create index gin_fts_en on notices using gin (fts_en);

 Supabase 在线 SQL 编辑器中运行此代码返回以下错误:

upstream request timeout


但实际上所有的 tsvector 行都已正确创建并正确索引。

我成功地通过以下方式更新并检查了更长的超时时间:

alter role postgres set statement_timeout = '240s';

SELECT *
FROM   pg_settings
WHERE  name = 'statement_timeout';

但在线 Supabase SQL 编辑器中仍然出现错误消息。
英文:

I am trying to create a column of ts vecotrs for almost 150 000 rows and add index.

alter table notices add column fts_en tsvector GENERATED ALWAYS AS (
   to_tsvector(
        'simple', 
        id || ' ' ||  
        coalesce(title->>'en', '') || ' ' ||  
        array_to_string_immutable( title_short,' '::text) 
     )  
    ) STORED;

create index gin_fts_en on notices using gin (fts_en);

Running this in Supabase online SQL editor returnes this error:

upstream request timeout

But in fact all ts vectors rows were created correctly and indexed properly as well.

I sucesfully updated and checked longer timeout using:

alter role postgres set statement_timeout = '240s';

SELECT *
FROM   pg_settings
WHERE  name = 'statement_timeout';

But the error measage in online Supabase SQL edirot is still there.

答案1

得分: 3

经过与Supabase支持的讨论,目前似乎没有办法更改Supabase在线SQL编辑器的超时时间,它为15秒。

唯一的解决办法是使用标准API运行“耗时”的语句(我设置了一个简单的Node应用程序来处理此类服务查询),而不是使用Supabase在线编辑器。API的超时时间可以按照Supabase文档 - 超时进行更改。

英文:

So after discussion with Supabase supoort it seems at this time there is no way to change timeout of the Supabase online SQL editor which is 15s.

The only workouaround is to run "time consuming" statements using standard API (I set up simple node app for such service queries) and not using Supabase online editor. The timeouts from API can be changed following Supabase Documentation - Timeouts

huangapple
  • 本文由 发表于 2023年6月11日 21:09:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76450610.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定