Re: Problem with extract function ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Esteban Zimanyi <ezimanyi(at)ulb(dot)ac(dot)be>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Problem with extract function ?
Date: 2020-11-12 15:32:13
Message-ID: 135266.1605195133@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Esteban Zimanyi <ezimanyi(at)ulb(dot)ac(dot)be> writes:
> NorthwindDW=# select current_date as today , extract(week from
> current_date) as weeknbyear;
> 2020-11-12 13:25:21.217 CET [20130] ERROR: syntax error at or near
> "weeknbyear" at character 67

That works fine for me. However, I can reproduce the syntax error
if I misspell "as":

# select current_date as today , extract(week from
current_date) ss weeknbyear;
ERROR: syntax error at or near "weeknbyear"
LINE 2: current_date) ss weeknbyear;
^

This leads me to suspect that you have some weird invisible character
(non-break space, zero-width space, etc) adjacent to "as". Postgres
is not terribly forgiving of non-ASCII whitespace.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Esteban Zimanyi 2020-11-12 15:56:47 Re: Problem with extract function ?
Previous Message David G. Johnston 2020-11-12 14:53:43 Re: BUG #16712: Wrong Sub-Query Record Filtering