'Postgresql json functions missing

it seems like my postgres doesn't have the json functions.

to_json('Fred said "Hi."'::text)

generates:

ERROR:  syntax error at or near "to_json"
LINE 1: to_json('Fred said "Hi."'::text)
        ^
SQL state: 42601
Character: 1

Any idea on how to enable or get the functions to work? Thought they where supposed to be there out of the box.



Solution 1:[1]

Turns out I had misunderstood the syntas - it should include SELECT, so SELECT to_json('Fred said "Hi."'::text)works.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nils