WillAyd commented on code in PR #868:
URL: https://github.com/apache/arrow-adbc/pull/868#discussion_r1256108212


##########
c/driver/postgresql/statement.cc:
##########
@@ -255,6 +252,45 @@ struct BindStream {
 
   AdbcStatusCode Prepare(PGconn* conn, const std::string& query,
                          struct AdbcError* error) {
+    // tz-aware timestamps require special handling to set the timezone to UTC
+    // prior to sending over the binary protocol; must be reset after execute
+    for (int64_t col = 0; col < bind_schema->n_children; col++) {
+      if ((bind_schema_fields[col].type == 
ArrowType::NANOARROW_TYPE_TIMESTAMP) &&
+          (strcmp("", bind_schema_fields[col].timezone))) {
+        has_tz_field = true;
+
+        PGresult* begin_result = PQexec(conn, "BEGIN");

Review Comment:
   As far as autocommit goes I do think you are right about that being murky. 
I'm not sure how to best resolve that yet either - beginning / ending the 
transaction here within the `BindStream` class is probably at odds with most of 
the autocommit stuff being managed via the connection.
   
   Are there tests already for autocommit in the ADBC suite? I was looking for 
a reference on how those are expected to behave. Wasn't sure if I was 
overlooking those of if it is something that hasn't been heavily implemented yet



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to