Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/en_US/images/type_range.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/en_US/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ notes for it.
:maxdepth: 1


release_notes_9_9
release_notes_9_8
release_notes_9_7
release_notes_9_6
Expand Down
33 changes: 33 additions & 0 deletions docs/en_US/release_notes_9_9.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
***********
Version 9.9
***********

Release date: 2025-10-16

This release contains a number of bug fixes and new features since the release of pgAdmin 4 v9.8.

Supported Database Servers
**************************
**PostgreSQL**: 13, 14, 15, 16 and 17

**EDB Advanced Server**: 13, 14, 15, 16 and 17

Bundled PostgreSQL Utilities
****************************
**psql**, **pg_dump**, **pg_dumpall**, **pg_restore**: 17.5


New features
************

| `Issue #6394 <https://github.com/pgadmin-org/pgadmin4/issues/6394>`_ - Added "MULTIRANGE_TYPE_NAME" option while creating a Range Type.
| `Issue #6395 <https://github.com/pgadmin-org/pgadmin4/issues/6395>`_ - Added "SUBSCRIPT" option while creating a External Type.

Housekeeping
************


Bug fixes
*********

13 changes: 8 additions & 5 deletions docs/en_US/type_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ On the *Optional-1* tab:
to select a type_modifier_output_function. It is allowed to omit the
type_modifier_output_function, in which case the default display format is the
stored typmod integer value enclosed in parentheses.
* Use the drop-down listbox next to the optional *Analyze function* field to
select a function for performing type-specific statistics collection for
columns of the data type.
* Use the drop-down listbox next to the optional *Subscript function* field to
select a function for allows the data type to be subscripted in SQL commands.
* Use the optional *Internal length* to specify a value for internal
representation.
* Move the *Variable?* switch to specify the internal representation is of
variable length (VARIABLE). The default is a fixed length positive integer.
* Specify a default value in the optional *Default* field in cases where a
column of the data type defaults to something other than the null value.
Specify the default with the DEFAULT key word. (A default can be overridden
by an explicit DEFAULT clause attached to a particular column.)
* Use the drop-down listbox next to the optional *Analyze function* field to
select a function for performing type-specific statistics collection for
columns of the data type.
* Use the drop-down listbox next to the optional *Category type* field to help
control which implicit cast will be applied in ambiguous situations.
* Move the *Preferred?* switch to *Yes* to specify the selected category type is
Expand Down Expand Up @@ -162,6 +162,9 @@ disabled.
values to a canonical form.
* Use the drop-down listbox next to *Sub-type diff function* to select a
user-defined subtype_diff function.
* Specify the optional *Multirange type name* parameter to specifies the
name of the corresponding multirange type. If not specified, this name is
chosen automatically.

If you select *Shell* in the *Type* field, the *Definition* tab displays the
*Shell* panel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ def wrap(*args, **kwargs):

return wrap

def has_dependent_type(self, data):
"""
This function is used to check the type has dependent
on another type.
"""
return ('rngmultirangetype' in data and
data['rngmultirangetype'] is not None and
data['rngmultirangetype'] != '')

@check_precondition
def list(self, gid, sid, did, scid):
"""
Expand Down Expand Up @@ -317,7 +326,8 @@ def node(self, gid, sid, did, scid, tid):
rset['rows'][0]['oid'],
scid,
rset['rows'][0]['name'],
icon=self.icon_str % self.node_type
icon=self.icon_str % self.node_type,
has_dependent=self.has_dependent_type(rset['rows'][0])
)

return make_json_response(
Expand Down Expand Up @@ -359,7 +369,8 @@ def nodes(self, gid, sid, did, scid):
scid,
row['name'],
icon=self.icon_str % self.node_type,
description=row['description']
description=row['description'],
has_dependent=self.has_dependent_type(row)
))

return make_json_response(
Expand Down Expand Up @@ -536,7 +547,8 @@ def additional_properties(self, copy_dict, tid):
enum_list = []
for row in rset['rows']:
properties_list.append(row['enumlabel'])
enum_list.append({'label': row['enumlabel']})
enum_list.append({'label': row['enumlabel'],
'old_label': row['enumlabel']})

# Adding both results in ouput
res['enum_list'] = ', '.join(properties_list)
Expand Down Expand Up @@ -1063,7 +1075,8 @@ def create(self, gid, sid, did, scid):
tid,
scid,
data['name'],
icon="icon-type"
icon="icon-type",
has_dependent=self.has_dependent_type(data)
)
)
except Exception as e:
Expand All @@ -1086,7 +1099,7 @@ def update(self, gid, sid, did, scid, tid):
request.data
)
try:
SQL, name = self.get_sql(gid, sid, data, scid, tid)
SQL, name, has_dependent = self.get_sql(gid, sid, data, scid, tid)
# Most probably this is due to error
if not isinstance(SQL, str):
return SQL
Expand Down Expand Up @@ -1114,6 +1127,7 @@ def update(self, gid, sid, did, scid, tid):
scid,
name,
icon=self.icon_str % self.node_type,
has_dependent=has_dependent,
**other_node_info
)
)
Expand Down Expand Up @@ -1226,11 +1240,15 @@ def msql(self, gid, sid, did, scid, tid=None):
for key, val in req.items():
if key in ['composite', 'enum', 'seclabels', 'typacl']:
data[key] = json.loads(val)
elif key in ['typreceive', 'typsend', 'typmodin', 'typmodout',
'typanalyze', 'typsubscript','typstorage'] and \
val == 'null':
data[key] = json.loads(val)
else:
data[key] = val

try:
sql, _ = self.get_sql(gid, sid, data, scid, tid)
sql, _, _ = self.get_sql(gid, sid, data, scid, tid)
# Most probably this is due to error
if not isinstance(sql, str):
return sql
Expand Down Expand Up @@ -1330,7 +1348,7 @@ def _get_new_sql(self, data, is_sql):
self._CREATE_SQL]),
data=data, conn=self.conn, is_sql=is_sql)

return SQL, data['name']
return SQL, data['name'], False

def get_sql(self, gid, sid, data, scid, tid=None, is_sql=False):
"""
Expand All @@ -1339,6 +1357,8 @@ def get_sql(self, gid, sid, data, scid, tid=None, is_sql=False):
if tid is None:
return self._get_new_sql(data, is_sql)

data = self._convert_for_sql(data)

for key in ['added', 'changed', 'deleted']:
if key in data.get('typacl', []):
data['typacl'][key] = parse_priv_to_db(
Expand Down Expand Up @@ -1411,7 +1431,8 @@ def get_sql(self, gid, sid, data, scid, tid=None, is_sql=False):
data=data, o_data=old_data, conn=self.conn
)

return SQL, old_data['name']
return (SQL, data['name'] if 'name' in data else old_data['name'],
self.has_dependent_type(old_data))

@check_precondition
def sql(self, gid, sid, did, scid, tid, **kwargs):
Expand Down Expand Up @@ -1478,7 +1499,7 @@ def sql(self, gid, sid, did, scid, tid, **kwargs):
if data[k] == '-':
data[k] = None

SQL, _ = self.get_sql(gid, sid, data, scid, tid=None, is_sql=True)
SQL, _, _ = self.get_sql(gid, sid, data, scid, tid=None, is_sql=True)
# Most probably this is due to error
if not isinstance(SQL, str):
return SQL
Expand Down Expand Up @@ -1588,8 +1609,8 @@ def get_sql_from_diff(self, **kwargs):
if data:
if target_schema:
data['schema'] = target_schema
sql, _ = self.get_sql(gid=gid, sid=sid, scid=scid, data=data,
tid=oid)
sql, _, _ = self.get_sql(gid=gid, sid=sid, scid=scid, data=data,
tid=oid)
else:
if drop_sql:
sql = self.delete(gid=gid, sid=sid, did=did,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ define('pgadmin.node.type', [
hasSQL: true,
hasDepends: true,
width: pgBrowser.stdW.md + 'px',
refreshParent: function(node) {
return node?._metadata?.data?.has_dependent;
},
Init: function() {
/* Avoid multiple registration of menus */
if (this.initialized)
Expand Down
Loading
Loading