Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdEaC-0006RW-OK for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2020 15:32:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdEaB-0008Py-7e for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2020 15:32:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdEaB-0008OR-1Q for pgsql-bugs@lists.postgresql.org; Thu, 12 Nov 2020 15:32:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdEa8-00023k-RP for pgsql-bugs@postgresql.org; Thu, 12 Nov 2020 15:32:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0ACFWDCC135267; Thu, 12 Nov 2020 10:32:14 -0500 From: Tom Lane To: Esteban Zimanyi cc: pgsql-bugs@postgresql.org Subject: Re: Problem with extract function ? In-reply-to: References: Comments: In-reply-to Esteban Zimanyi message dated "Thu, 12 Nov 2020 13:26:54 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <135265.1605195133.1@sss.pgh.pa.us> Date: Thu, 12 Nov 2020 10:32:13 -0500 Message-ID: <135266.1605195133@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Esteban Zimanyi 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