mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-14 19:21:46 +03:00
Change EstimatedTableRowsCount query
This commit is contained in:
parent
974570c79e
commit
808f6eea33
@ -222,7 +222,8 @@ func (client *Client) TableRows(table string, opts RowsOptions) (*Result, error)
|
||||
}
|
||||
|
||||
func (client *Client) EstimatedTableRowsCount(table string, opts RowsOptions) (*Result, error) {
|
||||
sql := fmt.Sprintf(`SELECT reltuples FROM pg_class WHERE relname = '%s'`, table)
|
||||
schema, table := getSchemaAndTable(table)
|
||||
sql := fmt.Sprintf(`SELECT reltuples FROM pg_class WHERE oid = '%s.%s'::regclass;`, schema, table)
|
||||
|
||||
result, err := client.query(sql)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user