Re: [BUGS] BUG #4972: RFE: convert timestamps to fractional seconds

2009-08-09 Thread Tom Lane
"Richard Neill"  writes:
> * Convert a timestamp into a number of seconds since
> the epoch. This can be done in an ugly way using EXTRACT epoch FROM
> timestamp, but only to  integer precision.

Uh, nonsense.

regression=# select extract(epoch from now());
date_part 
--
 1249884955.29859
(1 row)

It might've been like that back around 7.1, but not in any currently
supported version.

> * Division of a timestamp by an interval should result in something
> dimensionless.

This isn't a particularly sane thing to think about, because intervals
aren't single numbers.

regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #4961: pg_standby.exe crashes with no args

2009-08-09 Thread Bruce Momjian
wader2 wrote:
> thx,
> 
> > Does pg_standby (e.g., pg_standby.exe --version) succeed when you
> 
> --version and --help are no problem.

I can't reproduce a crash here on BSD:

$ pg_standby
pg_standby: not enough command-line arguments

Can you show us the command and the crash text?

-- 
  Bruce Momjian  http://momjian.us
  EnterpriseDB http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


[BUGS] BUG #4972: RFE: convert timestamps to fractional seconds

2009-08-09 Thread Richard Neill

The following bug has been logged online:

Bug reference:  4972
Logged by:  Richard Neill
Email address:  rn...@cam.ac.uk
PostgreSQL version: 8.3.7
Operating system:   Linux
Description:RFE: convert timestamps to fractional seconds
Details: 

Postgresql has a huge range of functions to convert things TO timestamp
format, but no way to convert back again.

For example:

* Convert a timestamp into a number of seconds since
the epoch. This can be done in an ugly way using EXTRACT epoch FROM
timestamp, but only to  integer
precision. If I want to keep the microseconds, and get a float, it's not
possible. [Also, this is such a common requirement that it should probably
have a dedicated function, such as "time()" or maybe "epoch()". In PHP, this
is done by strtotime().]

* Division of a timestamp by an interval should result in something
dimensionless.

* So, for example, to check whether two timestamps (ts1 and ts2) are less
than 2.5 seconds apart, (returning boolean), I'd like to be able to do at
least one of:

  abs(time(ts1 - ts2)) < 2.5
  #A "time" function converts timestamp to 
  #sec.us since epoch)

  abs(cast (ts1 - ts2) as double)  < 2.5
  #cast to double, might have to implicitly divide
  #by the unit of "1 second"

  (ts1 - ts2) / INTERVAL '1 second'  < 2.5
  #Divide 2 dimensioned quantities to get 
  #a dimensionless one.


Currently, it's necessary to do something really really long-winded, eg:

(ts1 - ts2 >= 0 AND ts1 - ts2 < interval '2.5 seconds') OR (ts2 - ts1 >= 0
AND ts2 - ts1 < interval '2.5 seconds')


BTW,The abs() function doesn't work on an INTERVAL, though there is no
reason why it shouldn't.

Thanks - Richard

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #4931: An error occured executing the Microsoft VC++ runtime installer

2009-08-09 Thread Bruce Momjian
Michael Jeuk wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:  4931
> Logged by:  Michael Jeuk
> Email address:  je_m...@web.de
> PostgreSQL version: 8.4.0-1
> Operating system:   Windows XP - SP3
> Description:An error occured executing the Microsoft VC++ runtime
> installer
> Details: 
> 
> Error-Window:
> 
> An error occured executing the Microsoft VC++ runtime installer
> 
> Install file: 
> postgresql-8.4.0-1-windows.exe
> (39.704.300 Bytes)
> 
> Windows XP - SP3 (German)
> (WSH aktivatet !)
> 
> Check on the TODO list and in the FAQ is negatve !
> ( Search: " An error occured executing the Microsoft VC++ runtime installer"
> and " Windows XP " )

I think this is an installer problem so you should contact EnterpriseDB,
the installer builder, to report the problem.

-- 
  Bruce Momjian  http://momjian.us
  EnterpriseDB http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


[BUGS] BUG #4971: Backend crash while doing nothing...

2009-08-09 Thread Daniel Migowski

The following bug has been logged online:

Bug reference:  4971
Logged by:  Daniel Migowski
Email address:  dmigow...@ikoffice.de
PostgreSQL version: 8.3.5
Operating system:   Windows XP
Description:Backend crash while doing nothing...
Details: 

Hello, poor dear debuggers,

I just found my Postgres server silent when I tried to connect again to my
lovely server, and noticed it had been shut down with the following message
in the log:

2009-08-09 19:57:01 CEST [2208] LOG:  server process (PID 8384) was
terminated by exception 0xC13A
2009-08-09 19:57:01 CEST [2208] HINT:  See C include file "ntstatus.h" for a
description of the hexadecimal value.
2009-08-09 19:57:01 CEST [2208] LOG:  terminating any other active server
processes
2009-08-09 19:57:01 CEST [2208] LOG:  all server processes terminated;
reinitializing
2009-08-09 19:57:02 CEST [2208] FATAL:  pre-existing shared memory block is
still in use
2009-08-09 19:57:02 CEST [2208] HINT:  Check if there are any old server
processes still running, and terminate them.

I had some Localization issues some time ago, so even if its not important
currently, all my locales are tuned to DE.

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #4970: Broken link in manual

2009-08-09 Thread Robert Haas
On Fri, Aug 7, 2009 at 12:31 AM, Rob Wultsh wrote:
>
> The following bug has been logged online:
>
> Bug reference:      4970
> Logged by:          Rob Wultsh
> Email address:      wult...@gmail.com
> PostgreSQL version: 8.4
> Operating system:   N/A
> Description:        Broken link in manual
> Details:
>
> http://www.postgresql.org/docs/8.4/static/geqo-biblio.html links to "The
> Hitch-Hiker's Guide to Evolutionary Computation"
> (http://www.cs.bham.ac.uk/Mirrors/ftp.de.uu.net/EC/clife/www/location.htm)
> which as of 8/4/2009 responds with at 404 page.

A quick Google search finds what appears to be that document here:

http://www.aip.de/~ast/EvolCompFAQ/

Trivial patch attached, for the the benefit of any friendly committers
in the area.  Should probably be backpatched also.

...Robert
*** a/doc/src/sgml/geqo.sgml
--- b/doc/src/sgml/geqo.sgml
***
*** 328,334 
 
  
   
!   http://www.cs.bham.ac.uk/Mirrors/ftp.de.uu.net/EC/clife/www/location.htm";>
The Hitch-Hiker's Guide to Evolutionary Computation, (FAQ for news://comp.ai.genetic";>)
   
--- 328,334 
 
  
   
!   http://www.aip.de/~ast/EvolCompFAQ/";>
The Hitch-Hiker's Guide to Evolutionary Computation, (FAQ for news://comp.ai.genetic";>)
   

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


Re: [BUGS] BUG #4969: ajuda

2009-08-09 Thread Robert Haas
On Thu, Aug 6, 2009 at 3:09 PM, Dielton Paulo wrote:
>
> The following bug has been logged online:
>
> Bug reference:      4969
> Logged by:          Dielton Paulo
> Email address:      dpa...@sefaz.ba.gov.br
> PostgreSQL version: 8.4
> Operating system:   Windows XP
> Description:        ajuda
> Details:
>
> Good afternoon,
>
>  Working in the Secretary of Finance of the State of Bahia, and We are using
> postgres 8.4 we are trying to access the postgres Access by 2000, but an
> error of type "error out in memory Query. "
> If you can help us appreciate that.
>
> Sincerely,
>
> Dielton Paulo

Please provide a lot more information.  Is this happening to all
queries, or just one particular query?  Is that really the exact error
message?  What operating system are you running on?  If it's just one
particular query, can you send the output of EXPLAIN for that query?

...Robert

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs