class_docstr: Extend PostgresHook for working with PostgreSQL and pgvector extension for vector data types.
docstr: Create a PostgreSQL extension.
  
  :param extension_name: The name of the extension to create.
  :param if_not_exists: If True, only create the extension if it does not already exist.
code: def create_extension(
      self, extension_name: str, if_not_exists: bool = True
  ) -> None:
      """
      Create a PostgreSQL extension.
  
      :param extension_name: The name of the extension to create.
      :param if_not_exists: If True, only create the extension if it does not already exist.
      """
      create_extension_sql = "CREATE EXTENSION"
      if if_not_exists:
          create_extension_sql = f"{create_extension_sql} IF NOT EXISTS"
      create_extension_sql = f"{create_extension_sql} {extension_name}"
      self.run(create_extension_sql)
  
file_path: airflow/airflow/providers/pgvector/hooks/pgvector.py
imports: from __future__ import annotations
  from airflow.providers.postgres.hooks.postgres import PostgresHook
label_desc: Use image node_id 3 for calling the PgVectorHook obj's underlying member method code with example usage: obj.create_extension(extension_name, if_not_exists) without return types