[Info-ingres] convtohyb ... is it just me?

Martin Bowes martin.bowes at ndph.ox.ac.uk
Wed May 19 08:12:32 UTC 2021


Hi All,

I have a test table:
create table test_conv(
    id integer4 not null not default,
    a  integer4 not null with default,
    b  float4   not null with default,
    tinsert ingresdate not null with default 'now',
    tupdate ingresdate not null with default ''
) with nojournaling;

insert into test_conv(id, a, tinsert, tupdate) values
    (1, 11, '1-jan-1970', '11-jan-1970 11:12:31'),
    (2, 12, '2-dec-1985', '12-jan-1986 12:12:12'),
    (3, 13, '3-feb-2020', '5-mar-2021 12:45:56');

modify test_conv to btree unique on id with unique_scope=statement;

create unique index test_conv_a on test_conv(a) with unique_scope=statement;

create index test_conv_b on test_conv(b);

And then run: convtohyb -to_ansi iidbdb test_conv

Now given the data I would expect my tinsert to become ansidate and tupdate to become timestamp(0) without time zone.

And examining the generated conversion script ctohout.sql that is indeed what I get...sort of:
drop index if exists test_conv_a
\p\g
drop index if exists test_conv_b
\p\g
alter table ingres.test_conv alter column tinsert ansidate not null default CURRENT_TIMESTAMP
\p\g
alter table ingres.test_conv alter column tupdate timestamp(0) without time zone not null default NULL
\p\g
modify test_conv to btree unique on
    id
with nonleaffill = 80,
    leaffill = 70,
    fillfactor = 80,
    extend = 16,
    page_size = 8192,
    unique_scope = statement
\p\g

    /* INDEXES */
create index (test_conv_a on test_conv (
    a) unique
with structure = isam,
    page_size = 8192,
    nocompression,
    key = (a),
    unique_scope = statement,
    fillfactor = 80,
    location = (ii_database)),
(test_conv_b on test_conv (
    b)
with structure = isam,
    page_size = 8192,
    nocompression,
    key = (b),
    fillfactor = 80,
    location = (ii_database))
\p\g

The problem being that the two alter statements don't work and the less said about that attempt to recreate indexes the better!

Martin Bowes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20210519/530c73cb/attachment.html>


More information about the Info-ingres mailing list