I was wrong in my last post, it seems that all Sun database developers are now part of the same organisation, including PostgreSQL's Josh Berkus.
MySQL has the pluggable storage engine architecture, which is unique in the industry. The idea is you pick from among a suite of storage engines the most suitable one. PostgreSQL on the other hand has a plugin architecture for programming languages you can then use for stored procedures. And the cool thing about Open Source...
Someone went as far as to implement a PostgreSQL plugin of LOLCODE, a funny programming language I didn't know about until recently. So now you could do this with PostgreSQL:
CREATE FUNCTION HAI_WORLDZ RETURNS TEXT AS $$ HAI CAN HAS DATABUKKIT? GIMMEH RECORDZ OUTTA DATABUKKIT "SELECT COUNT(*) FROM YRTABLE" BOTH SAEM RECORDZ AN 0, O RLY? YA RLY, FOUND "SUMWUNZ IN YR DATABUKKIT STEELIN YR DATAZ" NO WAI, FOUND "HAI, WORLDZ! YR DATAZ R IN YR DATABUKKIT!" KTHX KTHXBYE eggyknap=# SELECT HAI_WORLDZ(); hai_worldz ----------------------------------------------------------------------- SUMWUNZ IN YR DATABUKKIT STEELIN YR DATAZ (1 row)
It seems to me, the example is a procedure that checks whether a table is empty. The procedure is called once and it prints a message that tells you that the table in this case indeed was lacking any data.
- Log in to post comments
- 18641 views