Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

informix to postgres: WITH (NOT VARIANT) unhandled #21

Open
strk opened this issue Mar 21, 2018 · 2 comments
Open

informix to postgres: WITH (NOT VARIANT) unhandled #21

strk opened this issue Mar 21, 2018 · 2 comments

Comments

@strk
Copy link

strk commented Mar 21, 2018

An Informix function like this:

CREATE FUNCTION crs_upperAnsi(avc VARCHAR(255) )
RETURNING VARCHAR(255) AS normalised
WITH (NOT VARIANT);
    -- Call function for macron and case insensitive functional indexes
    RETURN cf_ccl_upperAnsi(avc);
END FUNCTION;

Gets converted to this broken PostgreSQL code:

CREATE OR REPLACE FUNCTION crs_upperAnsi(avc VARCHAR(255) )
RETURNS VARCHAR(255) AS $$

BEGIN
WITH (NOT VARIANT);
    -- Call function for macron and case insensitive functional indexes
    RETURN cf_ccl_upperAnsi(avc);
END;
$$ LANGUAGE plpgsql;

See the WITH (NOT VARIANT) part, which makes PostgreSQL choke. Things work fine by removing that line.

@strk
Copy link
Author

strk commented Mar 21, 2018

Ok I think WITH (NOT VARIANT) needs to be translated to IMMUTABLE as a parameter of PostgreSQL function.

@strk
Copy link
Author

strk commented Mar 21, 2018

Pull request #24 deals with this problem, fixing it for the specific case (can probably be generalized further)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant