7.4 ERROR: CREATE LOCAL TEMPORARY TABLE ... ON COMMIT DROP inside a function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ezra epstein

    7.4 ERROR: CREATE LOCAL TEMPORARY TABLE ... ON COMMIT DROP inside a function

    I found a post about something similar in an older release:
    The workaround is now in the FAQ, use pl/pgsql EXECUTE on any query dealing with the temp table. --------------------------------------------------------------------------- pgsql-bugs@postgresql.org …


    Here's the issue. Inside a function I'm calling
    CREATE LOCAL TEMPORARY TABLE ds_copy_item_me ta ( LIKE
    merchandise.ite m_meta EXCLUDING DEFAULTS ) on COMMIT DROP;

    Of course it might be that the ON COMMIT DROP is redundant, I don't know
    enough about temp tables. Here's the problem, however, the first call of
    the table works fine. The second call it complains about a bad OID. Could
    it be that the bug that was fixed for regular temporary tables (without an
    on commit modifier) somehow didn't get fixed for this construct?

    The work-around has been to just not use the modifier, but I was surprised
    by the OID error and think it might be incorrect behavior.

    == Ezra Epstein.



  • ezra epstein

    #2
    Re: 7.4 ERROR: CREATE LOCAL TEMPORARY TABLE ... ON COMMIT DROP inside a function

    Typo, see below:

    "ezra epstein" <ee_newsgroup_p ost@prajnait.co m> wrote in message
    news:xl2dnZZJS7 1gH2iiXTWc-g@speakeasy.net ...[color=blue]
    > I found a post about something similar in an older release:
    > http://archives.postgresql.org/pgsql...8/msg00151.php
    >
    > Here's the issue. Inside a function I'm calling
    > CREATE LOCAL TEMPORARY TABLE ds_copy_item_me ta ( LIKE
    > merchandise.ite m_meta EXCLUDING DEFAULTS ) on COMMIT DROP;
    >
    > Of course it might be that the ON COMMIT DROP is redundant, I don't know
    > enough about temp tables. Here's the problem, however, the first call of
    > the table works fine. The second call it complains about a bad OID.[/color]
    Could

    that should read: the first call of the function.
    [color=blue]
    > it be that the bug that was fixed for regular temporary tables (without an
    > on commit modifier) somehow didn't get fixed for this construct?
    >
    > The work-around has been to just not use the modifier, but I was surprised
    > by the OID error and think it might be incorrect behavior.
    >
    > == Ezra Epstein.
    >
    >
    >[/color]


    Comment

    Working...