[BUGS] BUG #6761: unexpected behaviour of 'now'::timestamp

2012-07-25 Thread bert
The following bug has been logged on the website:

Bug reference:  6761
Logged by:  Bert Thomas
Email address:  b...@brothom.nl
PostgreSQL version: 9.1.3
Operating system:   Linux
Description:

Hi,

To reproduce what I mean, consider this function:

CREATE FUNCTION testbug() RETURNS character varying
LANGUAGE plpgsql
AS $$declare
  l_ts timestamp(0);

begin
  l_ts := 'now'::timestamp(0);
  return l_ts::varchar;
end
$$;

If a program invokes this function multiple times on a single connection,
only the first time the correct date and time is produced. All other
invocations return the exact same value as the first invocation.

Changing the function to this fixes the problem:

CREATE FUNCTION testbug() RETURNS character varying
LANGUAGE plpgsql
AS $$declare
  l_ts timestamp(0);
  l_nu varchar;

begin
  l_nu := 'now';
  l_ts := l_nu::timestamp(0);
  return l_ts::varchar;
end
$$;

Appearently the expression is re-evaluated every time in this case, whilst
in the first case it is only evaluated once as the constant 'now' could not
change obviously. I'm not sure if this is a bug or not, but at least it is
suprising behaviour. To me it looks like a bad form of optimization.

Kind regards,
Bert Thomas
BroThom


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


[BUGS] Change Request

2004-09-01 Thread Bert Blink
Hi
I am a Tutor who teaches SQL and I like to be familiar with all Relational 
DBs and their SQL variants.

I run WinXP HE under a single Account name and would like to install and 
use PostgreSQL.  I have downloaded a version of PostgreSQL from 
http://pgfoundry.org/project/showfiles.php?group_id=107&release_id=48 
and at present have installed V7.5.

My problem:-
(1) I don't want to use the "Install as a service" option as I do not want 
more than one account on my machine.

(2) So I installed PostgreSQL by unchecking the "Install as a service" 
option.  The problem now is I can't start PostgreSQL because I get the 
following error "execution of PostgreSQL by a user with administrative 
permissions is not permitted.  The server must  ".

This appears to be a Catch22 situation.
All I want is to install PostgreSQL as a WinXP Service and as a user with 
admin privileges be able to stop & start the PostgreSQL service.  This is 
how I have both Oracle & MySQL installed.  These are just WinXP services 
which are stopped by default and when I want to use them I just start the 
appropriate services and then use an appropriate GUI to run SQL.

Is there some chance you could change your install package so that :-
(1) I can install PostgreSQL as a service without having to create a new 
Account Name & Password

OR
(2) by pass install as a service but allow anyone to start the service?
Bert
PO Box 720
Belconnen ACT 2616 Australia
+61+2+ 62541341 (h)
  0427 541344 (Bert's Mobile)
  0403 050965 (Mary's Mobile) 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.746 / Virus Database: 498 - Release Date: 31/08/2004

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [BUGS] BUG #6761: unexpected behaviour of 'now'::timestamp

2012-07-25 Thread Bert Thomas

Thanks Tom and Pavel!

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


[BUGS] minor fault report

2001-01-18 Thread Bert de Jong

Hi,

when I ./pg_dump -?, the text that's shown ends:

"...if no database name is not supplied..."

bye,

Bert