question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeORM attempts to create tables that already exist when its user is not the owner of that table, regardless of privilege settings

See original GitHub issue

Issue type:

[ ] question [x ] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [x ] postgres [ ] sqlite [ ] sqljs [ ] websql

TypeORM version:

[x ] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

  1. create postgres table as user1
  2. grant all privileges on table to user2
  3. configure typeorm to log into this db and table under login user2
  4. use typeorm to query table Expected behavior: query should execute as expected without new table creation Actual behavior: query attempts to create the table as if it didn’t exist but fails because postgres returns an error stating the table already exists
  5. alter the table’s owner to be user2
  6. use typeorm to query table Actual behavior: query does not attempt to create table, as it recognizes it already exists.

Speculation: I suspect that this is due to TypeORM only detects tables of which its configured user is the owner.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
empzcommented, Sep 17, 2018

I’m experiencing the same issue. Any ideas?

0reactions
JulianH99commented, Jan 12, 2021

Using only lowercase naming is not always an option. In my case all the tables have to camelCase naming. I already configured the lower_case_tables_name in my.cnf but that does not seem to work at all, typescritps still throws an error saying table systemversion already exists (with systemversion being one of my tables)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeORM attempts to create tables that ... - Bountysource
TypeORM attempts to create tables that already exist when its user is not the owner of that table, regardless of privilege settings.
Read more >
TypeORM does not create tables, columns etc - Stack Overflow
You can use it to create tables and columns automatically: ... synchronize: true. It creates the table once if it does not exists....
Read more >
About basic forms - Power Apps | Microsoft Learn
To secure your forms, you must create table permissions that determine access and ownership of the records according to web roles. If a...
Read more >
How to use single and double quotes in PostgreSQL - Prisma
Here, the table name is encapsulated in double quotes. SELECT * FROM "customer";. While double quotes indicate an identifier, not all identifiers use...
Read more >
snowflake alter table - Yakkety Yak
To use Power BI to access Snowflake data through SSO, it is necessary to ... the global CREATE INTEGRATION privilege can execute The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found