News for hackers. Stuff that matters.
Re:Ask HN: Have you ever used PL/pgSQL – the PostgreSQL prog... by dizzystar on Sunday September 02, 2018 @06:57PM (#17899156)
I've used it. There is a time when milliseconds count, and nothing else will help you get to that speed. I've taken some things that were running 30 seconds in app logic and reduced it down to 500ms. It's great for solving these little hot-spots. I also think the JSON processing is excellent.

I think it is pretty simple to use, but I've also had to fix a lot of poorly-written PL/pgSQL. There is a LOT of nuances to the language that can blow your feet off, and the language doesn't really scale out to multiple people working on it. You just have to find one person who is good. You also need to have an editor with snippets because the language is very verbose.

Personally, I'd rather use PL/pgSQL than any off-the-shelf ORM, but as I said, it wouldn't scale to more employees very well. The language solves one of the main use-cases of ORMs via the use of entities.

Re:Ask HN: Have you ever used PL/pgSQL – the PostgreSQL prog... by Something1234 on Sunday September 02, 2018 @08:31PM (#17899440)
PL/pgSQL supports entities? This is kind of amazing. Do you have a resource to pick this skill up?
Re:Ask HN: Have you ever used PL/pgSQL – the PostgreSQL prog... by dizzystar on Sunday September 02, 2018 @08:48PM (#17899494)
I guess I should be more specific by what I mean by entities. I probably used the wrong word here:

https://www.postgresql.org/docs/10/static/plpgsql-statements...

PL/pgSQL gives you %I and %L, which allows you to specify table and column names. Basically, if you want to `select * from %I`, you have the option to call the specific table.

Re:Ask HN: Have you ever used PL/pgSQL – the PostgreSQL prog... by Something1234 on Monday September 03, 2018 @11:06PM (#17906318)
So what's the best way to leverage this feature in crud applications?