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

set props only if defined #4

Open
pyramation opened this issue Mar 31, 2024 · 0 comments
Open

set props only if defined #4

pyramation opened this issue Mar 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pyramation
Copy link
Contributor

CREATE FUNCTION ast.a_const (
      v_val jsonb DEFAULT NULL
  ) RETURNS jsonb AS $EOFCODE$
  DECLARE
      result jsonb = '{"A_Const":{}}'::jsonb;
  BEGIN
      result = ast.jsonb_set(result, '{A_Const, val}', v_val);
      RETURN result;
  END;
  $EOFCODE$ LANGUAGE plpgsql IMMUTABLE;
@pyramation pyramation added the bug Something isn't working label Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant