Re: Stored procedures or raw queries

2025-08-06 Thread Philip Semanchuk
> On Aug 6, 2025, at 8:03 AM, Simon Connah wrote: > > Hi, > > I'm pretty new to PostgreSQL and am building a simple website with it. > > My main question is whether I should use stored procedures / functions > or whether I should embed raw SQL queries in my backend? I understand > that proce

Re: Stored procedures or raw queries

2025-08-06 Thread Marco Torres
In my experience, starting with store procedures in a project might seem overwhelming. Still, as time passes, and your deliverables output grows, it becomes easier to maintain and improve your products. It is just a different paradigm that allows you to focus on improving your code everywhere. Rem

Re: Stored procedures or raw queries

2025-08-06 Thread Dominique Devienne
On Wed, Aug 6, 2025 at 2:04 PM Simon Connah wrote: > My main question is whether I should use stored procedures / functions > or whether I should embed raw SQL queries in my backend? I understand > that procedures are faster as it cuts down on the round trip speed and > the database can optimise i

Re: Stored procedures or raw queries

2025-08-06 Thread Simon Connah
Thank you all for your help. It is much appreciated. I'll have a play around and see how things work out. Simon. On Wed, 6 Aug 2025 at 14:17, Philip Semanchuk wrote: > > > > > On Aug 6, 2025, at 8:03 AM, Simon Connah wrote: > > > > Hi, > > > > I'm pretty new to PostgreSQL and am building a simp

Re: Stored procedures or raw queries

2025-08-06 Thread Justin Swanhart
Generally you should use stored procedures when it will reduce the number of round trips to the database. Wrapping simple SELECT statements in a stored proc just adds friction for updating the application especially as the number of developers grows. On Wed, Aug 6, 2025, 8:04 AM Simon Connah wro

Re: Stored procedures or raw queries

2025-08-06 Thread Pavel Stehule
Hi st 6. 8. 2025 v 14:04 odesílatel Simon Connah napsal: > Hi, > > I'm pretty new to PostgreSQL and am building a simple website with it. > > My main question is whether I should use stored procedures / functions > or whether I should embed raw SQL queries in my backend? I understand > that proc

Stored procedures or raw queries

2025-08-06 Thread Simon Connah
Hi, I'm pretty new to PostgreSQL and am building a simple website with it. My main question is whether I should use stored procedures / functions or whether I should embed raw SQL queries in my backend? I understand that procedures are faster as it cuts down on the round trip speed and the databa