pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedproblems with timestamp data type
2+ messages / 2 participants
[nested] [flat]
* problems with timestamp data type
@ 2002-07-17 15:49 Juan Pablo <jp_grassi@yahoo.com>
2002-07-18 17:09 ` Re: problems with timestamp data type Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 1 reply; 2+ messages in thread
From: Juan Pablo @ 2002-07-17 15:49 UTC (permalink / raw)
To: pgsql-admin
Hi.
I have been using PostgreSQL v 7.1.3 without
problems for a year.
I installed the latest version (7.2.1) a week ago and
I have had some problems with a particular query:
///***** QUERY *****///
SELECT date_part('year', fechaacta) AS "Año de
donación", sexo AS "Sexo", count(*) AS "Cantidad de
donantes"
FROM "Capital"
WHERE
date_part('year', age(timestamp(fechanacimiento)))
BETWEEN 1 AND 100
AND "fecha" BETWEEN '2001/01/01' AND '2002/12/31'
GROUP BY date_part('year', fechaacta), sexo
///***** end QUERY ***////
I obtain the following answer from server:
"Warning: PostgreSQL query failed: ERROR: parser:
parse error at or near "fechanacimiento" in
/var/www/html/ActasPcias/consultas.php on line 471"
Note: "fechanacimiento" is a field of the table
"Capital".
Exactly the same query has been working fine for a
year with PostgreSQL v 7.1.3 in exactly the same
database. more over, the database was created in my
new red hat 7.3 server by using "pg_dumpall" from my
old server (red hat 7.2).
Can anybody tell me what's going on ?
Thanks
Juan Pablo
__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: problems with timestamp data type
2002-07-17 15:49 problems with timestamp data type Juan Pablo <jp_grassi@yahoo.com>
@ 2002-07-18 17:09 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
0 siblings, 0 replies; 2+ messages in thread
From: Stephan Szabo @ 2002-07-18 17:09 UTC (permalink / raw)
To: Juan Pablo <jp_grassi@yahoo.com>; +Cc: pgsql-admin
On Wed, 17 Jul 2002, Juan Pablo wrote:
> SELECT date_part('year', fechaacta) AS "Año de
> donación", sexo AS "Sexo", count(*) AS "Cantidad de
> donantes"
> FROM "Capital"
> WHERE
> date_part('year', age(timestamp(fechanacimiento)))
> BETWEEN 1 AND 100
> AND "fecha" BETWEEN '2001/01/01' AND '2002/12/31'
> GROUP BY date_part('year', fechaacta), sexo
...
> Exactly the same query has been working fine for a
> year with PostgreSQL v 7.1.3 in exactly the same
> database. more over, the database was created in my
> new red hat 7.3 server by using "pg_dumpall" from my
> old server (red hat 7.2).
>
>
> Can anybody tell me what's going on ?
Well, to fix it, you'll probably need to double quote
timestamp. Timestamp(...) used to be a call to the
type conversion function but is now the specification
of a timestamp type with a given precision (which I
think matches spec). You might want to consider seeing
if you can do the type conversion using the standard
SQL cast in any case.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-07-18 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-17 15:49 problems with timestamp data type Juan Pablo <jp_grassi@yahoo.com>
2002-07-18 17:09 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
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