Allow for CTEs in Postgres select statements

I want to use complicated SQL logic in my Postgres sql statements. I can’t do that - when I start a postgres action with something simple like this:

with data as (
select 1 as d

select * from data

It doesn’t work, it says that it only allows for select statements. This is a valid select statement, see the docs: PostgreSQL: Documentation: 9.1: WITH Queries (Common Table Expressions)