MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / has_oids

Method has_oids

web/pgadmin/tools/sqleditor/command.py:553–583  ·  view source on GitHub ↗

This function checks whether the table has oids or not.

(self, default_conn=None)

Source from the content-addressed store, hash-verified

551 return True
552
553 def has_oids(self, default_conn=None):
554 """
555 This function checks whether the table has oids or not.
556 """
557 driver = get_driver(PG_DEFAULT_DRIVER)
558 manager = driver.connection_manager(self.sid)
559
560 # Remove the special behavior of OID columns from
561 # PostgreSQL 12 onwards, so returning False.
562 if manager.sversion >= 120000:
563 return False
564
565 if default_conn is None:
566 conn = manager.connection(did=self.did, conn_id=self.conn_id)
567 else:
568 conn = default_conn
569
570 if conn.connected():
571
572 # Fetch the table oids status
573 query = render_template(
574 "/".join([self.sql_path, 'has_oids.sql']), obj_id=self.obj_id)
575
576 status, has_oids = conn.execute_scalar(query)
577 if not status:
578 raise ExecuteError(has_oids)
579
580 else:
581 raise InternalServerError(SERVER_CONNECTION_CLOSED)
582
583 return has_oids
584
585 def save(self,
586 changed_data,

Callers 5

get_sqlMethod · 0.95
get_columns_typesMethod · 0.95
start_view_dataFunction · 0.45
pollFunction · 0.45
save_changed_dataFunction · 0.45

Calls 7

get_driverFunction · 0.90
ExecuteErrorClass · 0.90
connection_managerMethod · 0.80
connectionMethod · 0.80
joinMethod · 0.80
connectedMethod · 0.45
execute_scalarMethod · 0.45

Tested by

no test coverage detected