Skip to content

Commit

Permalink
Fix GetSchemata so that simple users can query schema list.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjiuno committed Dec 12, 2013
1 parent 806c6d8 commit 26508cf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Npgsql/NpgsqlSchema.cs
Expand Up @@ -155,7 +155,14 @@ internal static DataTable GetSchemata(NpgsqlConnection conn, string[] restrictio

StringBuilder getSchemata = new StringBuilder();

getSchemata.Append("SELECT catalog_name, schema_name, schema_owner FROM information_schema.schemata");
getSchemata.Append(
@"select * from(
select current_database() as catalog_name,
nspname AS schema_name,
r.rolname AS schema_owner
from
pg_catalog.pg_namespace left join pg_catalog.pg_roles r on r.oid = nspowner
) tmp");

using (
NpgsqlCommand command =
Expand Down

0 comments on commit 26508cf

Please sign in to comment.