Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dkuku committed Nov 8, 2023
1 parent da8668a commit e962548
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
18 changes: 9 additions & 9 deletions dbcommands.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ SELECT c.relchecks,
FALSE AS relhasoids,
pg_catalog.array_to_string(c.reloptions || array
(SELECT 'toast.' || x
FROM pg_catalog.unnest(tc.reloptions) x), ', '),
FROM pg_catalog.unnest(tc.reloptions) x), ', ') as suffix,
c.reltablespace,
CASE
WHEN c.reloftype = 0 THEN ''
Expand All @@ -1084,7 +1084,7 @@ SELECT c.relchecks,
c.relhasoids,
pg_catalog.array_to_string(c.reloptions || array
(SELECT 'toast.' || x
FROM pg_catalog.unnest(tc.reloptions) x), ', '),
FROM pg_catalog.unnest(tc.reloptions) x), ', ') as suffix,
c.reltablespace,
CASE
WHEN c.reloftype = 0 THEN ''
Expand All @@ -1105,7 +1105,7 @@ SELECT c.relchecks,
c.relhasoids,
pg_catalog.array_to_string(c.reloptions || array
(SELECT 'toast.' || x
FROM pg_catalog.unnest(tc.reloptions) x), ', '),
FROM pg_catalog.unnest(tc.reloptions) x), ', ') as suffix,
c.reltablespace,
CASE
WHEN c.reloftype = 0 THEN ''
Expand All @@ -1125,9 +1125,9 @@ SELECT c.relchecks,
c.relhasoids,
pg_catalog.array_to_string(c.reloptions || array
(SELECT 'toast.' || x
FROM pg_catalog.unnest(tc.reloptions) x), ', '),
FROM pg_catalog.unnest(tc.reloptions) x), ', ') as suffix,
c.reltablespace,
0 AS reloftype,
'' AS reloftype,
'p' AS relpersistence,
FALSE AS relispartition
FROM pg_catalog.pg_class c
Expand All @@ -1142,25 +1142,25 @@ SELECT c.relchecks,
c.relhasoids,
pg_catalog.array_to_string(c.reloptions || array
(SELECT 'toast.' || x
FROM pg_catalog.unnest(tc.reloptions) x), ', '),
FROM pg_catalog.unnest(tc.reloptions) x), ', ') as suffix,
c.reltablespace,
0 AS reloftype,
'' AS reloftype,
'p' AS relpersistence,
FALSE AS relispartition
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid)
WHERE c.oid = :oid

-- name: describe_one_table_details
-- docs: no suffix here
SELECT c.relchecks,
c.relkind,
c.relhasindex,
c.relhasrules,
c.reltriggers > 0 AS relhastriggers,
c.relhasoids,
'' as suffix,
c.reltablespace,
0 AS reloftype,
'' AS reloftype,
'p' AS relpersistence,
FALSE AS relispartition
FROM pg_catalog.pg_class c
Expand Down
4 changes: 1 addition & 3 deletions pgspecial/dbcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ def _describe_extension(cur, oid):
return

if verbose:
# TODO - use the join query instead of looping.
# May need refactoring some more code.
# cur.execute(queries.list_extensions_verbose.sql, {"pattern": pattern})
extensions = _find_extensions(cur, pattern)

if extensions:
Expand Down Expand Up @@ -377,6 +374,7 @@ def describe_one_table_details(cur, schema_name, relation_name, oid, verbose):

if cur.rowcount > 0:
# TODO if not verbose - drop suffix
# But it seems that the suffix is not included?
tableinfo = TableInfo._make(cur.fetchone())
else:
return None, None, None, f"Did not find any relation with OID {oid}."
Expand Down

0 comments on commit e962548

Please sign in to comment.