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.

Error Table 'public.table' not found

See original GitHub issue

Dear devs,

I faced an issue on generation of classes from a database. Before, we were generating classes when tables were placed in different schemas without any error. Now we moved all the tables to the “public” schema, and on generation we have an error. I haven’t find any help in your documentation about that. The error is:

Exception message: #error Table 'public.logged_actions' not found.

And as comment, in existing tables part we have

/*
	Existing tables:

	logged_actions
	...
        (40 more tables)
 */

The same table, found in “public” schema but gives an error. I know it should be simple to resolve, but I haven’t found in documentation how.

Can you help please?

Environment details

linq2db version: 2.7.0 Database Server: Postgres Database Provider: PostgreSQL 10.3 Operating system: Windows 10 x64 Pro .NET Framework: .Net Core 2.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
YXMagnuMXYcommented, Jun 11, 2019

I found the error… After: LoadPostgreSQLMetadata("x", "x", "x", "x", "x"); we’ve put a foreach loop, to give “IIdentifiable” as BaseClass for each class generated.

foreach (var table in Tables.Values)
GetTable(table.Schema + "." + table.TableName).BaseClass = "IIdentifiable";

I changed it to

foreach (var table in Tables.Values)
GetTable(table.TableName).BaseClass = "IIdentifiable";

and now works.

0reactions
sdanylivcommented, Jun 11, 2019

If you are trying to customize generation, you have to read this doc: useful-members-and-data-structures

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table not found error while using PostgreSql in Spring boot ...
1 Answer 1 ... Renaming the Student table to student (lower-case) both in Database and Entity class should fix the problem. @Entity @Table(name...
Read more >
Why am I getting table does not exist error?
1 Answer. The table isn't missing. The message "table "automobiles" does not exist, skipping" stems from the DROP TABLE IF EXISTS statement and ......
Read more >
Table does not exist in the current database
Hi. I deployed an app I'm currently developing, just to try fly.io. I've created a proxy to the fly db to perform a...
Read more >
Prisma error: The table `main.User` does not exist in ...
An error occurred handling a request for the Admin UI: Error: Prisma error: The table `main.User` does not exist in the current database....
Read more >
Debugging “relation does not exist” error in postgres
So, i was getting this nasty error even when the table clearly existed in t11 database. Database Name: t11. Schema: public. Table Name:...
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