prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Schema getter should return public, but not mathesar_types
  **Describe the bug**
  <!-- A clear and concise description of what the bug is. -->
  
  If a user wants to create a table the `public` schema, they can't currently, because the logic in the `db.schemas.get_all_schemas` function ignores it.  This means when they try, an error is thrown.  This is especially a problem when they've imported a DB, since most tables are in the `public` schema in most installations of PostgreSQL in the wild.
  
  **Expected behavior**
  <!-- A clear and concise description of what you expected to happen. -->
  The public schema should be available for holding mathesar tables.
  
  **To Reproduce**
  Please try to provide a [Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example.
  
  Start the webapp using the README.  Try to upload a CSV to the `public` schema.  See the error.
  
  **Have a nice day!**
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `db/schemas.py`
  Content:
  ```
  1 from sqlalchemy.schema import CreateSchema
  2 from sqlalchemy import inspect
  3 
  4 
  5 def get_all_schemas(engine):
  6     inspector = inspect(engine)
  7     return [
  8         schema
  9         for schema in inspector.get_schema_names()
  10         if schema not in ["public", "information_schema"]
  11     ]
  12 
  13 
  14 def schema_exists(schema, engine):
  15     return schema in get_all_schemas(engine)
  16 
  17 
  18 def create_schema(schema, engine):
  19     """
  20     This method creates a Postgres schema.
  21     """
  22     if not schema_exists(schema, engine):
  23         with engine.begin() as connection:
  24             connection.execute(CreateSchema(schema))
  25
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/db/schemas.py b/db/schemas.py
  --- a/db/schemas.py
  +++ b/db/schemas.py
  @@ -1,24 +1,28 @@
   from sqlalchemy.schema import CreateSchema
   from sqlalchemy import inspect
   
  +from db import types
   
  -def get_all_schemas(engine):
  -    inspector = inspect(engine)
  +TYPES_SCHEMA = types.base.SCHEMA
  +
  +
  +def get_mathesar_schemas(engine):
       return [
           schema
  -        for schema in inspector.get_schema_names()
  -        if schema not in ["public", "information_schema"]
  +        for schema in get_all_schemas(engine)
  +        if schema not in [TYPES_SCHEMA, "information_schema"]
       ]
   
   
  -def schema_exists(schema, engine):
  -    return schema in get_all_schemas(engine)
  +def get_all_schemas(engine):
  +    inspector = inspect(engine)
  +    return inspector.get_schema_names()
   
   
   def create_schema(schema, engine):
       """
       This method creates a Postgres schema.
       """
  -    if not schema_exists(schema, engine):
  +    if schema not in get_all_schemas(engine):
           with engine.begin() as connection:
               connection.execute(CreateSchema(schema))
  
verification_info: {"golden_diff": "diff --git a/db/schemas.py b/db/schemas.py\n--- a/db/schemas.py\n+++ b/db/schemas.py\n@@ -1,24 +1,28 @@\n from sqlalchemy.schema import CreateSchema\n from sqlalchemy import inspect\n \n+from db import types\n \n-def get_all_schemas(engine):\n-    inspector = inspect(engine)\n+TYPES_SCHEMA = types.base.SCHEMA\n+\n+\n+def get_mathesar_schemas(engine):\n     return [\n         schema\n-        for schema in inspector.get_schema_names()\n-        if schema not in [\"public\", \"information_schema\"]\n+        for schema in get_all_schemas(engine)\n+        if schema not in [TYPES_SCHEMA, \"information_schema\"]\n     ]\n \n \n-def schema_exists(schema, engine):\n-    return schema in get_all_schemas(engine)\n+def get_all_schemas(engine):\n+    inspector = inspect(engine)\n+    return inspector.get_schema_names()\n \n \n def create_schema(schema, engine):\n     \"\"\"\n     This method creates a Postgres schema.\n     \"\"\"\n-    if not schema_exists(schema, engine):\n+    if schema not in get_all_schemas(engine):\n         with engine.begin() as connection:\n             connection.execute(CreateSchema(schema))\n", "issue": "Schema getter should return public, but not mathesar_types\n**Describe the bug**\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\nIf a user wants to create a table the `public` schema, they can't currently, because the logic in the `db.schemas.get_all_schemas` function ignores it.  This means when they try, an error is thrown.  This is especially a problem when they've imported a DB, since most tables are in the `public` schema in most installations of PostgreSQL in the wild.\r\n\r\n**Expected behavior**\r\n<!-- A clear and concise description of what you expected to happen. -->\r\nThe public schema should be available for holding mathesar tables.\r\n\r\n**To Reproduce**\r\nPlease try to provide a [Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example.\r\n\r\nStart the webapp using the README.  Try to upload a CSV to the `public` schema.  See the error.\r\n\r\n**Have a nice day!**\r\n\n", "before_files": [{"content": "from sqlalchemy.schema import CreateSchema\nfrom sqlalchemy import inspect\n\n\ndef get_all_schemas(engine):\n    inspector = inspect(engine)\n    return [\n        schema\n        for schema in inspector.get_schema_names()\n        if schema not in [\"public\", \"information_schema\"]\n    ]\n\n\ndef schema_exists(schema, engine):\n    return schema in get_all_schemas(engine)\n\n\ndef create_schema(schema, engine):\n    \"\"\"\n    This method creates a Postgres schema.\n    \"\"\"\n    if not schema_exists(schema, engine):\n        with engine.begin() as connection:\n            connection.execute(CreateSchema(schema))\n", "path": "db/schemas.py"}], "after_files": [{"content": "from sqlalchemy.schema import CreateSchema\nfrom sqlalchemy import inspect\n\nfrom db import types\n\nTYPES_SCHEMA = types.base.SCHEMA\n\n\ndef get_mathesar_schemas(engine):\n    return [\n        schema\n        for schema in get_all_schemas(engine)\n        if schema not in [TYPES_SCHEMA, \"information_schema\"]\n    ]\n\n\ndef get_all_schemas(engine):\n    inspector = inspect(engine)\n    return inspector.get_schema_names()\n\n\ndef create_schema(schema, engine):\n    \"\"\"\n    This method creates a Postgres schema.\n    \"\"\"\n    if schema not in get_all_schemas(engine):\n        with engine.begin() as connection:\n            connection.execute(CreateSchema(schema))\n", "path": "db/schemas.py"}]}