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

pgsqlのparseに対応する #5

Open
tanzaku opened this issue Oct 9, 2024 · 0 comments
Open

pgsqlのparseに対応する #5

tanzaku opened this issue Oct 9, 2024 · 0 comments

Comments

@tanzaku
Copy link
Owner

tanzaku commented Oct 9, 2024

現状のparserでpgsqlをparseすると、関数本体($$〜$$)は一つのSCONSTになる。
関数本体は func_as なので、これ自体は正しい挙動で、pgsqlとして解釈するにはおそらくSCONSTの中身をpl_gram.y でparseする必要がある。

CREATE OR REPLACE FUNCTION cs_fmt_browser_version(v_name varchar,
                                                  v_version varchar)
RETURNS varchar AS $$
BEGIN
    IF v_version IS NULL THEN
        RETURN v_name;
    END IF;
    RETURN v_name || '/' || v_version;
END;
$$ LANGUAGE plpgsql;
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