You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I define a custom citext type provided by postgres as an extension in code? The example provided in this video does not work. This code does not compile https://www.youtube.com/watch?v=-1zbaxuUsMA
Hi, the video is quite outdated now. There have been many API changes since then. Examples provided there will compile only with the library version of that time. So I wouldn't rely on specific code examples there, only on some principles.
Your code example does not compile because connection_info type has const OidMap template parameter. It should have a non-const OidMap parameter because it modifies the map when a custom type oid is received from the server. I suggest to declared it as a non-const:
Thanks for the quick response.
Several more questions arose.
1) If during a transaction from the request or execute function I receive an error and I want to throw an exception without calling commit. Is it safe to do this, will not the connection allocated for the transaction hang?
2) As I understand it, make_query can be used instead of _SQL literals to query the build at compile time. But how can you collect a query at runtime?
Unfortunately, I have not found an answer to this question either in the documentation or in the examples.
3) While the connection object is alive, the postgres connection descriptor is held by it and is not used elsewhere, or while the connection object is alive, the descriptor used in it can be used by other connection objects?
How do I define a custom citext type provided by postgres as an extension in code? The example provided in this video does not work. This code does not compile
https://www.youtube.com/watch?v=-1zbaxuUsMA
The text was updated successfully, but these errors were encountered: