pgx icon indicating copy to clipboard operation
pgx copied to clipboard

Retrieve client warning

Open bersace opened this issue 1 year ago • 1 comments

Hi,

Thanks for pgx. It's awesome.

I wonder how to retrieve client warning. e.g. when revoking a role you're not the grantor:

> REVOKE "writers" FROM "alain";
WARNING:  role "alain" has not been granted membership in role "writers" by role "ldap2pg"
REVOKE ROLE
>

I may fail to found how in the documentation. Can you give me pointer ?

Regards, Étienne

bersace avatar Mar 18 '24 12:03 bersace

You want to set OnNotice when you connect. https://pkg.go.dev/github.com/jackc/pgx/[email protected]/pgconn#Config

jackc avatar Mar 20 '24 23:03 jackc