ora2pg icon indicating copy to clipboard operation
ora2pg copied to clipboard

Type is missing schema specification

Open unrandom123 opened this issue 4 years ago • 0 comments

With a ora2pg.conf with SCHEMA myself EXPORT_SCHEMA 1 PACKAGE_AS_SCHEMA 1

it seems to export fine, but I ran into an error, and I think it is because the return type did not get the schema specification

DROP SCHEMA IF EXISTS foo CASCADE;
CREATE SCHEMA IF NOT EXISTS foo;
ALTER SCHEMA foo OWNER TO myself;
-- sorry for messy nested types...
CREATE TYPE foo.sed AS (...);
CREATE TYPE foo.awk AS (awk foo.sed[]);
CREATE TYPE foo.grep AS (...);
CREATE TYPE foo.bar AS (bar foo.grep[]);
CREATE OR REPLACE FUNCTION foo.my_func () RETURNS SETOF awk AS $body$ ...;

The problem is the last line with "SETOF awk". That does not work, but with "SETOF foo.awk" it works. So it seems it is missing the "foo" schema specification. It is easy to add by hand but it would be great if ora2pg could fix it. In the oracle db it does not specify the package in the return type, so I guess it is natural for ora2pg to NOT add the schema.

unrandom123 avatar Nov 16 '20 13:11 unrandom123