Sad,  in my ability, there is no way can reproduce this if not use zhparser.

  i still consider some incompatible things exists when do UPDATE use 
DB.run on sequel, e.g. pg function, triggers or others, 
because use pg gem always work.

the last try, maybe there exists some clue on "DB.run("SELECT 
sync_zhprs_custom_word();")"

could you please check this function?

```
CREATE or REPLACE FUNCTION sync_zhprs_custom_word() RETURNS void LANGUAGE 
plpgsql AS 
$$ 
declare 
data_dir text; 
dict_path text; 
time_tag_path text; 
query text; 
begin 
select setting from pg_settings where name='data_directory' into data_dir; 

select data_dir || '/base/' || '/zhprs_dict_' || current_database() || '.txt
' into dict_path; 
select data_dir || '/base/' || '/zhprs_dict_' || current_database() || '.tag
' into time_tag_path; 

query = 'copy (select word, tf, idf, attr from zhparser.zhprs_custom_word) 
to ' || chr(39) || dict_path || chr(39) || ' encoding ' || chr(39) || 'utf8' 
|| chr(39) ; 
execute query; 
query = 'copy (select now()) to ' || chr(39) || time_tag_path || chr(39) ; 
execute query; 
end; 
$$; 

```


i think debug this issue is easy if we can know  the exactly SQL send to pg 
when do `DB.run("????")`,  if i can suppose it must not same as
`pg_conn.exec("????")`, right? so, could you please help on print the real 
SQL when use with DB.run ?

thank you.




在2021年11月22日星期一 UTC+8 上午4:07:31<Jeremy Evans> 写道:

> On Sun, Nov 21, 2021 at 5:54 AM Billy Zheng <vil...@gmail.com> wrote:
>
>>
>> Hi,  please check.  
>> https://gist.github.com/zw963/212654fc1180d39be1d818392c96bb68
>>
>> BTW: 
>>
>> For accurately reproduce the problem, zhparser and scws had to be 
>> installed, which used as chinese ts config,  you can check how to make
>> and install it from that gist.
>>
>
> Sorry, I cannot take time to review/debug unless Sequel is the only 
> dependency.  If you cannot reproduce without zhparser and scws, I'm afraid 
> I won't be able to help.
>
> Thanks,
> Jeremy 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/4a0a650a-3faf-4eab-859f-3a3ec00cb9d7n%40googlegroups.com.

Reply via email to