• Re: [Info-ingres] defaults in session tables

    From Roy Hann@specially@processed.almost.meat to comp.databases.ingres on Thu Feb 4 09:40:32 2021
    From Newsgroup: comp.databases.ingres

    Martin Bowes wrote:

    [snip]

    So clearly we have a session temp table which respects my user
    defaults...we just can't create it directly.

    That seems weird.

    I am struggling to decide whether it is right that _any_ table created
    AS SELECT gets the defaults. (Then again, I have never been at
    ease with the whole idea of default values.)

    I will hate myself when I exploit that trick.

    Roy
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Martin Bowes@martin.bowes@ndph.ox.ac.uk to info-ingres@lists.planetingres.org on Thu Feb 4 09:49:23 2021
    From Newsgroup: comp.databases.ingres

    I am struggling to decide whether it is right that _any_ table created AS SELECT gets the defaults. (Then again, I have never been at ease with the whole idea of default values.)
    I will hate myself when I exploit that trick.
    I love the defaults coming over in create as select. Plus I got comfortable hating myself years ago.
    Marty
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Karl Schendel@schendel@kbcomputer.com to info-ingres@lists.planetingres.org on Thu Feb 4 09:04:53 2021
    From Newsgroup: comp.databases.ingres


    On Feb 4, 2021, at 4:00 AM, Martin Bowes <martin.bowes@ndph.ox.ac.uk> wrote:

    So clearly we have a session temp table which respects my user defaultsrCawe just canrCOt create it directly.

    That seems weird.
    It does seem weird. It might be so that declare global temporary table can be fully locking-free; if defaults were allowed then you need an insert into iidefault.
    The declare as select has the new GTT referring to an existing value in iidefault, so the issue doesn't arise.
    A bit of a lame excuse though.
    Karl
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Martin Bowes@martin.bowes@ndph.ox.ac.uk to info-ingres@lists.planetingres.org on Thu Feb 4 14:17:52 2021
    From Newsgroup: comp.databases.ingres

    Hi Karl,

    Do you need an insert into iidefaults? I presume there no insert into iirelation, iiattribute for the temps when created so I assume that the temp table details are a purely in memory structure.

    Marty

    -----Original Message-----
    From: Karl Schendel <schendel@kbcomputer.com>
    Sent: 04 February 2021 14:05
    To: info-ingres@lists.planetingres.org
    Subject: Re: [Info-ingres] defaults in session tables


    On Feb 4, 2021, at 4:00 AM, Martin Bowes <martin.bowes@ndph.ox.ac.uk> wrote:

    So clearly we have a session temp table which respects my user defaultsrCawe just canrCOt create it directly.

    That seems weird.

    It does seem weird. It might be so that declare global temporary table can be fully locking-free; if defaults were allowed then you need an insert into iidefault.
    The declare as select has the new GTT referring to an existing value in iidefault, so the issue doesn't arise.

    A bit of a lame excuse though.

    Karl

    _______________________________________________
    Info-ingres mailing list
    Info-ingres@lists.planetingres.org https://lists.planetingres.org/mailman/listinfo/info-ingres
    --- Synchronet 3.21b-Linux NewsLink 1.2
  • From Karl Schendel@schendel@kbcomputer.com to info-ingres@lists.planetingres.org on Thu Feb 4 09:27:14 2021
    From Newsgroup: comp.databases.ingres

    iidefault is not table specific; it only contains defid1, defid2, defvalue. Once you
    get an entry into iidefault (via the regular create table), the session table declared as select merely has to reference the existing iidefault.
    If you drop a table, the iidefault rows stay, and in fact I'm not sure if there is
    any mechanism at all to clean up unreferenced iidefault rows. (verifydb, maybe.)
    I haven't verified this, but a series such as create x(with default); declare y as select from x; drop x; insert into y should work and should allow defaulting.
    Karl
    On Feb 4, 2021, at 9:17 AM, Martin Bowes <martin.bowes@ndph.ox.ac.uk> wrote:

    Hi Karl,

    Do you need an insert into iidefaults? I presume there no insert into iirelation, iiattribute for the temps when created so I assume that the temp table details are a purely in memory structure.

    Marty

    -----Original Message-----
    From: Karl Schendel <schendel@kbcomputer.com>
    Sent: 04 February 2021 14:05
    To: info-ingres@lists.planetingres.org
    Subject: Re: [Info-ingres] defaults in session tables


    On Feb 4, 2021, at 4:00 AM, Martin Bowes <martin.bowes@ndph.ox.ac.uk> wrote: >>
    So clearly we have a session temp table which respects my user defaultsrCawe just canrCOt create it directly.

    That seems weird.

    It does seem weird. It might be so that declare global temporary table can be fully locking-free; if defaults were allowed then you need an insert into iidefault.
    The declare as select has the new GTT referring to an existing value in iidefault, so the issue doesn't arise.

    A bit of a lame excuse though.

    Karl

    _______________________________________________
    Info-ingres mailing list
    Info-ingres@lists.planetingres.org https://lists.planetingres.org/mailman/listinfo/info-ingres
    --- Synchronet 3.21b-Linux NewsLink 1.2