Postgres and LOLCODE: GIMMEH RECORDZ OUTTA DATABUKKIT

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.

I can't believe I'm working which such funny people now :-)

Add new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed.
  • External and mailto links in content links have an icon.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • Each email address will be obfuscated in a human readable fashion or, if JavaScript is enabled, replaced with a spam resistent clickable link. Email addresses will get the default web form unless specified. If replacement text (a persons name) is required a webform is also required. Separate each part with the "|" pipe symbol. Replace spaces in names with "_".
About the bookAbout this siteAcademicAmazonBeginnersBooksBuildBotBusiness modelsbzrCassandraCloudcloud computingclsCommunitycommunityleadershipsummitConsistencycoodiaryCopyrightCreative CommonscssDatabasesdataminingDatastaxDevOpsDrizzleDrupalEconomyelectronEthicsEurovisionFacebookFrosconFunnyGaleraGISgithubGnomeGovernanceHandlerSocketHigh AvailabilityimpressionistimpressjsInkscapeInternetJavaScriptjsonKDEKubuntuLicensingLinuxMaidanMaker cultureMariaDBmarkdownMEAN stackMepSQLMicrosoftMobileMongoDBMontyProgramMusicMySQLMySQL ClusterNerdsNodeNoSQLodbaOpen ContentOpen SourceOpenSQLCampOracleOSConPAMPPatentsPerconaperformancePersonalPhilosophyPHPPiratesPlanetDrupalPoliticsPostgreSQLPresalespresentationsPress releasesProgrammingRed HatReplicationSeveralninesSillySkySQLSolonSunSybaseSymbiansysbenchtalksTechnicalTechnologyThe making ofTungstenTwitterUbuntuvolcanoWeb2.0WikipediaWork from HomexmlYouTube