From: Tom Lane <tgl@sss.pgh.pa.us>
To: Esteban Zimanyi <ezimanyi@ulb.ac.be>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Problem with extract function ?
Date: Thu, 12 Nov 2020 10:32:13 -0500
Message-ID: <135266.1605195133@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPqRbE6JOnxMNhuO4n=EQ31Y8kF15qKZ1vR6rmPviUsmgJZB3g@mail.gmail.com>
References: <CAPqRbE6JOnxMNhuO4n=EQ31Y8kF15qKZ1vR6rmPviUsmgJZB3g@mail.gmail.com>
Esteban Zimanyi <ezimanyi@ulb.ac.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, ezimanyi@ulb.ac.be
Subject: Re: Problem with extract function ?
In-Reply-To: <135266.1605195133@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox