Closed mattadams closed 4 months ago
Both of these statements are run through pg::sqlexec
(via Pg_exec
in pgtclCmds.c
).
Platform is FreeBSD 13.0-RELEASE-p10 with: tcl86-8.6.12 postgresql13-client-13.5 postgresql13-server-13.5
Can you provide the source code that is generating this SQL and error?
I suspect there's a problem in the UTF conversion code (2.7.6) in some code path I missed, so if you can produce a test case it would be extremely helpful.
I will do my best to provide something that replicates it. Unfortunately it is very difficult to reproduce reliably in my environment. Either that, or I'll isolate it myself and provide a patch.
I did see ticket 1bd796d9c2 (multiple issues in Tcl_DString functions) in Tcl 8.6.12 and I am hoping that the problem doesn't stem from this.
I can confirm the problem originates in 2.7.6, and is present in the most current code. For now I've backported the listener fix to 2.7.5 and am using that, but I will keep this on my radar to do something about.
Can you at least provide the Tcl code that generated the errors you listed so I can get an idea of where to look?
The possibility of an underlying bug in Tcl_DString is scary.
Or the parameters to sqlexec?
@mattadams ^
The empty string in the bind error is apparently a PostgreSQL artifact. Which is a pity because I was hoping it would be a useful diagnostic. This stackoverflow article shows it happening with javascript bindings. :(
@mattadams Try branch BCK-6946
Fixed in 3.1.0
When I was using Pgtcl release 2.7.5 everything was quite stable, however I have upgraded to 2.8.0 (comes out as 2.7.7 when compiled) and am encountering intermittent instability.
With 2.8.0, I will get curious errors like this:
and
In the latter case it looks like two separate SQL statements are being intermixed because the actual SQL for the latter comes from:
In this case the actual SQL error makes absolutely no sense, because the bit that reads
extended ->> 'event' = 'appended_at'
comes from another query entirely.Thoughts?