edavis
edavis

Reputation: 71

MAKE_INTERVAL Syntax

I just found out that using <= throws an error: SQL Error [42703]: ERROR: column "days" does not exist

So why is this valid

MAKE_INTERVAL(DAYS => 5)

and this isn't?

MAKE_INTERVAL(DAYS <= 5)

Is it maybe a postgres bug?

Upvotes: 0

Views: 1235

Answers (1)

user330315
user330315

Reputation:

Because the operator to provide a named parameter is => and thus days in the first example refers to a function parameter with that name.

<= in the second example is seen as the "smaller than or equal operator" and thus Postgres expects that days is a column reference.

Upvotes: 1

Related Questions