pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
to_char() causes backend to close connection
4+ messages / 3 participants
[nested] [flat]

* to_char() causes backend to close connection
@ 2000-12-14 11:50  Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
  0 siblings, 1 reply; 4+ messages in thread

From: Kovacs Zoltan Sandor @ 2000-12-14 11:50 UTC (permalink / raw)
  To: pgsql-sql

Hi, this query gives different strange results:

select to_char(now()::abstime,'YYMMDDHH24MI');

I get e.g. a "backend closed the channel unexpectedly..." error with
successful or failed resetting attempt (indeterministic)

or

ERROR:  to_char/to_number(): not unique decimal poit

or

NOTICE:  PortalHeapMemoryFree: 0x0x8201af0 not in alloc set

My machine works with PostgreSQL 7.0.2 + Red Hat 6.1.
Is this fixed in 7.0.3?

TIA, Zoltan





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: to_char() causes backend to close connection
@ 2000-12-14 12:49  Karel Zak <zakkr@zf.jcu.cz>
  parent: Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
  0 siblings, 1 reply; 4+ messages in thread

From: Karel Zak @ 2000-12-14 12:49 UTC (permalink / raw)
  To: Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>; +Cc: pgsql-sql


On Thu, 14 Dec 2000, Kovacs Zoltan Sandor wrote:

> Hi, this query gives different strange results:
> 
> select to_char(now()::abstime,'YYMMDDHH24MI');

the result:

ERROR:  to_char/to_number(): not unique decimal poit

is right, because we have two to_char():

	to_char(int, text) 
	to_char(timestamp, text)

and for 'now()::abstime' function manager select "number" version
instead timestamp.

 And in "number" version is D as decimal point.

> I get e.g. a "backend closed the channel unexpectedly..." error with
> successful or failed resetting attempt (indeterministic)

 Yes this is a bug to_char() ... I fix it today.

> My machine works with PostgreSQL 7.0.2 + Red Hat 6.1.
> Is this fixed in 7.0.3?

 A problem (IMHO it's not problem) with 'now()::abstime' is in 7.1 too. 
But why you not use directly now()?

Thanks!
					Karel




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: to_char() causes backend to close connection
@ 2000-12-14 15:48  Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
  parent: Karel Zak <zakkr@zf.jcu.cz>
  0 siblings, 0 replies; 4+ messages in thread

From: Kovacs Zoltan Sandor @ 2000-12-14 15:48 UTC (permalink / raw)
  To: Karel Zak <zakkr@zf.jcu.cz>; +Cc: pgsql-sql

>  A problem (IMHO it's not problem) with 'now()::abstime' is in 7.1 too. 
> But why you not use directly now()?
My aim is to get this format for the time '5 minutes ago'. So I need
something like

select to_char(now()-'5 minutes','YYMMDDHH24MI')

but this doesn't work due to the missing type conversion.

Any idea? TIA, Zoltan




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: to_char() causes backend to close connection
@ 2000-12-14 16:02  Trewern, Ben <Ben.Trewern@mowlem.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Trewern, Ben @ 2000-12-14 16:02 UTC (permalink / raw)
  To: pgsql-sql

select to_char(now()-'5 minutes'::interval,'YYMMDDHH24MI') seems to work

Ben

> -----Original Message-----
> From: Kovacs Zoltan Sandor [mailto:tip@pc10.radnoti-szeged.sulinet.hu]
> Sent: 14 December 2000 15:49
> To: Karel Zak
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] to_char() causes backend to close connection
> 
> 
> >  A problem (IMHO it's not problem) with 'now()::abstime' is 
> in 7.1 too. 
> > But why you not use directly now()?
> My aim is to get this format for the time '5 minutes ago'. So I need
> something like
> 
> select to_char(now()-'5 minutes','YYMMDDHH24MI')
> 
> but this doesn't work due to the missing type conversion.
> 
> Any idea? TIA, Zoltan
> 

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-12-14 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-12-14 11:50 to_char() causes backend to close connection Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
2000-12-14 12:49 ` Karel Zak <zakkr@zf.jcu.cz>
2000-12-14 15:48   ` Kovacs Zoltan Sandor <tip@pc10.radnoti-szeged.sulinet.hu>
2000-12-14 16:02 RE: to_char() causes backend to close connection Trewern, Ben <Ben.Trewern@mowlem.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