-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgreSQL 12 compatibility (lack of consrc) #4332
Comments
Replace usage of pg_constraint.consrc with pg_get_cosntraintdef() in all cases. PostgreSQL 12 no longer supports consrc. Use the same code in CockroachDB for consistency. Closes: typeorm#4332
Replace usage of pg_constraint.consrc with pg_get_constraintdef() in all cases. PostgreSQL 12 no longer supports consrc. Use the same code in CockroachDB for consistency. Closes: typeorm#4332
Replace usage of pg_constraint.consrc with pg_get_constraintdef() in all cases. PostgreSQL 12 no longer supports consrc. Use the same code in CockroachDB for consistency. Closes: typeorm#4332
@Kononnable I see that it's fixed in the fork of typeorm. Will it be fixed also in the main typeorm (this) repo some day? |
Is there any work around until a new release is published? |
I think the only workaround right now is to build https://github.com/eliziario/typeorm yourself and use its command line tool to achieve certain goals. Make sure you build eliziario-typeorm first like this:
After that you could implement a custom npm-script like this:
Then you can use this for instance:
Hope this helps & works, didn't really test it... |
I already have a NestJS project built with Angular ready to be deployed. |
I'm not aware of any issues during runtime tbh. Am I missing something? |
@stefanpartheym yes I am currently experiencing issues during runtime. Preventing my nestjs app from working in dev environment.
|
@mokanfar This seems very odd to me, since I'm not experiencing this issue during runtime. Since I use |
I downgraded PostgreSQL from version 12 to 11.5 and TyperOrm and the database is running without the "QueryFailedError: column cnst.consrc does not exist". I will test the project with ConnectionOptions.synchronize = false to check if this is causing the conflict. Regards. |
@stefanpartheym Yes, setting |
@stefanpartheym yeah, thanks for pointing that out. |
I'm getting this error on Postgres 12 even with |
@ericbiewener I suspect, the error occurs whenever TypORM is trying to use the QueryRunner to either modify table structure or read/get information about table structure. As I already mentioned earlier, you could use the typeorm cli from https://github.com/eliziario/typeorm, as described here:
|
This is clearly a bug due to breaking change in postgres 12. |
hit the same issue. subscribing. |
tried running schema:sync with cli and got the same error. I have tried reverting back to postgres 11.5 but it still doesn't work for me. Tried with versions 11.5, 12 and 12.1 |
Have you tried my proposed solution above? |
@stefanpartheym my bad, hadn't tried it yet. Using cli after manually building from https://github.com/eliziario/typeorm does solve the issue locally. Thanks 👍 |
Replace usage of pg_constraint.consrc with pg_get_constraintdef() in all cases. PostgreSQL 12 no longer supports consrc. Use the same code in CockroachDB for consistency. Closes: #4332
When you can release this change? I have nest app, that method doesn't work for it. |
This does get rid of the bug for time being! thanks!! |
It works in |
- fixes issue with typeorm conflict with newest versions of postgres (typeorm/typeorm#4332) - adin-bro versioning adjustment improves compatibility with stable admin-bro when linking
Issue type:
[x] bug report
[x] feature request
Database system/driver:
[x]
postgres
TypeORM version:
[x]
latest
[x]
@next
Steps to reproduce or a small repository showing the problem:
PostgreSQL 12 removes the
pg_constraint.consrc
column. This makesconstraintsSql
fromloadTables
in PostgresQueryRunner.ts fail with an exception and aborting the transaction. Documentation:The docs for 11 still include
consrc
, but recommend to usepg_get_constraintdef
, which only seems to be used for exclusions constraints (x
) here. This has been introduced in #2710 for exclusions constraints. It seems thatexpression
is used in some places, but giving it a very rough look I think whateverpg_get_constraintdef
returns might work as well. Always usingpg_get_constraintdef
at least gets my 1 entity test running, but this obviously does not use many constraints.The text was updated successfully, but these errors were encountered: