Both
SELECT extract(week FROM now());
and
SELECT extract(week FROM CURRENT_TIMESTAMP);
work as expected. I don't know which is the *accepted* SQL 92
idiom, but I would bet that it isn't 'now().'
Jason
"Wodzu" <wodzu@wodzus.prv.pl> writes:
> Hi all,
>
> I'm novice in PostgreSQL.
> I want to obtain current week number.
> Under PHP I try:
>
> $query = "SELECT EXTRACT(WEEK FROM NOW)";
> $result= pg_exec($dbconn,$query);
>
> where: $dbconn - successful conection id
> But this give me an error message.
> Can somebody help me?
> Sorry for my english.
>
> Thanks in advice.
>
> Wodzu
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster