File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
web/pgadmin/utils/driver/psycopg3 Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2020from psycopg .adapt import Loader
2121from ipaddress import ip_address , ip_interface
2222from psycopg ._encodings import py_codecs as encodings
23+ from psycopg .pq import Format as _pq_Format
2324
2425configure_driver_encodings (encodings )
2526
@@ -176,6 +177,12 @@ def register_binary_typecasters(connection):
176177 connection .adapters .register_loader (1001 ,
177178 ByteaLoader )
178179
180+ connection .adapters .register_loader (17 ,
181+ ByteaBinaryLoader )
182+
183+ connection .adapters .register_loader (1001 ,
184+ ByteaBinaryLoader )
185+
179186
180187def register_array_to_string_typecasters (connection = None ):
181188 type_array = PSYCOPG_SUPPORTED_BUILTIN_ARRAY_DATATYPES + \
@@ -212,6 +219,13 @@ def load(self, data):
212219 return 'binary data' if data is not None else None
213220
214221
222+ class ByteaBinaryLoader (Loader ):
223+ format = _pq_Format .BINARY
224+
225+ def load (self , data ):
226+ return 'binary data' if data is not None else None
227+
228+
215229class TextLoaderpgAdmin (TextLoader ):
216230 def load (self , data ):
217231 postgres_encoding , python_encoding = get_encoding (
You can’t perform that action at this time.
0 commit comments