Skip to content

Instantly share code, notes, and snippets.

@garethflowers
Last active May 3, 2021 22:03
Show Gist options
  • Select an option

  • Save garethflowers/5396878 to your computer and use it in GitHub Desktop.

Select an option

Save garethflowers/5396878 to your computer and use it in GitHub Desktop.
Polyfill. Returns the length of the requested array dimension.
CREATE OR REPLACE FUNCTION array_length(
ANYARRAY,
INT
)
RETURNS SETOF INT
LANGUAGE sql
IMMUTABLE
STRICT
AS $$
SELECT ARRAY_UPPER( $1, $2 );
$$;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment