Cannot init Postgres+psycopg2 database, the codes are basically from docs:
init_engine_and_session_factory(url=db_url)
engine = get_engine()
create_all_tables(engine)
Used latest official docker for Postgres (https://hub.docker.com/_/postgres).
My error:
ProgrammingError: (psycopg2.errors.SyntaxError) type modifier is not allowed for type "text"
LINE 4: data_json TEXT(4294967295) NOT NULL,
^
[SQL:
CREATE TABLE data_v2 (
id SERIAL NOT NULL,
data_json TEXT(4294967295) NOT NULL,
description VARCHAR(255),
experiment_id INTEGER,
time_created BIGINT NOT NULL,
trial_index INTEGER,
generation_strategy_id INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(experiment_id) REFERENCES experiment_v2 (id),
FOREIGN KEY(generation_strategy_id) REFERENCES generation_strategy (id)
)
]
Looks like Text doesn't accept a length argument with PostgreSQL.
|
data_json: str = Column(Text(LONGTEXT_BYTES), nullable=False) |
However, same works perfect with with SQLite.
Cannot init Postgres+psycopg2 database, the codes are basically from docs:
Used latest official docker for Postgres (https://hub.docker.com/_/postgres).
My error:
Looks like Text doesn't accept a length argument with PostgreSQL.
Ax/ax/storage/sqa_store/sqa_classes.py
Line 238 in eb707b1
However, same works perfect with with SQLite.