Skip to content

Commit d1fdb4c

Browse files
committed
Fix completion crash when tables are created during refresh
1 parent 95203a2 commit d1fdb4c

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Contributors:
147147
* Devadathan M B (devadathanmb)
148148
* Charalampos Stratakis
149149
* Laszlo Bimba (bimlas)
150+
* Shayan Golshani (shgol)
150151

151152
Creator:
152153
--------

changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Bug fixes:
1313
----------
1414
* Add `VERSION` to built-in function completion so `SELECT VERSION();` is suggested.
1515
* Hide timezone notice at startup when local and server timezones are the same.
16+
* Fix completion crash when tables are created during refresh.
1617

1718
4.4.0 (2025-12-24)
1819
==================

pgcli/pgcompleter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def extend_columns(self, column_data, kind):
229229
has_default=has_default,
230230
default=default,
231231
)
232+
metadata.setdefault(schema, {})
233+
metadata[schema].setdefault(relname, OrderedDict())
232234
metadata[schema][relname][colname] = column
233235
self.all_completions.add(colname)
234236

0 commit comments

Comments
 (0)