-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault when running COPY statement #309
Comments
Here's some more info I was able to grab. core_backtrace: |
With debug3, I see this log |
Old school debugging with logs shows: |
My suspicion is that this is caused by lack of implementation of BeginForeignInsert and EndForeignInsert. This is judging by the debug logs (almost none print for COPY vs INSERT) |
Yes, absolutely. I'll see if I can add support, otherwise I'll just forbid |
This capability was introduced to PostgreSQL in commit 3d956d9562aa4811b5eaaaf5314d361c61be2ae0 in v11. Attempting COPY on a foreign table crashed PostgreSQL before this patch, as reported by "jkldv" in #309. This patch is still incomplete: - too little testing - crashes if there is an AFTER INSERT trigger - no regression tests yet
This was more work than I expected. |
Worked perfectly! Thank you very much for your help. Before:
After:
|
When I try to execute a COPY to a oracle_fdw foreign table, the thread crashes with segmentation fault. When I use postgres_fdw foreign table, this operation works fine and results in INSERT statements to the remote postgres database table.
[oracle_fdw]$ cat tmp | psql testdb_remote postgres -c 'copy garbage from stdin'
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
Postgres log isn't terribly enlightening (and yes, my table is literally named 'garbage'):
2019-04-16 12:00:17.523 CDT [30505] LOG: server process (PID 26078) was terminated by signal 11: Segmentation fault
2019-04-16 12:00:17.523 CDT [30505] DETAIL: Failed process was running: copy garbage from stdin
2019-04-16 12:00:17.523 CDT [30505] LOG: terminating any other active server processes
2019-04-16 12:00:17.524 CDT [22378] WARNING: terminating connection because of crash of another server process
I'm pretty sure COPY should be allowed from experience with another FDW:
[postgres_fdw]$ cat tmp | psql testdb postgres -c 'copy rel_11.garbage from stdin'
COPY 1
The text was updated successfully, but these errors were encountered: