Postgres and LOLCODE: GIMMEH RECORDZ OUTTA DATABUKKIT

hingo's picture

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 :-)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <p> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <sup> <div> <blockquote> <pre> <img>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically. (Better URL filter.)

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.