SQL Editor suddenly not working correctly

I am suddenly having problems with the SQL Editor returning incorrect data and being unable to find tables.

I have tables:

> Account
> Session
> User
> VerificationToken
> _prisma_migrations

In the SQL Editor, when I run SELECT * FROM User, only 1/7 columns are returned. The column name is ‘user’ which does not even exist in User table.

If I try to query any other table I get ERROR: relation "tablename" does not exist (SQLSTATE 42P01) for the all the others.

Note: Just before this I got FATAL 53300: Remaining connection slots are reserved for non-replication superuser connections error in my Next.js app and in the SQL Editor after any query. It has since gone away in both of those areas after I restarted the dev server and re-opened Neon.

I have ensured I am querying the correct db on the correct branch. I have checked limits, settings, the table existing, etc. It was working the other day and has suddenly stopped.

The correct records are returned when I console.log(user) in my app, where user queries the User table with prisma. I see it all fine in my terminal.

It seems like a bug. I have refreshed, opened and closed Neon, restarted computer, servers. Let me know what other information I can provide. I would add screenshots but their is not extra information than what I provided. Thanks!

Hey @marcusg ! Sorry to hear that you’re running into issues.

For the SQL editor issue, can you try wrapping the table name in ""?

So it will be SELECT * from "User". This should fix the issue. What’s happening is that the table name is considered asuser, which is a table that you don’t have.

Quoting an identifier also makes it case-sensitive, whereas unquoted names are always folded to lower case. For example, the identifiers FOO, foo, and "foo" are considered the same by PostgreSQL, but "Foo" and "FOO" are different from these three and each other.

As for the second issue you’re running into where you get the error FATAL 53300: Remaining connection slots are reserved for non-replication superuser connections. This means that you ran out of database connections.

I’m assuming you’re not using the pooled connection string, is that correct?

The pooled connection string has -pooler in it. It should look something like this:

postgres://sally:<password>@ep-throbbing-boat-918849-pooler.us-east-2.aws.neon.tech/neondb

Mahmoud, thank you for the incredibly fast reply. I have been writing table names without quotes for so long I forgot to try that - It works! I am not sure why it was working without them a couple days - unless my memory is wrong, but my ‘history’ has it without them.

As for FATAL 53300, that is correct, I’m not. I am still new to working with databases in my web apps so I will look further into how pooling works. Thanks again.

No problem! you can check out our documentation to learn more about connection pooling and how it works in general: Connection pooling — Neon Docs

We also have a guide on using Prisma with connection pooling that I highly recommend you check out. Connect from Prisma to Neon — Neon Docs If you have any questions or run into any more issues, feel free to reach out :smile:

1 Like