与服务器的连接已丢失错误

问题描述

任何想法,为什么要在服务器托管的数据库上运行复杂的查询,该查询就能正确执行。但是,如果我在本地相同数据库的备份版本上运行相同的确切查询,则会收到与服务器的连接已丢失错误

作为参考,我正在使用pgAdmin 4在Mac上的本地数据库上运行此查询。我正在从Mac上但在服务器上的db上使用pgAdmin 4运行相同的查询

SELECT final_view.id,final_view.na_averages,final_view.na_start_freq,final_view.na_stop_freq
from crosstab(  
'with sorted_data as(with current_data as
                (select distinct on (id,sensor_name)
                     id,sensor_name,value_cal,timestamp
                from sensor_double_precision
                where sensor_name in (''na_start_freq'',''na_stop_freq'',''na_averages'')
                order by id,timestamp asc)
                select
              m.id,s.sensor_name,s.value_cal
            from v_na_measurement_status m
            inner join current_data s on s.timestamp
              between m.start_measurement and m.stop_measurement order by s.timestamp asc),log_ids as (
        select distinct id from sorted_data
    ),sensor_names as (
        select distinct sensor_name from sorted_data
    )
    select log_ids.id,sensor_names.sensor_name,sorted_data.value_cal
    from log_ids cross join sensor_names
    left join sorted_data on 
    (log_ids.id= sorted_data.id and sensor_names.sensor_name=sorted_data.sensor_name)'
    )
    final_view(id integer,na_averages double precision,na_start_freq double precision,na_stop_freq double precision)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)