I'm a rust dev, love distributed systems, compilers, tooling & documentation.
Nice to meet you! Let's build something together :3
Unofficial documentation for PostgreSQL hooks
License: Other
I'm trying to build an equivalent of a 'logon trigger' in EDB Postgres AS12 - I need a procedure to be run which will set a session level variable in the database session that has just connected. I'm trying to use the ClientAuthentication_hook to make it so.
My idea is to use SPI_connect , SPI_execute and SPI_finish to make this work - I've built a very simplistic bit of code that proves that the hook 'plumbing' works - it is attached (I'm very rusty when it comes to C and this is just a test mule). Note, I had to put a .txt extension on it to get it to attach.
The SPI_connect returns a code of 1 but when SPI_execute runs I get an error in the log ...
2020-12-14 14:29:05 CST WARNING: kdm_us_view
2020-12-14 14:29:05 CST WARNING: HOOK - kdm_us_view user logged in
2020-12-14 14:29:05 CST WARNING: _PG_init() - MyProcPid=71042, MyDatabaseId=0, IsBackgroundWorker=0, isExecutingLogin=0
2020-12-14 14:29:05 CST WARNING: back from SPI_connect 1
**2020-12-14 14:29:05 CST FATAL: cannot read pg_class without having selected a database**
2020-12-14 14:29:05 CST CONTEXT: SQL statement "select dmass38.iglass_test"
I cannot figure out why I'm getting this error - any tips would be appreciated, thanks.
THANK YOU FOR THE HARD WORK!
So I think you should alter this paragraph in Detailed.md
.
To pop the state of the hook created by one extension `_PG_fini` function must be implemented,
which is basically recovers hook to it's value before `_PG_init`.
Did you extract these all manually, or did you find the hook candidates via some repeatable process and then fill them in? If so, please add that process to this repository.
Thanks for your hard work!
Hello,
thank you for this helpfull work !
for information, planner hook has changed in pg13:
https://www.postgresql-archive.org/pgsql-Allow-the-planner-related-functions-and-hook-to-accept-the-query-td6129676.html
PlannedStmt *
-planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
+planner(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams)
Regards
PAscal
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.