Neon

N

Neon

The official Neon Database Discord

Join

šŸ™ļ½œfeedback

ā“ļ½œquestions-and-answers

🐘|postgres

extended-salmon
extended-salmon12/30/2024

how do I see which tables are being used the most within my project since I hit my usage limit?

title. I hit my usage limit for my database but I have multiple tables for different projects within that database. Is there anyway I can tell exactly which table was used the most and hit the usage limit?
extended-salmon
extended-salmon12/29/2024

Neon RLS and Clerk Authorization

I'm looking for some docs that explain how my clerk user is recognized by postgres? Aside from comparing a user_id from a token to a table field value, what if I just want to define read access to a role? Or what if I want to create a new role and use that to secure read access to a table? I feel like the end to end explanation is not documented anywhere that I have seen. At this point I have to resort to assumptions but it's not the best way to evaluate something I will be spending time and money on in the near future. My Assumptions are: - When I create a user in Clerk, I also have to create the same user in postgres via sql script? I'll assume I can use a webhook on the Clerk side to call an API on my side to handle this script execution....
like-gold
like-gold12/29/2024

Hyperdrive private tunnel

It’s not currently possible to use the private tunnel functionality in hyperdrive because cloudflared cannot be installed. Is there any ongoing work to enable this functionality? https://developers.cloudflare.com/hyperdrive/configuration/connect-to-private-database
continuing-cyan
continuing-cyan12/28/2024

using Next.js 15 , neon , drizzle

trying to create role for Row-Level Security getting error : Tried to create a role with a NULL password export const admin = pgRole("admin"); ...
other-emerald
other-emerald12/28/2024

Cannot Connect Neon DB to Railway: Database connection error: Error: connect ECONNREFUSED ::1:5432

Hello! I'm building an app using neon for my database and railway to deploy but when deploying I get this error. ``` Database connection error: Error: connect ECONNREFUSED ::1:5432 at /app/node_modules/pg-pool/index.js:45:11...
quickest-silver
quickest-silver12/27/2024

Using chatgpt for database entry

Hi everyone! My name is Dave. Im new to this discord so i need help to navigate. Im building a new project and using chatgpt to generate the data for my database. I do t k ow if the question has been asked before but i would like to use chatgpt to automate the process. Can someone point me to a tutorial and give me some instruction on how to do it at the basic level, even if it means having to generate and import a csv or json file myself first, it would be a good firat step. My project is curre...
optimistic-gold
optimistic-gold12/27/2024

How do I open a support ticket if I'm a Vercel's customer?

Hi, I'm a Vercel's customer. I'm currently having a serious problem with postgres cold start on production environment which affects payment processing. I've contacted Vercel's support and they said "Since the underlying infrastructure is managed by Neon team, we recommend reaching out to Neon Support for specific troubleshooting and scaling tips for your Postgres database" I'm not a direct Neon's customer. How do I open a ticket?
wee-brown
wee-brown12/27/2024

is there a Batch size limit?

I am currently running a for loop to add insert commands to the batch queue. At first i tried adding all 5000+ records the the batch queue but everything fails. I limited the number of records to 100 and it works. Is there another way of adding a large number of records?...
rival-black
rival-black12/24/2024

How to Execute Custom Logic When Deleting Related Rows

Hi there, I’m working with Neon DB (serverless PostgreSQL) and have a scenario where deleting a product should cascade and delete related rows from other tables like variants, variant sizes, variant colors, and images. PostgreSQL’s foreign key constraints handle the cascade deletion well, but I need to run additional logic when images are deleted. Specifically, I want to delete the image files from Cloudinary as part of the cleanup process....
dependent-tan
dependent-tan12/24/2024

ECONNRESET error when trying to create a database from a javascript file

So I'm receiving the below error when trying to create a table from a js file using postgres. In the annexed images you can see how I wrote the code for creating the table. I was following a video doing the same, for him it worked, but not for me. The error doesn't happen if I use async, but the table doesn't get created either. What's happening here and how to solve it? ```javascript...
No description
xenial-black
xenial-black12/24/2024

Answered: Unexpected behavior with pg_trgm and special characters

Hello guys. First, thanks for the awesome work. I have encountered some inconsistency regarding the pg_tgrm extension on Neon. When I use the show_trgm, it has weird behaviors when using Japanese characters: ...
correct-apricot
correct-apricot12/23/2024

Does an AFTER UPDATE trigger happen within the original table update transaction?

Q1: If an AFTER UPDATE trigger fails, will it roll back the original table update? Q2: My application performs a database transaction that updates entries in two different PostgreSQL tables simultaneously. I want to create a trigger that calculates some data (using information from both tables) and inserts a new entry into a log table. If I create an AFTER UPDATE trigger on one of the tables, can I assume that both tables have already been updated by the time the trigger executes?...
relaxed-coral
relaxed-coral12/19/2024

Connection limit being reached too soon

I'm having issues with connection limit. I'm using 0.25 CU and Paid Plan. The SHOW max_connections; returns 112. I'm using pgbouncer, 3 services, each service has its own username. Sometimes I get these connections spikes of 55 connections (picture), and when this happens, no service can create more connections....
No description
extended-salmon
extended-salmon12/19/2024

How to efficiently enforce daily notification limits for users in a high-volume notification system?

I'm building a notification service where users have a daily limit on the number of notifications they can receive (e.g., 50 notifications/day). Currently, I check the daily limit in the database every time a notification is sent. However, with high notification volumes, this approach adds significant overhead. I’m considering using Redis for caching limits and counts, but I’m not sure about the best practices for: 1. Storing and incrementing notification counts in Redis....
fair-rose
fair-rose12/18/2024

Advice for local development

I am really enjoying using NeonDB however find I am having issues with the number of compute hours in the non-defuault branches (free tier). My workflow is currently the following: - develop locally using a branch called local-dev - when work is ready run test in CI/CD using preview branches (with vercel)...
rival-black
rival-black12/17/2024

What is expected response time vs dedicated hosted Postgres?

At the moment I am doing some performance analysis of how Neon stacks up vs our existing Heroku Postgres DB. Looking at the stats it looks like Neon queries are taking can take 20ms to respond versus 1ms in Heroku, sometimes longer. Is this performance difference expected? Are there any recommendations to help improve the performance? I have the Neon DB start at 16GB on wake to mirror our Heroku instance to avoid autoscaling delays during processing. The performance seems consistent even trying...
genetic-orange
genetic-orange12/17/2024

HTTP 423 while generating endpoint for branch that was just created.

Hello! I am using the API to generate branches in one of my applications. I first create the branch and then create an endpoint to be able to get a connection URL. My call to generate the endpoint is failing with a 423: ```ts...
robust-apricot
robust-apricot12/16/2024

Neonctl failing in github actions

Just started today for me, but when running the reset branch action i'm getting this error before any other output comes out: ERROR: The request could not be authorized due to an internal error. It looks like I'm not the only one this started happening to: https://discord.com/channels/1176467419317940276/1318273579997200395
helpful-purple
helpful-purple12/16/2024

Non-default branch compute hours limit on free plan prevents use of default branch compute hours

I reached the free-tier 5 compute hour limit for non-default branches, so I am trying to swap to the default main branch. However, all default branch computing seems to be suspended as well. I double-checked my env file's database url to ensure that I am targeting the main default branch, so I believe it is not a user error.
No description
extended-yellow
extended-yellow12/15/2024

Says limit reached when literally im 1% only there

I have made this db around 2 days ago and barely have anything in there why does this say i have reached my limit and not allowing for more - what is wrong - ik im on the free tier and not on the paid on so i wont be favoured but why this ? i dont wana come to any conclusions just yet - so im here asking for support...
No description