I have an net core application that connects to PostgreSQL servers through a PgPool-II cluster. It works very well, exept when I try to use the pgpool sql commands, such as "show pool_nodes", the commands seems to pass by pgpool and instead enter one PostgreSQL server which throws an error (which it should).
It seems that Npgsql uses "Extended Query Protocol" which do not work for the pgpool sql commands. They need the "Simple Query Protocol".
Is there any way to use "Simple Query Protocol" with Npgsql? If not, is there any other way sending a PostgreSQL query with net core but without using Npgsql?
No, there currently isn't a way for you to send a user-specified query via the PostgreSQL simple protocol. Npgsql uses the simple protocol for some internal commands (e.g. COMMIT), but the user-facing query APIs always use the extended protocol.
I'd raise this with PgPool-II, it seems like they should be intercepting extended protocol messages as well - after all it's part of the standard PostgreSQL protocol (please post a link to the issue here). If for some reason it really isn't possible, you can open an issue on the Npgsql repo to add some API for generating simple queries.