From f479e27da601d854445f94ae3c7e27e26cb888bb Mon Sep 17 00:00:00 2001 From: Sakura Akeno Isayeki Date: Tue, 6 May 2025 12:08:50 +0200 Subject: [PATCH] feat: Add schema filtering for Postgres table col scanning Modifies the query to ensure it correctly retrieves column names by including the schema check. --- TShockAPI/DB/SqlTable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/DB/SqlTable.cs b/TShockAPI/DB/SqlTable.cs index ce955dbf..22591ff8 100644 --- a/TShockAPI/DB/SqlTable.cs +++ b/TShockAPI/DB/SqlTable.cs @@ -106,7 +106,7 @@ namespace TShockAPI.DB case SqlType.Postgres: { // 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()) {