0

Below Query are running in the local server postgress 9.6.6 but in the server postgres 9.2.4 ,below query is not working

select case_type,
(obj->> 'S')::int AS single,
(obj->> 'D')::int AS division,
(obj->> 'F')::int AS full
FROM (SELECT case_type, json_object_agg(bench,disposals) AS obj
      FROM jws_ctype
      GROUP BY case_type
     )X

Error Below

ERROR:  function json_object_agg(text, bigint) does not exist
LINE 5: FROM (SELECT case_type, json_object_agg(bench,disposals) AS ...
                                ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

********** Error **********

ERROR: function json_object_agg(text, bigint) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 133
1
  • 2
    What's your question? That function was introduced in 9.4, why do you expect it to be available in older versions? Plus: you shouldn't be using 9.2 any more. It's no longer maintained. Commented Feb 5, 2018 at 7:16

1 Answer 1

2

json_object_agg was introduced in Postgres 9.4, that is why this query will not work in Postgres 9.2

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.