3 ms·
I've been writing PostgreSQL stored procedures a.k.a functions for almost 10 years. They're great, and have only gotten better. I regularly switch between SQL,
by asnyder 13y ago
I've been writing PostgreSQL stored procedures a.k.a functions for almost 10 years. They're great, and have only gotten better. I regularly switch between SQL, plpgsql, and python depending on what's best for the job. Also, plpgsql allows for some really nice functionality with relative ease.
Honestly I don't understand how anyone can do more than a basic query in the command line for PostgreSQL. I've been using EMS's PostgreSQL Manager (www.sqlmanager.net) for years. Has auto-complete, even from local aliases. Named, numbered, parameters. Provides base templates for your BEGIN and END, and lots of other goodies. I could work without it, but it would be much more time consuming. I do however, practice most things in the SQL Editor first. Though it does have good built in analysis, sometimes it's nice to just try different things before committing them to a function.
Edit:
Honestly, I wish they had better screenshots, but this should give you an idea:
Functions: http://www.sqlmanager.net/en/products/postgresql/manager/screenshots/1569 http://www.sqlmanager.net/en/products/postgresql/manager/scr...
Debugging: http://www.sqlmanager.net/en/products/postgresql/manager/screenshots/1570 http://www.sqlmanager.net/en/products/postgresql/manager/scr...
Triggers: http://www.sqlmanager.net/products/postgresql/manager/screenshots/1567 http://www.sqlmanager.net/products/postgresql/manager/screen...
Query Builder: (used this much more when I was younger) http://www.sqlmanager.net/en/products/postgresql/manager/screenshots/1586 http://www.sqlmanager.net/en/products/postgresql/manager/scr...
Full list: (though don't know how current) http://www.sqlmanager.net/en/products/postgresql/manager/screenshots http://www.sqlmanager.net/en/products/postgresql/manager/scr...
- ibotty 13y agopsql also has auto-complete. honestly i really like psql. have a look at its manpage for how much you can customize it to your needs!
- asnyder 13y agoIMO psql is nice for basic things, but when you're writing hundreds of functions it's nice to be able to navigate and manage/edit things a bit more quickly.
- ibotty 13y agowhen you are writing hundreds of functions, do you do that live? i use text files and version control. psql is for tinkering around with the db when more disciplined approaches seem like overkill.