Databases

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • The relative stability of different procedural languages

    6 answers - 1136 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.
    However, I've been unable to find any useful information on the
    stability of each particular procedural language. I've seen suggestions
    for creating a PL comparison matrix, but, short of such a matrix, I
    couldn't even find essential information regarding the vitality and
    stability of the various PLs.
    I'm comfortable with both Ruby and Perl, but wouldn't mind brushing up
    a bit on my Python. I'm also comfortable with PHP but have to say that
    the idea of running it within Postgres doesn't appeal to me very much.
    So, how to the different procedural languages stack up against each
    other in terms of stability? After all, adding a language that could
    cause random segfaults or huge memory leaks is simply not an option for
    a production DB.
    (end of broadcast)
    TIP 4: Have you searched our list archives?
  • No.1 | | 585 bytes | |

    7 Dec 2006 14:02:53 -0800, BigSmoke <bigsmoke (AT) gmail (DOT) comwrote:
    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.

    could you clarify what you are trying to do and why pl/pgsql cant do it?

    merlin

    (end of broadcast)
    TIP 9: In versions below 8.0, the planner will ignore your desire to
    choose an index scan if your joining column's datatypes do not
    match
  • No.2 | | 369 bytes | |

    Thu, 2006-12-07 at 14:02 -0800, BigSmoke wrote:
    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.

    PLPerl. And I say this as someone who doesn't even like Perl.

    Joshua D. Drake
  • No.3 | | 1100 bytes | |

    Dec 7, 11:07 pm, mmonc (AT) gmail (DOT) com ("Merlin Moncure") wrote:
    7 Dec 2006 14:02:53 -0800, BigSmoke <bigsm (AT) gmail (DOT) comwrote:

    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.

    could you clarify what you are trying to do and why pl/pgsql cant do it?

    I'm dealing with a trigger function which needs to check the nullness
    of a column in 'new' and 'old'. The catch is that the trigger function
    needs to take the name of that column as an argument. (I've tried a
    kludge which stores 'new' and 'old' in a temporary table, but this
    kludge seems too unreliable to trust.)

    - Rowan

    (end of broadcast)
    TIP 1: if posting/reading through Usenet, please send an appropriate
    subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
    message can get through to the mailing list cleanly
  • No.4 | | 596 bytes | |

    Dec 7, 11:11 pm, j (AT) commandprompt (DOT) com ("Joshua D. Drake") wrote:
    Thu, 2006-12-07 at 14:02 -0800, BigSmoke wrote:
    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.PLPerl. And I say this as someone who doesn't even like Perl.

    Joshua D. Drake

    Thanks heaps! That's the answer I was looking for.

    - Rowan

    (end of broadcast)
    TIP 6: explain analyze is your friend
  • No.5 | | 1431 bytes | |

    BigSmoke wrote:
    Dec 7, 11:07 pm, mmonc (AT) gmail (DOT) com ("Merlin Moncure") wrote:

    >7 Dec 2006 14:02:53 -0800, BigSmoke <bigsm (AT) gmail (DOT) comwrote:
    >>

    >

    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.


    >could you clarify what you are trying to do and why pl/pgsql cant do it?
    >
    >

    I'm dealing with a trigger function which needs to check the nullness
    of a column in 'new' and 'old'. The catch is that the trigger function
    needs to take the name of that column as an argument. (I've tried a
    kludge which stores 'new' and 'old' in a temporary table, but this
    kludge seems too unreliable to trust.)

    Why can't you just use something like this:

    IF new.yourcolumnname IS NULL THEN

    END IF;

    I test for null in PLpgsql all the time.

    Am I missing something?

    Later,

    Tony Caduto
    AM Software Design

    Home of PG Lightning Admin for Postgresql
    Your best bet for Postgresql Administration

    (end of broadcast)
    TIP 5: don't forget to increase your free space map settings
  • No.6 | | 1472 bytes | |

    Dec 7, 11:42 pm, tony_cad (AT) amsoftwaredesign (DOT) com (Tony Caduto)
    wrote:
    BigSmoke wrote:
    Dec 7, 11:07 pm, mmonc (AT) gmail (DOT) com ("Merlin Moncure") wrote:
    >
    >7 Dec 2006 14:02:53 -0800, BigSmoke <bigsm (AT) gmail (DOT) comwrote:
    >

    I'm facing a particular task for which I need any procedural language
    but PL/PgSQL. I can't use PL/PgSQL because it doesn't allow me to use
    local variables such as new and old from a dynamic command.
    >
    >could you clarify what you are trying to do and why pl/pgsql cant do it?
    >

    I'm dealing with a trigger function which needs to check the nullness
    of a column in 'new' and 'old'. The catch is that the trigger function
    needs to take the name of that column as an argument. (I've tried a
    kludge which stores 'new' and 'old' in a temporary table, but this
    kludge seems too unreliable to trust.)Why can't you just use something like this:

    IF new.yourcolumnname IS NULL THEN

    END IF;

    I test for null in PLpgsql all the time.

    Am I missing something?

    Yes, you're missing something. ;-) Your example doesn't work in my case
    where mycolumnname is in argument that is passed to the function.

    - Rowan

    (end of broadcast)
    TIP 4: Have you searched our list archives?

Re: The relative stability of different procedural languages


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "Databases"

EMSDN.COM