problems with SYNONYMS using ONLINE
Posted in 1994
The following problem occurs with synonyms.
Consider the two databases d1 and d2 with the following tables:
CREATE DATABASE d2@maicgn WITH LOG ;
CREATE DATABASE d1@maicgn WITH LOG ;
CREATE TABLE heinrich.t ( col1 SERIAL PRIMARY KEY , col2 INT ) ;
CREATE TABLE heinrich.t1 ( col1 INT , col2 INT UNIQUE ,
FOREIGN KEY ( col2 ) REFERENCES heinrich . t ( col1 ) ) ;
CREATE TABLE heinrich.t2 ( col3 INT REFERENCES heinrich . t ( col1 ) ,
col4 INT REFERENCES heinrich . t1 ( col2 ) ) ;
-- insert some values
INSERT INTO heinrich . t ( col2 ) VALUES ( -1 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 0 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 1 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 2 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 3 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 4 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 5 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 6 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 7 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 8 );
INSERT INTO heinrich . t ( col2 ) VALUES ( 9 );
INSERT INTO heinrich . t1 VALUES ( 1 , 1 );
INSERT INTO heinrich . t1 VALUES ( 2 , 2 );
INSERT INTO heinrich . t1 VALUES ( 3 , 3 );
INSERT INTO heinrich . t1 VALUES ( 4 , 4 );
INSERT INTO heinrich . t1 VALUES ( 5 , 5 );
-- now, create tables on d2 and synonyms to d1 tables
DATABASE d2@maicgn;
CREATE TABLE heinrich.t ( col1 INTEGER , col2 INTEGER );
CREATE SYNONYM heinrich.t_S FOR d1@maicgn:heinrich.t;
CREATE TABLE heinrich.t1 ( col1 INTEGER , col2 INTEGER );
CREATE SYNONYM heinrich.t1_S FOR d1@maicgn:heinrich.t1;
CREATE TABLE heinrich.t2 ( col3 INTEGER , col4 INTEGER );
CREATE SYNONYM heinrich.t2_S FOR d1@maicgn:heinrich.t2;CLOSE DATABASE;
-- now, insert a value into d1:heinrich.t2
DATABASE d2@maicgn;
INSERT INTO d1: heinrich . t2 VALUES ( 2 , 3 );
-- this yields the error message
-- The specified table (d1:heinrich.t_s) is not in the database.
syssyntable shows the following, which seems to be o.k.:
SELECT systables.tabname, syssyntable.dbname,
syssyntable.servername, syssyntable.tabname
FROM systables, syssyntable
WHERE syssyntable.tabid=systables.tabid
tabname dbname servername tabname
t_s d1 t
t1_s d1 t1
t2_s d1 t2
We use OnLine 5.00.UC2 on Sun OS 4.1.3. Is this a known behaviour?
Or even a bug?
Any help appreciated.
Heinrich.
--
My onions are my own.=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/M/A/I Deutschland GmbH, Softwarezentrum Koeln Heinrich Seebauer
Mathias-Brueggen-Str. 85 Software Engineering
50829 Koeln, Federal Republic of Germany
Phone: x221/956400-0 Phax: x221/956400-69 email: heinrich@mai.de
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=