pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedMigrating from 7.1 to 7.2
4+ messages / 3 participants
[nested] [flat]
* Migrating from 7.1 to 7.2
@ 2002-05-08 20:48 Edipo Elder Fernandes de Melo <edipoelder@ig.com.br>
2002-05-09 01:50 ` Re: Migrating from 7.1 to 7.2 Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 1 reply; 4+ messages in thread
From: Edipo Elder Fernandes de Melo @ 2002-05-08 20:48 UTC (permalink / raw)
To: pgsql-sql
Hello,
I wrote a plpgsql procedure that returns the executition time of it,
like this:
create procedure myProc() returns time as '
declare
v_start time;
v_end time;
begin
select timeofday()::timestamp::time into v_start;
(do some work)
select timeofday()::timestamp::time into v_end;
return v_end - v_start;
end;' language 'plpgsql'
This worked fine at 7.1, but now, in 7.2.1, isn't working. In 7.1, i
got:
template1=# select timeofday()::time;
ERROR: Bad time external representation 'Wed May 08 17:19:15.389569 2002
BRT'
template1=# select timeofday()::timestamp::time;
?column?
----------
17:19:20
(1 row)
In 7.2.1, i got:
bench=# select timeofday()::time;
ERROR: Bad time external representation 'Wed May 08 17:20:37.891559 2002
BRT'
bench=# select timeofday()::timestamp::time;
ERROR: Cannot cast type 'timestamp with time zone' to 'time without time
zone'
I tried change time zones, date style, etc... but I didn't fix it.
Thanks for any help,
Edipo Elder
[edipoelder@ig.com.br]
_________________________________________________________________________
Você podia estar baixando sua musica predileta, enquanto lia esse e-mail.
Não perca tempo, tenha acesso rápido a internet com o Super iG.
http://registro.ig.com.br/superig
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Migrating from 7.1 to 7.2
2002-05-08 20:48 Migrating from 7.1 to 7.2 Edipo Elder Fernandes de Melo <edipoelder@ig.com.br>
@ 2002-05-09 01:50 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 0 replies; 4+ messages in thread
From: Christopher Kings-Lynne @ 2002-05-09 01:50 UTC (permalink / raw)
To: Edipo Elder Fernandes de Melo <edipoelder@ig.com.br>; pgsql-sql
How about if you replace ::timestamp:: with ::timestamp(0):: ?
Timestamps in 7.2 have millisecond information included.
Chris
> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Edipo Elder
> Fernandes de Melo
> Sent: Thursday, 9 May 2002 4:49 AM
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Migrating from 7.1 to 7.2
>
>
> Hello,
>
> I wrote a plpgsql procedure that returns the executition time of it,
> like this:
>
> create procedure myProc() returns time as '
> declare
> v_start time;
> v_end time;
> begin
> select timeofday()::timestamp::time into v_start;
> (do some work)
> select timeofday()::timestamp::time into v_end;
> return v_end - v_start;
> end;' language 'plpgsql'
>
> This worked fine at 7.1, but now, in 7.2.1, isn't working. In 7.1, i
> got:
>
> template1=# select timeofday()::time;
> ERROR: Bad time external representation 'Wed May 08 17:19:15.389569 2002
> BRT'
> template1=# select timeofday()::timestamp::time;
> ?column?
> ----------
> 17:19:20
> (1 row)
>
> In 7.2.1, i got:
>
> bench=# select timeofday()::time;
> ERROR: Bad time external representation 'Wed May 08 17:20:37.891559 2002
> BRT'
> bench=# select timeofday()::timestamp::time;
> ERROR: Cannot cast type 'timestamp with time zone' to 'time without time
> zone'
>
> I tried change time zones, date style, etc... but I didn't fix it.
>
> Thanks for any help,
>
> Edipo Elder
> [edipoelder@ig.com.br]
>
> _________________________________________________________________________
> Você podia estar baixando sua musica predileta, enquanto lia esse e-mail.
> Não perca tempo, tenha acesso rápido a internet com o Super iG.
> http://registro.ig.com.br/superig
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Migrating from 7.1 to 7.2
@ 2002-05-13 07:12 Wolfgang.Fuertbauer@ebewe.com
2002-05-13 07:25 ` Re: Migrating from 7.1 to 7.2 Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang.Fuertbauer@ebewe.com @ 2002-05-13 07:12 UTC (permalink / raw)
To: Edipo Elder Fernandes de Melo <edipoelder@ig.com.br>; +Cc: pgsql-sql; pgsql-sql-owner@postgresql.org
Why do I get this message about 100 times ?
W
On 08.05.2002 17:48:34 pgsql-sql-owner wrote:
>Hello,
>
>I wrote a plpgsql procedure that returns the executition time of it,
>like this:
>
>create procedure myProc() returns time as '
>declare
>v_start time;
>v_end time;
>begin
>select timeofday()::timestamp::time into v_start;
>(do some work)
>select timeofday()::timestamp::time into v_end;
>return v_end - v_start;
>end;' language 'plpgsql'
>
>This worked fine at 7.1, but now, in 7.2.1, isn't working. In 7.1, i
>got:
>
>template1=# select timeofday()::time;
>ERROR: Bad time external representation 'Wed May 08 17:19:15.389569 2002
>BRT'
>template1=# select timeofday()::timestamp::time;
>?column?
>----------
>17:19:20
>(1 row)
>
>In 7.2.1, i got:
>
>bench=# select timeofday()::time;
>ERROR: Bad time external representation 'Wed May 08 17:20:37.891559 2002
>BRT'
>bench=# select timeofday()::timestamp::time;
>ERROR: Cannot cast type 'timestamp with time zone' to 'time without time
>zone'
>
>I tried change time zones, date style, etc... but I didn't fix it.
>
>Thanks for any help,
>
>Edipo Elder
>[edipoelder@ig.com.br]
>
>_________________________________________________________________________
>Você podia estar baixando sua musica predileta, enquanto lia esse e-mail.
>Não perca tempo, tenha acesso rápido a internet com o Super iG.
>http://registro.ig.com.br/superig
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Migrating from 7.1 to 7.2
2002-05-13 07:12 Re: Migrating from 7.1 to 7.2 Wolfgang.Fuertbauer@ebewe.com
@ 2002-05-13 07:25 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 0 replies; 4+ messages in thread
From: Christopher Kings-Lynne @ 2002-05-13 07:25 UTC (permalink / raw)
To: Wolfgang.Fuertbauer@ebewe.com; Edipo Elder Fernandes de Melo <edipoelder@ig.com.br>; +Cc: pgsql-sql; pgsql-sql-owner@postgresql.org
OK, how about this:
create or replace function myProc() returns interval as '
declare
v_start timestamp;
v_end timestamp;
begin
select current_timestamp into v_start;
-- (do some work)
select current_timestamp into v_end;
return v_end - v_start;
end;' language 'plpgsql';
This will also give you milliseconds. I'm not really sure why the old one
worked, but it was bad coding anyway - the above is a lot better, and more
SQL-standard.
Chris
> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of
> Wolfgang.Fuertbauer@ebewe.com
> Sent: Monday, 13 May 2002 3:13 PM
> To: Edipo Elder Fernandes de Melo
> Cc: pgsql-sql@postgresql.org; pgsql-sql-owner@postgresql.org
> Subject: Re: [SQL] Migrating from 7.1 to 7.2
>
>
>
> Why do I get this message about 100 times ?
>
> W
> On 08.05.2002 17:48:34 pgsql-sql-owner wrote:
> >Hello,
> >
> >I wrote a plpgsql procedure that returns the executition time of it,
> >like this:
> >
> >create procedure myProc() returns time as '
> >declare
> >v_start time;
> >v_end time;
> >begin
> >select timeofday()::timestamp::time into v_start;
> >(do some work)
> >select timeofday()::timestamp::time into v_end;
> >return v_end - v_start;
> >end;' language 'plpgsql'
> >
> >This worked fine at 7.1, but now, in 7.2.1, isn't working. In 7.1, i
> >got:
> >
> >template1=# select timeofday()::time;
> >ERROR: Bad time external representation 'Wed May 08 17:19:15.389569 2002
> >BRT'
> >template1=# select timeofday()::timestamp::time;
> >?column?
> >----------
> >17:19:20
> >(1 row)
> >
> >In 7.2.1, i got:
> >
> >bench=# select timeofday()::time;
> >ERROR: Bad time external representation 'Wed May 08 17:20:37.891559 2002
> >BRT'
> >bench=# select timeofday()::timestamp::time;
> >ERROR: Cannot cast type 'timestamp with time zone' to 'time without time
> >zone'
> >
> >I tried change time zones, date style, etc... but I didn't fix it.
> >
> >Thanks for any help,
> >
> >Edipo Elder
> >[edipoelder@ig.com.br]
> >
> >_________________________________________________________________________
> >Você podia estar baixando sua musica predileta, enquanto lia esse e-mail.
> >Não perca tempo, tenha acesso rápido a internet com o Super iG.
> >http://registro.ig.com.br/superig
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2002-05-13 07:25 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-08 20:48 Migrating from 7.1 to 7.2 Edipo Elder Fernandes de Melo <edipoelder@ig.com.br>
2002-05-09 01:50 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2002-05-13 07:12 Re: Migrating from 7.1 to 7.2 Wolfgang.Fuertbauer@ebewe.com
2002-05-13 07:25 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
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