[Info-ingres] copydb failure on views

Martin Bowes martin.bowes at ndph.ox.ac.uk
Wed Feb 5 12:37:40 UTC 2020


Hi All,

On Ingres 11.1 p 15545 and earlier.

Here's some fun....

    If two users have identically named views then a copydb which
    expressly mentions those views on the command line will generate
    spurious errors E_XF0066 and E_XF0020.

    The copydb is cool if there are identically named tables.

And to demonstrate it...

1. Set up the users, their table and view in iidbdb:
sql iidbdb << _SQL_END
set autocommit on;
\p\g
create user user1;
\p\g
create user user2;
\p\g
set session authorization user1;
\p\g
create view my_view as select dbmsinfo('username') as my_user;
\p\g
create table my_table as select dbmsinfo('username') as my_user;
\p\g

set session authorization user2;
\p\g
create view my_view as select dbmsinfo('username') as my_user;
\p\g
create table my_table as select dbmsinfo('username') as my_user;
\p\g
_SQL_END

2. Do a copydb of the table for user1...this will work
copydb -uuser1 iidbdb my_table

3. Do a copydb of the view for user1...this will fail
copydb -uuser1 iidbdb my_view

Note: the copy.in actually does contain the details for the view.

4. Do an unrestricted copy of iidbdb for user1 ...this will work
copydb -uuser1 iidbdb

5. cleanup
sql iidbdb << _SQL_END
set autocommit on;
\p\g
set session authorization user1;
\p\g
drop view if exists my_view;
\p\g
drop table if exists my_table;
\p\g

set session authorization user2;
\p\g
drop view if exists my_view;
\p\g
drop table if exists my_table;
\p\g

set session authorization ingres;
\p\g
drop user user1;
\p\g
drop user user2;
\p\g
_SQL_END

Marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20200205/92ac4077/attachment.html>


More information about the Info-ingres mailing list