Problem with extract function ?

Поиск
Список
Период
Сортировка
От Esteban Zimanyi
Тема Problem with extract function ?
Дата
Msg-id CAPqRbE6JOnxMNhuO4n=EQ31Y8kF15qKZ1vR6rmPviUsmgJZB3g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Problem with extract function ?  (Erik Rijkers <er@xs4all.nl>)
Re: Problem with extract function ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Is there a problem with the extract function as shown below? In the SELECT clause it should be possible to rename any column by adding after the column "as xxx" or simply "xxx".

------------------------------------------------------
NorthwindDW=# select current_date today , extract(week from current_date) weeknbyear;
   today    |  weeknbyear
------------+-------------
 2020-11-12 |          46
(1 row)

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
2020-11-12 13:25:21.217 CET [20130] STATEMENT:  select current_date as today , extract(week from current_date) as weeknbyear;
ERROR:  syntax error at or near "weeknbyear"
LINE 1: ...ate as today , extract(week from current_date) as weeknbyear...
                                                             ^
NorthwindDW=# select current_date as today , extract(week from current_date) as xxx;
2020-11-12 13:25:37.817 CET [20130] ERROR:  syntax error at or near "xxx" at character 67
2020-11-12 13:25:37.817 CET [20130] STATEMENT:  select current_date as today , extract(week from current_date) as xxx;
ERROR:  syntax error at or near "xxx"
LINE 1: ...rent_date as today , extract(week from current_date) as xxx;
                                                                   ^
NorthwindDW=# select version();
                                             version
-------------------------------------------------------------------------------------------------
 PostgreSQL 13rc1 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0, 64-bit
(1 row)
------------------------------------------------------

Regards

Esteban

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Problem with gdal
Следующее
От: Erik Rijkers
Дата:
Сообщение: Re: Problem with extract function ?