Skip to content

数据库初始化的时候需要高权限账号 #42

@wss-git

Description

@wss-git

低权限账户,会报412,但是前端的报错却是显示 用户已经注册

Traceback (most recent call last):
  File "/opt/python/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
    self.dialect.do_execute(
  File "/opt/python/sqlalchemy/engine/default.py", line 921, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/python/psycopg/cursor.py", line 737, in execute
    raise ex.with_traceback(None)
psycopg.errors.InsufficientPrivilege: permission denied to create extension "vector"
HINT:  Must be superuser or user with all of rds_superuser to create this extension.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/code/app/main.py", line 11, in <module>
    create_tables()
  File "/code/app/db.py", line 339, in create_tables
    session.execute(CREATE_VECTOR_EXTENSION)
  File "/opt/python/sqlalchemy/orm/session.py", line 2246, in execute
    return self._execute_internal(
  File "/opt/python/sqlalchemy/orm/session.py", line 2150, in _execute_internal
    result = conn.execute(
  File "/opt/python/sqlalchemy/engine/base.py", line 1412, in execute
    return meth(
  File "/opt/python/sqlalchemy/sql/elements.py", line 483, in _execute_on_connection
    return connection._execute_clauseelement(
  File "/opt/python/sqlalchemy/engine/base.py", line 1635, in _execute_clauseelement
    ret = self._execute_context(
  File "/opt/python/sqlalchemy/engine/base.py", line 1844, in _execute_context
    return self._exec_single_context(
  File "/opt/python/sqlalchemy/engine/base.py", line 1984, in _exec_single_context
    self._handle_dbapi_exception(
  File "/opt/python/sqlalchemy/engine/base.py", line 2339, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/opt/python/sqlalchemy/engine/base.py", line 1965, in _exec_single_context
    self.dialect.do_execute(
  File "/opt/python/sqlalchemy/engine/default.py", line 921, in do_execute
    cursor.execute(statement, parameters)
  File "/opt/python/psycopg/cursor.py", line 737, in execute
    raise ex.with_traceback(None)
sqlalchemy.exc.ProgrammingError: (psycopg.errors.InsufficientPrivilege) permission denied to create extension "vector"
HINT:  Must be superuser or user with all of rds_superuser to create this extension.
[SQL: CREATE EXTENSION IF NOT EXISTS vector]
(Background on this error at: https://sqlalche.me/e/20/f405)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions