-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
nil time.Time pointer works in insert, but not in update #23
Comments
After looking at the backtrace, this seems to have little to do with the What's also strange is that on the first run, with an empty database, the It almost seems like the UPDATE statement is inserting rows... am I going crazy? |
Could it be that somehow, there can only be one prepared statement active at a time? And that the INSERT statement is overriding the UPDATE statement? |
Yeah, client did not support multiple statements in 1 transaction. Should be fixed by #24 . I will merge fix later today. Also you are probably interested in |
Support multiple statements within single connection. Fixes #23.
Indeed I was. I already switched to it when I saw it earlier (even before you mentioned it :)). The docs are a bit spartan, but that function name was clear enough. I'll learn to inspect go-pg's source better. |
I have this code:
And the second time I run it, it errors out with:
Note that the
FeedArticle.PublishedOn
member is a nil pointer in this invocation (I checked). What's string is: this seems to work for the INSERT. I checked after a first run and the row is present in the DB (and the PublishedOn column is NULL).Am I doing something wrong?
(I'm using a pointer to
time.Time
because I couldn't find asql.NullTime
type).The text was updated successfully, but these errors were encountered: