feat: Add schema filtering for Postgres table col scanning

Modifies the query to ensure it correctly retrieves column names by including the schema check.
This commit is contained in:
Sakura Akeno Isayeki 2025-05-06 12:08:50 +02:00
parent 54b14d6753
commit f479e27da6
No known key found for this signature in database
GPG key ID: BAB781B71FD2E7E6

View file

@ -106,7 +106,7 @@ namespace TShockAPI.DB
case SqlType.Postgres: case SqlType.Postgres:
{ {
// HACK: Using "ilike" op to ignore case, due to weird case issues adapting for pgsql // HACK: Using "ilike" op to ignore case, due to weird case issues adapting for pgsql
using QueryResult reader = database.QueryReader("SELECT column_name FROM information_schema.columns WHERE table_name ILIKE @0", table.Name); using QueryResult reader = database.QueryReader("SELECT column_name FROM information_schema.columns WHERE table_schema=current_schema() AND table_name ILIKE @0", table.Name);
while (reader.Read()) while (reader.Read())
{ {