Skip to content

GeoDBClient.get_my_usage wrongly implemented #75

@thomasstorm

Description

@thomasstorm

The current implementation takes into account all tables which names are prefixed by the current user name:

RETURN QUERY SELECT JSON_AGG(vals) as src
                 FROM (
                          SELECT pg_size_pretty(SUM(pg_total_relation_size(quote_ident(table_name)))) AS "usage"
                          FROM information_schema.tables
                          WHERE table_schema = 'public'
                            AND table_name LIKE user_name || '%'
                      ) AS vals;

This occurs twice in geodb.sql:

  1. in geodb_get_user_usage(geodb_get_user_usage(user_name text, pretty BOOLEAN))
  2. in geodb_get_user_usage(user_name text)

A correct implementation would consider only those tables owned by the current user.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions