pyspur icon indicating copy to clipboard operation
pyspur copied to clipboard

Error running migrations: (psycopg2.errors.InvalidObjectDefinition) generation expression is not immutable

Open wlilaifeng opened this issue 9 months ago • 4 comments

Error running migrations: (psycopg2.errors.InvalidObjectDefinition) generation expression is not immutable [SQL: CREATE TABLE datasets ( _intid SERIAL NOT NULL, id VARCHAR GENERATED ALWAYS AS ('DS' || _intid) STORED NOT NULL, name VARCHAR NOT NULL, description VARCHAR, file_path VARCHAR NOT NULL, uploaded_at TIMESTAMP WITHOUT TIME ZONE NOT NULL, PRIMARY KEY (_intid), UNIQUE (_intid), UNIQUE (id), UNIQUE (name) )

] (Background on this error at: https://sqlalche.me/e/20/f405) Error starting server: 1

wlilaifeng avatar Mar 21 '25 01:03 wlilaifeng

@wlilaifeng can you please provide the following details about your setup to help us understand the issue better:

  1. is this using docker or pypi package?
  2. if pypi, is it using --sqlite flag or a postgres endpoint has been provided?
  3. if postgres, what is the version of it?

Thanks for reporting it!

srijanpatel avatar Mar 23 '25 04:03 srijanpatel

I have the same issue. That error came from running alembic upgrade head. I don't use pyspur command. I cloned the repository and ran alembic command with a new postgresql database and got that error. I'm using postgresql 12.13 version Do you have any solutions?

ad-free avatar Apr 09 '25 07:04 ad-free

ı have similar problem

aileia avatar Apr 11 '25 13:04 aileia