Problems with postgres database in Vercel

I have a few problems with the data base table, but right now the most important one is, where did it go?

from the storage tab I was able to see all the tables I created, but where are they now? How can I find them?

Interestingly it is still doing logs from the route where the table information should be inserted, but the information is not being inserted in the table, and now I can’t even find the tables.

I’m like 90% sure that now that Vercel Postgres is just Neon all of the table data can be found directly in Neon. There’s the button in the top right to Open in Neon, which will take you to the dashboard. From there you should see a Tables tab in the left sidebar. Hope this helps!

1 Like

I saw that, but I see no data from neon.

Is there a way to contact neon to ask them about my tables?

Also… they were not working and just this morning, while troubleshooting it, they disappeared.

Oh… I found them in one of their tabs!

Now…

Where could be a good idea to ask for help on a code that was working before to put data in the tables, and now the code isn’t working anymore??

I think this has to do something with this move for some reason…

Glad you found it!

Are you able to share the code or an example of it?

Vercel Postgres databases are being migrated is being migrated over to Neon right now. (See Neon now available on Vercel Marketplace - Vercel for more)

I’m sharing your report with the migration team. If you can share an example, I can also get that to them to help with investigation

For example this code here:

^^^ This was working fine on a table with the name “image”, but suddenly stopped working.

The code will do the re-directs just fine, but wouldn’t insert any data into the table.

I commented the redirects to do some troubleshooting, and added some console.log that gives me this response:

{“result”:{“command”:“INSERT”,“rowCount”:1,“rows”:,“fields”:,“rowAsArray”:false,“viaNeonFetch”:true}}

Logs from Vercel show this:

And I get NO data added to my table.

Thanks for sharing that. We’re investigating now, but I also want to share the Vercel Postgres to Neon migration guide in case it helps you

1 Like

What do you guys think?

Is there a change on the code for the connection?

Ok so… I change the code, apparently the old code is no longer in the reference.

The new sample code below works to create a new table, and I can add new data to the new table, but the previously created tables are not working.

The new code for connection would be this:

// import { sql } from “@vercel/postgres”;
import { neon } from ‘@neondatabase/serverless’;
import { NextResponse } from “next/server”;

export async function GET(request) {
const sql = neon(${process.env.DATABASE_URL});
try {
const result =
await sqlCREATE TABLE test ( product varchar(255), email varchar(255), campId varchar(255), date varchar(255) );;
return NextResponse.json({ result }, { status: 200 });
} catch (error) {
return NextResponse.json({ error }, { status: 500 });
}
}

What do you see in the tables after you click the “Open in Neon” button? The response {“result”:{“command”:“INSERT”,“rowCount”:1,“rows”:,“fields”:,“rowAsArray”:false,“viaNeonFetch”:true}} indicates that some data is being successfully inserted into the table

Yes, for new tables using the new code, it works.

I cant get any new data inserted in the old tables, even when the console.log says there is something there.

Surprisingly, some old tables were working with the old code.

So what now?.. since I got it running this is not big issue now, however, if the new tables stop working, then I am going back to the same problem.

Previously one table stopped working, then another, and then another… so I will keep testing the old and the new tables to see how they behave.

Btw… how many tables I have? There were around 4, but now I have around 7 with all the testing.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

I’m glad to hear all it’s all currently working with the new tables.

It’s possible you discovered an edge case, but I haven’t been able to reproduce it. If you do experience the problem again with one of new tables, please come back here and let us know so we can keep digging into the details.

1 Like