2020-08-19 14:16:02 +05:30
|
|
|
|
##########################################################################
|
|
|
|
|
#
|
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
|
#
|
2025-01-01 11:26:42 +05:30
|
|
|
|
# Copyright (C) 2013 - 2025, The pgAdmin Development Team
|
2020-08-19 14:16:02 +05:30
|
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
|
#
|
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
|
|
"""Application wide constants."""
|
2021-11-24 17:22:57 +05:30
|
|
|
|
from flask_babel import gettext
|
2020-08-20 17:58:37 +05:30
|
|
|
|
|
|
|
|
|
# Mimetypes
|
|
|
|
|
MIMETYPE_APP_HTML = 'text/html'
|
|
|
|
|
MIMETYPE_APP_JS = 'application/javascript'
|
2022-04-26 16:41:10 +05:30
|
|
|
|
MIMETYPE_APP_JSON = 'application/json'
|
2020-08-20 17:58:37 +05:30
|
|
|
|
|
|
|
|
|
# Preference labels
|
|
|
|
|
PREF_LABEL_KEYBOARD_SHORTCUTS = gettext('Keyboard shortcuts')
|
|
|
|
|
PREF_LABEL_DISPLAY = gettext('Display')
|
2023-04-26 11:18:16 +05:30
|
|
|
|
PREF_LABEL_BREADCRUMBS = gettext('Object Breadcrumbs')
|
2020-08-20 17:58:37 +05:30
|
|
|
|
PREF_LABEL_OPTIONS = gettext('Options')
|
|
|
|
|
PREF_LABEL_EXPLAIN = gettext('Explain')
|
|
|
|
|
PREF_LABEL_EDITOR = gettext('Editor')
|
|
|
|
|
PREF_LABEL_CSV_TXT = gettext('CSV/TXT Output')
|
|
|
|
|
PREF_LABEL_RESULTS_GRID = gettext('Results grid')
|
|
|
|
|
PREF_LABEL_SQL_FORMATTING = gettext('SQL formatting')
|
2020-11-04 17:45:28 +05:30
|
|
|
|
PREF_LABEL_TABS_SETTINGS = gettext('Tab settings')
|
2022-06-22 17:18:51 +05:30
|
|
|
|
PREF_LABEL_REFRESH_RATES = gettext('Refresh rates')
|
2022-06-23 14:52:11 +05:30
|
|
|
|
PREF_LABEL_GRAPH_VISUALISER = gettext('Graph Visualiser')
|
2024-12-16 14:52:56 +05:30
|
|
|
|
PREF_LABEL_USER_INTERFACE = gettext('User Interface')
|
2020-08-19 14:16:02 +05:30
|
|
|
|
|
2022-03-04 17:21:30 +05:30
|
|
|
|
PGADMIN_STRING_SEPARATOR = '_$PGADMIN$_'
|
2020-08-19 14:16:02 +05:30
|
|
|
|
PGADMIN_NODE = 'pgadmin.node.%s'
|
|
|
|
|
UNAUTH_REQ = "Unauthorized request."
|
2020-08-28 18:17:27 +05:30
|
|
|
|
SERVER_CONNECTION_CLOSED = gettext(
|
|
|
|
|
'Not connected to server or connection with the server has been closed.')
|
2020-09-03 18:35:58 +05:30
|
|
|
|
|
2021-06-07 22:07:51 +05:30
|
|
|
|
# Query tool placeholder
|
|
|
|
|
QT_DEFAULT_PLACEHOLDER = '%DATABASE%/%USERNAME%@%SERVER%'
|
2022-04-07 17:36:56 +05:30
|
|
|
|
VW_EDT_DEFAULT_PLACEHOLDER = '%SCHEMA%.%TABLE%/%DATABASE%/%USERNAME%@%SERVER%'
|
2021-06-07 22:07:51 +05:30
|
|
|
|
|
2020-09-03 18:35:58 +05:30
|
|
|
|
# Data Types
|
|
|
|
|
DATATYPE_TIME_WITH_TIMEZONE = 'time with time zone'
|
|
|
|
|
DATATYPE_TIME_WITHOUT_TIMEZONE = 'time without time zone'
|
|
|
|
|
|
|
|
|
|
DATATYPE_TIMESTAMP_WITH_TIMEZONE = 'timestamp with time zone'
|
|
|
|
|
DATATYPE_TIMESTAMP_WITHOUT_TIMEZONE = 'timestamp without time zone'
|
|
|
|
|
|
|
|
|
|
# Error Messages
|
|
|
|
|
ERROR_MSG_TRANS_ID_NOT_FOUND = gettext(
|
|
|
|
|
'Transaction ID not found in the session.')
|
2020-09-07 17:56:02 +05:30
|
|
|
|
|
2023-12-27 13:36:20 +05:30
|
|
|
|
ERROR_MSG_FAIL_TO_PROMOTE_QT = gettext('FAIL TO PROMOTE VIEW/EDIT DATA '
|
|
|
|
|
'TO QUERY TOOL')
|
|
|
|
|
|
2020-09-07 17:56:02 +05:30
|
|
|
|
# Role module constant
|
|
|
|
|
ERROR_FETCHING_ROLE_INFORMATION = gettext(
|
|
|
|
|
'Error fetching role information from the database server.')
|
2020-10-01 13:29:00 +05:30
|
|
|
|
|
|
|
|
|
ERROR_FETCHING_DATA = gettext('Unable to fetch data.')
|
2021-01-18 16:32:10 +05:30
|
|
|
|
|
2024-05-20 16:54:49 +05:30
|
|
|
|
ERROR_SERVER_ID_NOT_SPECIFIED = gettext('Server ID not specified.')
|
|
|
|
|
|
2021-01-18 16:32:10 +05:30
|
|
|
|
# Authentication Sources
|
|
|
|
|
INTERNAL = 'internal'
|
|
|
|
|
LDAP = 'ldap'
|
|
|
|
|
KERBEROS = 'kerberos'
|
2021-10-12 14:52:30 +05:30
|
|
|
|
OAUTH2 = 'oauth2'
|
|
|
|
|
WEBSERVER = 'webserver'
|
2021-01-18 16:32:10 +05:30
|
|
|
|
|
|
|
|
|
SUPPORTED_AUTH_SOURCES = [INTERNAL,
|
|
|
|
|
LDAP,
|
2021-07-06 13:22:58 +05:30
|
|
|
|
KERBEROS,
|
2021-10-12 14:52:30 +05:30
|
|
|
|
OAUTH2,
|
|
|
|
|
WEBSERVER]
|
2021-06-07 20:36:34 +05:30
|
|
|
|
|
|
|
|
|
BINARY_PATHS = {
|
|
|
|
|
"as_bin_paths": [
|
|
|
|
|
{"version": "130000", "next_major_version": "140000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 13"), "binaryPath": None,
|
2021-09-20 14:59:05 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "140000", "next_major_version": "150000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 14"), "binaryPath": None,
|
2022-05-25 17:43:48 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "150000", "next_major_version": "160000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 15"), "binaryPath": None,
|
2023-11-20 17:31:39 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "160000", "next_major_version": "170000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 16"), "binaryPath": None,
|
2024-06-27 13:18:26 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "170000", "next_major_version": "180000",
|
|
|
|
|
"serverType": gettext("EDB Advanced Server 17"), "binaryPath": None,
|
2021-06-07 20:36:34 +05:30
|
|
|
|
"isDefault": False}
|
|
|
|
|
],
|
|
|
|
|
"pg_bin_paths": [
|
|
|
|
|
{"version": "130000", "next_major_version": "140000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 13"), "binaryPath": None,
|
2021-09-20 14:59:05 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "140000", "next_major_version": "150000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 14"), "binaryPath": None,
|
2022-05-25 17:43:48 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "150000", "next_major_version": "160000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 15"), "binaryPath": None,
|
2023-07-27 17:34:25 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "160000", "next_major_version": "170000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 16"), "binaryPath": None,
|
2024-06-27 13:18:26 +05:30
|
|
|
|
"isDefault": False},
|
|
|
|
|
{"version": "170000", "next_major_version": "180000",
|
|
|
|
|
"serverType": gettext("PostgreSQL 17"), "binaryPath": None,
|
2021-06-07 20:36:34 +05:30
|
|
|
|
"isDefault": False}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UTILITIES_ARRAY = ['pg_dump', 'pg_dumpall', 'pg_restore', 'psql']
|
2021-07-05 12:55:40 +05:30
|
|
|
|
|
|
|
|
|
ENTER_EMAIL_ADDRESS = "Email address: "
|
2022-01-04 12:27:17 +05:30
|
|
|
|
USER_NOT_FOUND = gettext("The specified user ID (%s) could not be found.")
|
2022-05-17 20:32:17 +05:30
|
|
|
|
DATABASE_LAST_SYSTEM_OID = 16383
|
2023-02-15 11:31:29 +05:30
|
|
|
|
|
|
|
|
|
# Drivers
|
|
|
|
|
PSYCOPG3 = 'psycopg3'
|
2023-03-06 17:03:47 +05:30
|
|
|
|
|
|
|
|
|
# Shared storage
|
|
|
|
|
MY_STORAGE = 'my_storage'
|
2023-03-24 11:08:27 +05:30
|
|
|
|
ACCESS_DENIED_MESSAGE = gettext(
|
|
|
|
|
"Access denied: You’re having limited access. You’re not allowed to "
|
|
|
|
|
"Rename, Delete or Create any files/folders")
|
2023-05-22 11:08:29 +05:30
|
|
|
|
|
2023-05-24 18:06:21 +05:30
|
|
|
|
KEY_RING_SERVICE_NAME = 'pgAdmin4'
|
2024-08-22 16:44:57 +05:30
|
|
|
|
KEY_RING_USER_NAME = 'pgadmin4-master-password'
|
2023-05-24 18:06:21 +05:30
|
|
|
|
KEY_RING_USERNAME_FORMAT = KEY_RING_SERVICE_NAME + '-{0}-{1}'
|
|
|
|
|
KEY_RING_TUNNEL_FORMAT = KEY_RING_SERVICE_NAME + '-tunnel-{0}-{1}'
|
|
|
|
|
KEY_RING_DESKTOP_USER = KEY_RING_SERVICE_NAME + '-desktop-user-{0}'
|
2023-06-30 16:08:33 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MessageType:
|
|
|
|
|
SUCCESS = 'Success',
|
|
|
|
|
ERROR = 'Error',
|
|
|
|
|
INFO = 'Info',
|
|
|
|
|
CLOSE = 'Close',
|
|
|
|
|
WARNING = 'Warning'
|
2024-03-18 11:53:59 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DBMS_JOB_SCHEDULER_ID = 999999
|
2024-06-10 18:04:32 +05:30
|
|
|
|
|
|
|
|
|
# String Constants
|
|
|
|
|
IP_ADDRESS_STRING = '{}/{}'
|
|
|
|
|
TWO_PARAM_STRING = '{0}/{1}'
|
|
|
|
|
SERVER_NOT_FOUND = gettext("Could not find the specified server.")
|
2024-12-16 14:52:56 +05:30
|
|
|
|
SSL_MODES = ['prefer', 'require', 'verify-ca', 'verify-full']
|
2025-02-12 16:14:31 +05:30
|
|
|
|
|
|
|
|
|
DATA_TYPE_WITH_LENGTH = [1560, 'bit', 1561, 'bit[]',
|
|
|
|
|
1562, 'varbit', 'bit varying',
|
|
|
|
|
1563, 'varbit[]', 'bit varying[]',
|
|
|
|
|
1042, 'bpchar', 'character',
|
|
|
|
|
1043, 'varchar', 'character varying',
|
|
|
|
|
1014, 'bpchar[]', 'character[]',
|
|
|
|
|
1015, 'varchar[]', 'character varying[]',
|
|
|
|
|
'vector', 'vector[]', 'halfvec', 'halfvec[]',
|
|
|
|
|
'sparsevec', 'sparsevec[]']
|