3 ms·
Perhaps I'm missing something, but: > Triggers work on entire dataset instead of row by row. in pgsql you can have trigger that works per row or per dataset [
by takeda 12y ago
Perhaps I'm missing something, but:
> Triggers work on entire dataset instead of row by row.
in pgsql you can have trigger that works per row or per dataset [1]
> Stored procs can return multiple data sets and output variables all from a single call.
you can provide results through arguments by using "OUT" as argmode [2]
> Opinion: t-sql is friendlier than pgpsql to work in.
while it is hard to argue with an opinion, you can also use Tcl, Perl, Python (these three come standard), Java, PHP, R, Ruby, Scheme, sh[3].
[1] http://www.postgresql.org/docs/current/static/sql-createtrigger.html http://www.postgresql.org/docs/current/static/sql-createtrig...
[2] http://www.postgresql.org/docs/current/static/sql-createfunction.html http://www.postgresql.org/docs/current/static/sql-createfunc...
[3] http://www.postgresql.org/docs/current/interactive/external-pl.html http://www.postgresql.org/docs/current/interactive/external-...
- brlewis 12y agoI'm generally a fan of pgsql, but mssql triggers are better in that they can operate on the entire set of affected rows. Postgres FOR EACH STATEMENT triggers don't get any OLD or NEW; you only get those with FOR EACH ROW triggers. In mssql OLD and NEW are the entire set of affected rows and can be used like tables. Batch operations are thus more efficient. http://www.postgresql.org/docs/9.4/static/plpgsql-trigger.html http://www.postgresql.org/docs/9.4/static/plpgsql-trigger.ht...