We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Deprecate PostgreSQLRegistryStore
Right now we have 2 ways to use postgres as a registry backend. The first is with scalable `SqlRegistry` that uses `sqlalchemy`, another is an older option of using `PostgreSQLRegistryStore` which keeps the whole proto in a single table. Since we are [recommending](https://docs.feast.dev/tutorials/using-scalable-registry) the scalable registry anyway, we should deprecate `PostgreSQLRegistryStore` and remove it soon after. Or maybe remove it directly? It's under contribs as of now.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py`
Content:
```
1 from typing import Optional
2 
3 import psycopg2
4 from psycopg2 import sql
5 
6 from feast.infra.registry.registry_store import RegistryStore
7 from feast.infra.utils.postgres.connection_utils import _get_conn
8 from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig
9 from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto
10 from feast.repo_config import RegistryConfig
11 
12 
13 class PostgresRegistryConfig(RegistryConfig):
14     host: str
15     port: int
16     database: str
17     db_schema: str
18     user: str
19     password: str
20     sslmode: Optional[str]
21     sslkey_path: Optional[str]
22     sslcert_path: Optional[str]
23     sslrootcert_path: Optional[str]
24 
25 
26 class PostgreSQLRegistryStore(RegistryStore):
27     def __init__(self, config: PostgresRegistryConfig, registry_path: str):
28         self.db_config = PostgreSQLConfig(
29             host=config.host,
30             port=config.port,
31             database=config.database,
32             db_schema=config.db_schema,
33             user=config.user,
34             password=config.password,
35             sslmode=getattr(config, "sslmode", None),
36             sslkey_path=getattr(config, "sslkey_path", None),
37             sslcert_path=getattr(config, "sslcert_path", None),
38             sslrootcert_path=getattr(config, "sslrootcert_path", None),
39         )
40         self.table_name = config.path
41         self.cache_ttl_seconds = config.cache_ttl_seconds
42 
43     def get_registry_proto(self) -> RegistryProto:
44         registry_proto = RegistryProto()
45         try:
46             with _get_conn(self.db_config) as conn, conn.cursor() as cur:
47                 cur.execute(
48                     sql.SQL(
49                         """
50                         SELECT registry
51                         FROM {}
52                         WHERE version = (SELECT max(version) FROM {})
53                         """
54                     ).format(
55                         sql.Identifier(self.table_name),
56                         sql.Identifier(self.table_name),
57                     )
58                 )
59                 row = cur.fetchone()
60                 if row:
61                     registry_proto = registry_proto.FromString(row[0])
62         except psycopg2.errors.UndefinedTable:
63             pass
64         return registry_proto
65 
66     def update_registry_proto(self, registry_proto: RegistryProto):
67         """
68         Overwrites the current registry proto with the proto passed in. This method
69         writes to the registry path.
70 
71         Args:
72             registry_proto: the new RegistryProto
73         """
74         schema_name = self.db_config.db_schema or self.db_config.user
75         with _get_conn(self.db_config) as conn, conn.cursor() as cur:
76             cur.execute(
77                 """
78                 SELECT schema_name
79                 FROM information_schema.schemata
80                 WHERE schema_name = %s
81                 """,
82                 (schema_name,),
83             )
84             schema_exists = cur.fetchone()
85             if not schema_exists:
86                 cur.execute(
87                     sql.SQL("CREATE SCHEMA IF NOT EXISTS {} AUTHORIZATION {}").format(
88                         sql.Identifier(schema_name),
89                         sql.Identifier(self.db_config.user),
90                     ),
91                 )
92 
93             cur.execute(
94                 sql.SQL(
95                     """
96                     CREATE TABLE IF NOT EXISTS {} (
97                         version BIGSERIAL PRIMARY KEY,
98                         registry BYTEA NOT NULL
99                     );
100                     """
101                 ).format(sql.Identifier(self.table_name)),
102             )
103             # Do we want to keep track of the history or just keep the latest?
104             cur.execute(
105                 sql.SQL(
106                     """
107                     INSERT INTO {} (registry)
108                     VALUES (%s);
109                     """
110                 ).format(sql.Identifier(self.table_name)),
111                 [registry_proto.SerializeToString()],
112             )
113 
114     def teardown(self):
115         with _get_conn(self.db_config) as conn, conn.cursor() as cur:
116             cur.execute(
117                 sql.SQL(
118                     """
119                     DROP TABLE IF EXISTS {};
120                     """
121                 ).format(sql.Identifier(self.table_name))
122             )
123
```
--- 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()

```

diff --git a/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py b/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py
--- a/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py
+++ b/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py
@@ -1,3 +1,4 @@
+import warnings
 from typing import Optional
 
 import psycopg2
@@ -37,6 +38,11 @@
             sslcert_path=getattr(config, "sslcert_path", None),
             sslrootcert_path=getattr(config, "sslrootcert_path", None),
         )
+        warnings.warn(
+            "PostgreSQLRegistryStore is deprecated and will be removed in the future releases. Please use SqlRegistry instead.",
+            DeprecationWarning,
+        )
+
         self.table_name = config.path
         self.cache_ttl_seconds = config.cache_ttl_seconds

{"golden_diff": "diff --git a/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py b/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py\n--- a/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py\n+++ b/sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py\n@@ -1,3 +1,4 @@\n+import warnings\n from typing import Optional\n \n import psycopg2\n@@ -37,6 +38,11 @@\n             sslcert_path=getattr(config, \"sslcert_path\", None),\n             sslrootcert_path=getattr(config, \"sslrootcert_path\", None),\n         )\n+        warnings.warn(\n+            \"PostgreSQLRegistryStore is deprecated and will be removed in the future releases. Please use SqlRegistry instead.\",\n+            DeprecationWarning,\n+        )\n+\n         self.table_name = config.path\n         self.cache_ttl_seconds = config.cache_ttl_seconds\n", "issue": "Deprecate PostgreSQLRegistryStore\nRight now we have 2 ways to use postgres as a registry backend. The first is with scalable `SqlRegistry` that uses `sqlalchemy`, another is an older option of using `PostgreSQLRegistryStore` which keeps the whole proto in a single table. Since we are [recommending](https://docs.feast.dev/tutorials/using-scalable-registry) the scalable registry anyway, we should deprecate `PostgreSQLRegistryStore` and remove it soon after. Or maybe remove it directly? It's under contribs as of now.\n", "before_files": [{"content": "from typing import Optional\n\nimport psycopg2\nfrom psycopg2 import sql\n\nfrom feast.infra.registry.registry_store import RegistryStore\nfrom feast.infra.utils.postgres.connection_utils import _get_conn\nfrom feast.infra.utils.postgres.postgres_config import PostgreSQLConfig\nfrom feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto\nfrom feast.repo_config import RegistryConfig\n\n\nclass PostgresRegistryConfig(RegistryConfig):\n    host: str\n    port: int\n    database: str\n    db_schema: str\n    user: str\n    password: str\n    sslmode: Optional[str]\n    sslkey_path: Optional[str]\n    sslcert_path: Optional[str]\n    sslrootcert_path: Optional[str]\n\n\nclass PostgreSQLRegistryStore(RegistryStore):\n    def __init__(self, config: PostgresRegistryConfig, registry_path: str):\n        self.db_config = PostgreSQLConfig(\n            host=config.host,\n            port=config.port,\n            database=config.database,\n            db_schema=config.db_schema,\n            user=config.user,\n            password=config.password,\n            sslmode=getattr(config, \"sslmode\", None),\n            sslkey_path=getattr(config, \"sslkey_path\", None),\n            sslcert_path=getattr(config, \"sslcert_path\", None),\n            sslrootcert_path=getattr(config, \"sslrootcert_path\", None),\n        )\n        self.table_name = config.path\n        self.cache_ttl_seconds = config.cache_ttl_seconds\n\n    def get_registry_proto(self) -> RegistryProto:\n        registry_proto = RegistryProto()\n        try:\n            with _get_conn(self.db_config) as conn, conn.cursor() as cur:\n                cur.execute(\n                    sql.SQL(\n                        \"\"\"\n                        SELECT registry\n                        FROM {}\n                        WHERE version = (SELECT max(version) FROM {})\n                        \"\"\"\n                    ).format(\n                        sql.Identifier(self.table_name),\n                        sql.Identifier(self.table_name),\n                    )\n                )\n                row = cur.fetchone()\n                if row:\n                    registry_proto = registry_proto.FromString(row[0])\n        except psycopg2.errors.UndefinedTable:\n            pass\n        return registry_proto\n\n    def update_registry_proto(self, registry_proto: RegistryProto):\n        \"\"\"\n        Overwrites the current registry proto with the proto passed in. This method\n        writes to the registry path.\n\n        Args:\n            registry_proto: the new RegistryProto\n        \"\"\"\n        schema_name = self.db_config.db_schema or self.db_config.user\n        with _get_conn(self.db_config) as conn, conn.cursor() as cur:\n            cur.execute(\n                \"\"\"\n                SELECT schema_name\n                FROM information_schema.schemata\n                WHERE schema_name = %s\n                \"\"\",\n                (schema_name,),\n            )\n            schema_exists = cur.fetchone()\n            if not schema_exists:\n                cur.execute(\n                    sql.SQL(\"CREATE SCHEMA IF NOT EXISTS {} AUTHORIZATION {}\").format(\n                        sql.Identifier(schema_name),\n                        sql.Identifier(self.db_config.user),\n                    ),\n                )\n\n            cur.execute(\n                sql.SQL(\n                    \"\"\"\n                    CREATE TABLE IF NOT EXISTS {} (\n                        version BIGSERIAL PRIMARY KEY,\n                        registry BYTEA NOT NULL\n                    );\n                    \"\"\"\n                ).format(sql.Identifier(self.table_name)),\n            )\n            # Do we want to keep track of the history or just keep the latest?\n            cur.execute(\n                sql.SQL(\n                    \"\"\"\n                    INSERT INTO {} (registry)\n                    VALUES (%s);\n                    \"\"\"\n                ).format(sql.Identifier(self.table_name)),\n                [registry_proto.SerializeToString()],\n            )\n\n    def teardown(self):\n        with _get_conn(self.db_config) as conn, conn.cursor() as cur:\n            cur.execute(\n                sql.SQL(\n                    \"\"\"\n                    DROP TABLE IF EXISTS {};\n                    \"\"\"\n                ).format(sql.Identifier(self.table_name))\n            )\n", "path": "sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py"}], "after_files": [{"content": "import warnings\nfrom typing import Optional\n\nimport psycopg2\nfrom psycopg2 import sql\n\nfrom feast.infra.registry.registry_store import RegistryStore\nfrom feast.infra.utils.postgres.connection_utils import _get_conn\nfrom feast.infra.utils.postgres.postgres_config import PostgreSQLConfig\nfrom feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto\nfrom feast.repo_config import RegistryConfig\n\n\nclass PostgresRegistryConfig(RegistryConfig):\n    host: str\n    port: int\n    database: str\n    db_schema: str\n    user: str\n    password: str\n    sslmode: Optional[str]\n    sslkey_path: Optional[str]\n    sslcert_path: Optional[str]\n    sslrootcert_path: Optional[str]\n\n\nclass PostgreSQLRegistryStore(RegistryStore):\n    def __init__(self, config: PostgresRegistryConfig, registry_path: str):\n        self.db_config = PostgreSQLConfig(\n            host=config.host,\n            port=config.port,\n            database=config.database,\n            db_schema=config.db_schema,\n            user=config.user,\n            password=config.password,\n            sslmode=getattr(config, \"sslmode\", None),\n            sslkey_path=getattr(config, \"sslkey_path\", None),\n            sslcert_path=getattr(config, \"sslcert_path\", None),\n            sslrootcert_path=getattr(config, \"sslrootcert_path\", None),\n        )\n        warnings.warn(\n            \"PostgreSQLRegistryStore is deprecated and will be removed in the future releases. Please use SqlRegistry instead.\",\n            DeprecationWarning,\n        )\n\n        self.table_name = config.path\n        self.cache_ttl_seconds = config.cache_ttl_seconds\n\n    def get_registry_proto(self) -> RegistryProto:\n        registry_proto = RegistryProto()\n        try:\n            with _get_conn(self.db_config) as conn, conn.cursor() as cur:\n                cur.execute(\n                    sql.SQL(\n                        \"\"\"\n                        SELECT registry\n                        FROM {}\n                        WHERE version = (SELECT max(version) FROM {})\n                        \"\"\"\n                    ).format(\n                        sql.Identifier(self.table_name),\n                        sql.Identifier(self.table_name),\n                    )\n                )\n                row = cur.fetchone()\n                if row:\n                    registry_proto = registry_proto.FromString(row[0])\n        except psycopg2.errors.UndefinedTable:\n            pass\n        return registry_proto\n\n    def update_registry_proto(self, registry_proto: RegistryProto):\n        \"\"\"\n        Overwrites the current registry proto with the proto passed in. This method\n        writes to the registry path.\n\n        Args:\n            registry_proto: the new RegistryProto\n        \"\"\"\n        schema_name = self.db_config.db_schema or self.db_config.user\n        with _get_conn(self.db_config) as conn, conn.cursor() as cur:\n            cur.execute(\n                \"\"\"\n                SELECT schema_name\n                FROM information_schema.schemata\n                WHERE schema_name = %s\n                \"\"\",\n                (schema_name,),\n            )\n            schema_exists = cur.fetchone()\n            if not schema_exists:\n                cur.execute(\n                    sql.SQL(\"CREATE SCHEMA IF NOT EXISTS {} AUTHORIZATION {}\").format(\n                        sql.Identifier(schema_name),\n                        sql.Identifier(self.db_config.user),\n                    ),\n                )\n\n            cur.execute(\n                sql.SQL(\n                    \"\"\"\n                    CREATE TABLE IF NOT EXISTS {} (\n                        version BIGSERIAL PRIMARY KEY,\n                        registry BYTEA NOT NULL\n                    );\n                    \"\"\"\n                ).format(sql.Identifier(self.table_name)),\n            )\n            # Do we want to keep track of the history or just keep the latest?\n            cur.execute(\n                sql.SQL(\n                    \"\"\"\n                    INSERT INTO {} (registry)\n                    VALUES (%s);\n                    \"\"\"\n                ).format(sql.Identifier(self.table_name)),\n                [registry_proto.SerializeToString()],\n            )\n\n    def teardown(self):\n        with _get_conn(self.db_config) as conn, conn.cursor() as cur:\n            cur.execute(\n                sql.SQL(\n                    \"\"\"\n                    DROP TABLE IF EXISTS {};\n                    \"\"\"\n                ).format(sql.Identifier(self.table_name))\n            )\n", "path": "sdk/python/feast/infra/registry/contrib/postgres/postgres_registry_store.py"}]}