1

I want to install the pgcrypto extension on my postgresql installation on Windows. I found that I just have to call CREATE EXTENSION pgcrypto; but I've got an error :

Syntax error on « CREATE »
LINE 1: SELECT COUNT(*) AS total FROM (CREATE EXTENSION pgcrypto) AS...

(I'm on PostgreSQL 9.2.4 and I executed the sql line from phpPgAdmin with postgres user)

Maxime L
  • 31
  • 3

2 Answers2

2

As dezso said in the comment, the problem was that CREATE can't be part of a subquery. And phpPgAdmin transform the query before executing it so it had put the CREATE as a subquery.

So the solution was to execute the CREATE query in PgAdmin for example.

Maxime L
  • 31
  • 3
0

Utility statements cannot be mixed with DML in PostgreSQL. They are fundamentally different and get executed entirely differently (for example no planning goes into them).

You should just run

CREATE EXTENSION pgcryto;
Chris Travers
  • 13,112
  • 51
  • 95