Neon

N

Neon

The official Neon Database Discord

Join

🙏|feedback

❓|questions-and-answers

🐘|postgres

uninterested-red
uninterested-red11/14/2024

Removing parent branch that is old backup

Hello, I recently did a point in time restore of my prod db. As a result, it has created a prodold branch that is set as the parent of the prod branch. I have since truncated a large table in my prod branch that was causing me to exceed the storage limit for my plan. However, this table still exists in its entirety in the prod_old branch. How do I remove this prod_old branch? And if this is not possible, can I safely truncate the table in prod_old without causing a knock-on effect / reset of t...
genetic-orange
genetic-orange11/13/2024

Migrate Dev Branch to Main

I was expecting an easy way to merge my dev branch to main so that my production app would point to the schema it was built off of in dev, but I'm missing something 🤔 I'm almost positive this is just a knowledge gap of mine, but I would really appreciate it if someone could help me understand how to fulfill the following flow... I work off of dev locally, push and open a PR. That PR gets merged and the DB inherits the updated schema I was working off of in dev....
foreign-sapphire
foreign-sapphire11/12/2024

Separate DNS records for read replicas and write replica

I m trying to test multiple read replicas approach but having different endpoint per replica is being a bit a bottleneck for me. So I ve created a CNAME record that would route requests to the read replicas according to a certain routing policy. However now I m having issues with my connection not being secure. I use my own domain and couldnt find a way to add a new domain, ssl cert to replicas. Is there a way to bring my own domain/certs to the instances? or any better idea recommendation for s...
genetic-orange
genetic-orange11/11/2024

Documentation for the /sql API endpoint

Hi I was wondering if there was any doco available for the /sql endpoint? Also, has there been any movement since earlier in the year around a serverless driver for Java?...
like-gold
like-gold11/11/2024

Need to capture DDL events

Just saw that creating event triggers is currently not supported, but I need a way to capture drop table & alter table events - any workarounds possible or do I need to use another postgres service?
equal-aqua
equal-aqua11/10/2024

URL Problems

I have been using neon db for my expo react native application for server routes but in the production phase I need clear routes for the backend route that I was using locally. Something like "https://..." am getting this error "'Fetch error:', [TypeError: Invalid URL: /(api)/driver/create]" Where can I go to get that url?
conscious-sapphire
conscious-sapphire11/9/2024

Connection Pooling

Hi Neon Team, I've deployed my applicaiton using Neon as the DB, Prisma as the ORM and it's built on Next JS/hosted on Vercel. I'd like to activate Pooling to improve performance, what do I need to do in regard to Vercel and Prisma to acheive this properly?
afraid-scarlet
afraid-scarlet11/8/2024

Improving efficiency of database calls

Hi! I'm quite new to Postgres and Neon, and am wondering if you have any tips regarding best approaches for improving the speed of database operations. Such as how to split up sessions, how often to commit, and so on. I currently have a db_engine and use a get_session function to get the session in all of my database calls:...
stormy-gold
stormy-gold11/8/2024

How to set up HNSW index? (Nextjs, Prisma, Langchain)

I am using nextjs with prisma, langchain, and Neon. Users can create teams and upload content that should be used as context for LLMs. Uploaded content is chunked and put into the Chunks table together with a vector embedding using pg_vector extension. Using Langchain I then retrieve the top 10 vectors based on the user query. So far I havent created an index on the embedding column but with growing vector count now it becomes slow that I have to tackle this. I have read that HNSW is the most suitable for my use case. Needing speed and most accuracy. Also I need metadata filtering so that the retrieval only gets the vectors that are from one team and doesnt include other teams data. Is that possible with HNSW or do I need to create an index for each team individually (if that is possible?)...
xenial-black
xenial-black11/8/2024

Elaboration on "Compute Hours" for Discord bots.

Hello, new to NeonDB and would like to have an elaboration on "Compute Hours". I have a discord bot that is written with discord.py and its quite active, so its almost guaranteed that the database would never go into the 5 minute "Idle stage". With that said, does that mean that my Compute Hour would always be above 720 hours (24hrs x 30days x CU) for each month?...
wise-white
wise-white11/8/2024

Neon DB connection URL not reachable by Prisma and NeonDB console saying unexpected error occurred

I am facing this error while using neon db, and also in Prisma i am getting the error that database at given db url is not reachable, any help would be much appreciated.
No description
like-gold
like-gold11/7/2024

How to delete devdb?

I created my own database called "devdb" in a project, but I am not going to use it anymore and I need to delete it because I need the space for changes I want to make to neondb. I do not see the option to delete it in the Neon Console and DROP DATABASE is also not working as apparently I am not the owner. Can someone help me with this please?...
conscious-sapphire
conscious-sapphire11/7/2024

Is it possible to import a postgresql database to Neon

We are already using a different db provider and want to migrate to Neon, Is it possible to migrate our existing data?
conventional-tan
conventional-tan11/6/2024

Is it possible to create branches without data (just the structure)

I saw an option for this a while ago, it's not there anymore
eastern-cyan
eastern-cyan11/5/2024

Are the paid plans billed by days or one month minimum ?

Is it the same when going by aws marketplace ?
wise-white
wise-white11/5/2024

Nextjs server actions: best way to connect?

Hi, sorry for this question as I'm a complete beginner. As I was going through the docs, I noticed there's nothing about setting up a global variable to initiate a connection pool (like you would with PrismaClient()) and then reusing it throughout your logic. Do I need to use const sql = neon(process.env.DATABASE_URL) in every server action where I want to interact with the database? It seems to me this would open a new connection each time, so I’m wondering if there’s a better way to handle t...
sensitive-blue
sensitive-blue11/5/2024

3.4gb database, but billed for 22gb?

Hey, a bit stumped on this. Our DB reports 3.4gb in data storage, but overall storage that we're billed for is close to 22gb... my first thought was indexes, so I ran this query - screenshot attached - (thanks ChatGPT) to list indexes & storage size of each, and it looks clear... Any thoughts?...
No description
rising-crimson
rising-crimson11/4/2024

Why are we getting storage limit reached ?

I have attached screenshot where the dashboard suggest we have reached the limits, whereas in the billings It looks like we are fine
No description
other-emerald
other-emerald11/4/2024

Creating role via API vs psql, connection dropping

I noticed in the typescript api client docs that when you create a role with createProjectBranchRole it says Connections established to the active compute endpoint will be dropped. Why does this happen? I see in the docs that if i want to have neon_superuser role i need to create the role from the api. Is there a way to create these roles without having al the active connections dropped?...
passive-yellow
passive-yellow11/4/2024

Free to Launch. But Storage not work

I am a neon beginner. I created a project using a free account, and now I encounter PostgresError: could not extend file because project size limit (512 MB) has been exceeded. I upgraded my subscription to launch, and theoretically, it should have upgraded to 10g storage. However, I waited for ten minutes and still encountered this error.