$82 GRAYBYTE WORDPRESS FILE MANAGER $15

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql//provision.py
import time

from ... import exc
from ... import text
from ...testing.provision import create_db
from ...testing.provision import drop_db
from ...testing.provision import log
from ...testing.provision import temp_table_keyword_args


@create_db.for_db("postgresql")
def _pg_create_db(cfg, eng, ident):
    template_db = cfg.options.postgresql_templatedb

    with eng.connect().execution_options(isolation_level="AUTOCOMMIT") as conn:
        try:
            _pg_drop_db(cfg, conn, ident)
        except Exception:
            pass
        if not template_db:
            template_db = conn.scalar("select current_database()")

        attempt = 0
        while True:
            try:
                conn.execute(
                    "CREATE DATABASE %s TEMPLATE %s" % (ident, template_db)
                )
            except exc.OperationalError as err:
                attempt += 1
                if attempt >= 3:
                    raise
                if "accessed by other users" in str(err):
                    log.info(
                        "Waiting to create %s, URI %r, "
                        "template DB %s is in use sleeping for .5",
                        ident,
                        eng.url,
                        template_db,
                    )
                    time.sleep(0.5)
            except:
                raise
            else:
                break


@drop_db.for_db("postgresql")
def _pg_drop_db(cfg, eng, ident):
    with eng.connect().execution_options(isolation_level="AUTOCOMMIT") as conn:
        conn.execute(
            text(
                "select pg_terminate_backend(pid) from pg_stat_activity "
                "where usename=current_user and pid != pg_backend_pid() "
                "and datname=:dname"
            ),
            dname=ident,
        )
        conn.execute("DROP DATABASE %s" % ident)


@temp_table_keyword_args.for_db("postgresql")
def _postgresql_temp_table_keyword_args(cfg, eng):
    return {"prefixes": ["TEMPORARY"]}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
2.403 KB
17 Apr 2025 8.10 PM
root / root
0644
array.py
11.5 KB
17 Apr 2025 8.10 PM
root / root
0644
base.py
126.219 KB
17 Apr 2025 8.10 PM
root / root
0644
dml.py
7.607 KB
17 Apr 2025 8.10 PM
root / root
0644
ext.py
7.558 KB
17 Apr 2025 8.10 PM
root / root
0644
hstore.py
12.126 KB
17 Apr 2025 8.10 PM
root / root
0644
json.py
9.866 KB
17 Apr 2025 8.10 PM
root / root
0644
pg8000.py
9.494 KB
17 Apr 2025 8.10 PM
root / root
0644
provision.py
1.961 KB
17 Apr 2025 8.10 PM
root / root
0644
psycopg2.py
36.883 KB
17 Apr 2025 8.10 PM
root / root
0644
psycopg2cffi.py
1.618 KB
17 Apr 2025 8.10 PM
root / root
0644
pygresql.py
7.938 KB
17 Apr 2025 8.10 PM
root / root
0644
pypostgresql.py
2.847 KB
17 Apr 2025 8.10 PM
root / root
0644
ranges.py
4.514 KB
17 Apr 2025 8.10 PM
root / root
0644
zxjdbc.py
1.382 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF