Comments (2)
Well I just tried rebuilding the foreign table set after mapping both users to the server.
I got some interesting results - including a return of data in JetBrains Rider that looked like the data was coming back but then the postgres instance gave an error back a few seconds after the data was returned in the SQL Console view.
[2024-09-09 12:13:08] Connected
medptd.public> set search_path = "public"
[2024-09-09 12:13:09] completed in 72 ms
medptd.public> SELECT
EXTRACT(Year FROM Year) as Year,
ROUND(AVG(Total_Drug_Cost_Per_Day), 2) as Avg_Total_Drug_Cost_Per_Day,
ROUND(AVG(Over_65_Total_Drug_Cost_Per_Day), 2) as Over_65_Avg_Total_Drug_Cost_Per_Day
FROM
cms_view
WHERE
EXTRACT(Year FROM Year) = 2017
GROUP BY
YEAR,
Total_Drug_Cost_Per_Day,
Over_65_Total_Drug_Cost_Per_Day
ORDER BY AVG_Total_Drug_Cost_Per_Day DESC
[2024-09-09 12:14:13] An I/O error occurred while sending to the backend.
[2024-09-09 12:14:13] Unrecoverable error received, the connection is spoiled
Here's what the tail on the log has to say
postgres@cmspsql:~$ sudo tail -f /var/log/postgresql/postgresql-16-main.log
2024-09-09 16:14:15.665 UTC [5212] LOG: terminating any other active server processes
2024-09-09 16:14:15.716 UTC [5212] LOG: all server processes terminated; reinitializing
2024-09-09 16:14:15.730 UTC [5317] LOG: database system was interrupted; last known up at 2024-09-09 16:12:47 UTC
2024-09-09 16:14:15.764 UTC [5317] LOG: database system was not properly shut down; automatic recovery in progress
2024-09-09 16:14:15.767 UTC [5317] LOG: redo starts at 0/1F071F0
2024-09-09 16:14:15.767 UTC [5317] LOG: invalid record length at 0/1F07250: expected at least 24, got 0
2024-09-09 16:14:15.767 UTC [5317] LOG: redo done at 0/1F07218 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2024-09-09 16:14:15.770 UTC [5318] LOG: checkpoint starting: end-of-recovery immediate wait
2024-09-09 16:14:15.779 UTC [5318] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.003 s, sync=0.001 s, total=0.011 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB; lsn=0/1F07250, redo lsn=0/1F07250
2024-09-09 16:14:15.783 UTC [5212] LOG: database system is ready to accept connections
2024-09-09 16:19:10.204 UTC [5347] postgres@medptd ERROR: failed to open SQLite DB. rc=1 path=/home/postgres/medptd.db
2024-09-09 16:19:10.204 UTC [5347] postgres@medptd STATEMENT: SELECT
EXTRACT(Year FROM Year) as Year,
ROUND(AVG(Total_Drug_Cost_Per_Day), 2) as Avg_Total_Drug_Cost_Per_Day,
ROUND(AVG(Over_65_Total_Drug_Cost_Per_Day), 2) as Over_65_Avg_Total_Drug_Cost_Per_Day
FROM
cms_view
WHERE
EXTRACT(Year FROM Year) = 2017
GROUP BY
YEAR,
Total_Drug_Cost_Per_Day,
Over_65_Total_Drug_Cost_Per_Day
ORDER BY AVG_Total_Drug_Cost_Per_Day DESC
[tail still active and not further info when sending other queries]
The good news is that when I restart the server and query for row counts on the main view from either user the queries return a good value,.
postgres@cmspsql:~$ psql -d medptd;
psql (16.4 (Debian 16.4-1.pgdg120+1))
Type "help" for help.
medptd=# SELECT COUNT(*) from cms_view;
count
-----------
249489396
(1 row)
medptd=# exit
postgres@cmspsql:~$ su - cmsadmin
Password:
cmsadmin@cmspsql:~$ psql -d medptd
psql (16.4 (Debian 16.4-1.pgdg120+1))
Type "help" for help.
medptd=# SELECT COUNT(*) FROM cms_view;
count
-----------
249489396
(1 row)
HOWEVER when running a query that has some calculations in it postgres hangs.
medptd=# SELECT
EXTRACT(Year FROM Year) as Year,
ROUND(AVG(Total_Drug_Cost_Per_Day), 2) as Avg_Total_Drug_Cost_Per_Day,
ROUND(AVG(Over_65_Total_Drug_Cost_Per_Day), 2) as Over_65_Avg_Total_Drug_Cost_Per_Day
FROM
cms_view
WHERE
EXTRACT(Year FROM Year) = 2017
GROUP BY
YEAR,
Total_Drug_Cost_Per_Day,
Over_65_Total_Drug_Cost_Per_Day
ORDER BY AVG_Total_Drug_Cost_Per_Day DESC;
ERROR: failed to open SQLite DB. rc=1 path=/home/postgres/medptd.db
from duckdb_fdw.
And just to round out the picture - the same "single view" query with aggregates runs without issue against the view in the DuckDB CLI.
from duckdb_fdw.
Related Issues (20)
- Undefined symbol linking DuckDB 0.9.2 HOT 4
- compile error for PostgreSQL 14 HOT 1
- IMPORT FOREIGN SCHEMA fails with "Ambiguous reference to catalog or schema"
- Create Github release for latest version or git tag versions HOT 1
- support UUID type HOT 1
- create extension error on PG 14 HOT 2
- ERROR on PolarDB 11.9 HOT 2
- compile duckdb_fdw error use libduckdb 0.10.0 HOT 2
- could you add support to greenplum 6? HOT 1
- concurrent read&write HOT 2
- failed to open sqlite db error HOT 2
- [question] Correct way to integrate with external database in remote storage (GCS) HOT 2
- no output and no errors HOT 2
- cannot find -lduckdb HOT 2
- Does duckdb v0.10.2 is supported? HOT 1
- Duckdb_fdw how to directly read the data of the table in postgresql for data analysis, please give a specific implementation example, thank you HOT 1
- Runtime crash with libduckdb 1.0.0 HOT 1
- Can't trunk install
- g++ error (solved locally)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duckdb_fdw.