Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 47bc396

Browse files
committed
add missing relkind filter
1 parent 3bb2486 commit 47bc396

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ServiceStack.OrmLite.PostgreSQL/PostgreSQLDialectProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public override string ToTableNamesWithRowCountsStatement(bool live, string sche
386386
{
387387
return live
388388
? null
389-
: "SELECT relname, reltuples FROM pg_class JOIN pg_catalog.pg_namespace n ON n.oid = pg_class.relnamespace WHERE nspname = {0}".SqlFmt(this, schema ?? "public");
389+
: "SELECT relname, reltuples FROM pg_class JOIN pg_catalog.pg_namespace n ON n.oid = pg_class.relnamespace WHERE relkind = 'r' AND nspname = {0}".SqlFmt(this, schema ?? "public");
390390
}
391391

392392
public override bool DoesTableExist(IDbCommand dbCmd, string tableName, string schema = null)

0 commit comments

Comments
 (0)