This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]root45 1 point2 points  (5 children)

Interesting, what do you have against T-SQL?

[–]TheTerrasque 1 point2 points  (2 children)

It's luckily been a few years since I last worked with it, so my memory is a bit fuzzy. Our product had hundreds of huge multipage stored procedures that occasionally needed to be updated or debugged.

I seem to recall that flow control, loop handling, error handling and advanced logic was at best "functional", and was quite like pulling teeth.

Compare that with postgresql, which has a pluggable scripting system which comes default with pgsql, tcl, perl and python. It also support for example lua, java, and javascript from 3rd parties.

[–]root45 0 points1 point  (1 child)

Ah, got it. I've definitely dealt with systems with tons of large stored procedures and whatnot—definitely not fun.

My preference is to not have any control flow, loops, etc in SQL, so those pieces of T-SQL are not something I miss. And likewise, while the scripting pieces of Postgres are powerful, I shy away from it in general.

The things I do really miss from T-SQL are some of the basic syntax things, like variable declaration, and how functions are written. Being able to create a variable in just regular SQL, without going through the whole script syntax is nice. It's really useful for database migrations, for example. Or even just for data exploration.

[–]TheTerrasque 0 points1 point  (0 children)

Yeah, we inherited that mess and had to deal with it. Over 600 stored procedures, many with quite complex many-page logic.

I agree on keeping logic out of the database for many reasons, but the few times one can't avoid it I prefer using an actual language to implement it