Coder Social home page Coder Social logo

psql-hooks's Introduction

๐Ÿ‘‹ Hi there, Iโ€™m Tami (she/her) ๐Ÿ’œ

I'm a rust dev, love distributed systems, compilers, tooling & documentation.

Nice to meet you! Let's build something together :3

psql-hooks's People

Contributors

amatanhead avatar mnahkies avatar notwhaleb avatar taminomara avatar tsinghualucky912 avatar xzyaoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psql-hooks's Issues

SPI_execute failing in ClientAuthentication_hook

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.

my_client_auth.c.txt

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.

Add this to the official PostgreSQL documentation

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.