CONFLICT syntax error in Postgres 9.5.0

The Postgres INSERT documentation has an example of using ON CONFLICT:

INSERT INTO distributors (did, dname) VALUES (7, 'Redline GmbH')
ON CONFLICT (did) DO NOTHING;

I try the same thing:

INSERT INTO name_map VALUES ('key_value', 'val1','val2') 
ON CONFLICT (key_column) DO NOTHING;

But get an error ERROR: syntax at or near "ON".

What am I missing?

postgres --version
> 9.5.0
+4
source share
1 answer

As several people noted in the comments, it turns out that the wrong version of postgres is running.

select version()

in psql showed this.

There must be an old installation of 9.4.5 hiding somewhere on my system.

+9
source

Source: https://habr.com/ru/post/1625087/


All Articles