Re: [BUGS] BUG #2428: ERROR: out of memory, running INSERT SELECT

2006-05-12 Thread Simon Riggs
On Thu, 2006-05-11 at 20:14 -0400, Tom Lane wrote:
> Casey Duncan <[EMAIL PROTECTED]> writes:
> > On May 11, 2006, at 4:42 AM, Simon Riggs wrote:
> >> As your database is defined, this SQL statement will return
> >> approximately 4 trillion rows, by my calculation. As you say, it  
> >> returns no rows at all when the database is empty.
> 
> > *slaps forehead* I totally missed the "!=" in the where clause, Doh!  
> > Thanks for hitting me with a clue-stick.
> 
> I'm still wondering why you got "out of memory", though.  I'd have
> expected that to grind for a really long time, gradually filling your
> disk, until you got an out-of-disk-space kind of error; if you didn't
> notice and stop it first.  There aren't (supposed to be) any long-term
> memory leaks in query processing, other than than the known issue of
> pending trigger events, which you say you haven't got on this table.

Seems broken either way, OOM or OOD. We need a way to stop runaway
queries from happening in the first place.

-- 
  Simon Riggs
  EnterpriseDB  http://www.enterprisedb.com


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


[BUGS] BUG #2435: pg_dump/pg_restore with tar format misses indices and constraints

2006-05-12 Thread Sidney Li

The following bug has been logged online:

Bug reference:  2435
Logged by:  Sidney Li
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.3
Operating system:   Linux
Description:pg_dump/pg_restore with tar format misses indices and
constraints
Details: 

when backing up with "pg_dump -o -Ft database_name" then
later restoring with pg_restore, the indices and constraints/triggers are
not restored.

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


[BUGS] BUG #2433: Using pg_dump in a .bat : Cannot avoid asking for user Name and Password

2006-05-12 Thread Jacques Gollion

The following bug has been logged online:

Bug reference:  2433
Logged by:  Jacques Gollion
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.3
Operating system:   Windows 2000 SP4 Fr
Description:Using pg_dump in a .bat : Cannot avoid asking for user
Name and Password
Details: 

I am trying to automatically save my database every day using the scheduled
Tasks manager.
 I put pg_dump command in a .bat file containing the following line :
C:\postgres\bin\pg_dump -U im -h localhost  -Z 0 -u  -v -F c -f
F:/backup/dump/backup110506__ano pdb2000

The windows user name is im. There is a database role that is im. In the
directory C:\Documents and Settings\im\Application Data\postgresql there is
a file named pgpass.conf containing the following lines :
localhost:*:*:im:imhe
localhost:5432:*:postgres:imhe

I have checked with sysint/filemon.exe that the file pgpass.conf is read.

In fact I have just to type 'Enter' twice to start dump.

I do not understand what is wrong in my system to avoid typing anything.

Thank you in advance for your help.

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


[BUGS] BUG #2434: Using pg_dump in a .bat : Cannot avoid asking for user Name and Password

2006-05-12 Thread Jacques Gollion

The following bug has been logged online:

Bug reference:  2434
Logged by:  Jacques Gollion
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.1.3
Operating system:   Windows 2000 SP4 Fr
Description:Using pg_dump in a .bat : Cannot avoid asking for user
Name and Password
Details: 

I am trying to automatically save my database every day using the scheduled

---(end of broadcast)---
TIP 6: explain analyze is your friend


[BUGS] backup database by pg_dump

2006-05-12 Thread Thanh Thao Nguyen
Can you help me?     To back up database, I use pg_dump command as normal in command prompt     1. C:\Program Files\PostgreSQL\8.1\bin\pg_dump -h 192.168.77.117 -p 5432 -U quangvu -C BENET2 > a.sql     or      2. C:\Program Files\PostgreSQL\8.1\bin\pg_dump -h 192.168.77.117 -p 5432 -U quangvu -C -f aaa.zzz BENET2     -> It's OK     But, now i want to use in VBNET code, so I try:     Dim str As String = "C:\Program Files\PostgreSQL\8.1\bin\pg_dump"  Dim para As String = " -h 192.168.77.117 -p 5432 -U quangvu -C BENET2 > a.sql "     Process.Start(str, para)     It run but I can't see the result in my directory? What wrong?     Thanks
		Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2¢/min with Yahoo! Messenger with Voice.

[BUGS] BUG #2431: Error:SELECT query has no destination for result data

2006-05-12 Thread bhavani

The following bug has been logged online:

Bug reference:  2431
Logged by:  bhavani
Email address:  [EMAIL PROTECTED]
PostgreSQL version: postgresql 8.10
Operating system:   windowsxp
Description:Error:SELECT query has no destination for result data
Details: 

CREATE OR REPLACE FUNCTION insert_adv_exrate(IN comp_id int4, IN advid int4,
IN currid1 int4, OUT exid int4, OUT exrate float8) RETURNS record
AS $$
/*$BODY$*/
 declare currid integer;
 get_exdetails refcursor;
  begin
  select exid=max(ex_id) from adv_exrate where comp_id=comp_id and
adv_id=advid ;

  if(coalesce(exid,0)=0) then
exid:=1;
 else
exid:=exid+1;
END if;

open get_exdetails FOR

select curr_id,exchange_rate from curr_master where comp_id=comp_id;

  LOOP
   FETCH get_exdetails into currid,exrate;
  
  IF  NOT FOUND THEN
EXIT;  -- exit loop
END IF;


   insert into adv_exrate values(exid,comp_id,advid,currid,exrate);

END LOOP;

 CLOSE get_exdetails;
 

select exrate=exchange_rate from curr_master where  comp_id=comp_id and
curr_id=currid1;

end;

/*$BODY$*/
 $$ LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION insert_adv_exrate(IN comp_id int4, IN advid int4, IN currid1
int4, OUT exid int4, OUT exrate float8) OWNER TO postgres;


-


CREATE OR REPLACE FUNCTION insert_adv_exrate(IN comp_id int4, IN advid int4,
IN currid1 int4, OUT exid int4, OUT exrate float8) RETURNS record
AS $$
/*$BODY$*/
 declare currid integer;
 get_exdetails refcursor;
  begin
  select exid=max(ex_id) from adv_exrate where comp_id=comp_id and
adv_id=advid ;

  if(coalesce(exid,0)=0) then
exid:=1;
 else
exid:=exid+1;
END if;

open get_exdetails FOR

select curr_id,exchange_rate from curr_master where comp_id=comp_id;

  LOOP
   FETCH get_exdetails into currid,exrate;
  
  IF  NOT FOUND THEN
EXIT;  -- exit loop
END IF;


   insert into adv_exrate values(exid,comp_id,advid,currid,exrate);

END LOOP;

 CLOSE get_exdetails;
 

select exrate=exchange_rate from curr_master where  comp_id=comp_id and
curr_id=currid1;

end;

/*$BODY$*/
 $$ LANGUAGE 'plpgsql' VOLATILE;


  i am using the above procedure in postgre sql.
theprocedure is execting successfully.but when i am giving select
insert_adv_exrate(2,1,2); it is giving error as


ERROR:  SELECT query has no destination for result data
HINT:  If you want to discard the results, use PERFORM instead.
CONTEXT:  PL/pgSQL function "insert_adv_exrate" line 5 at SQL statement


How can i solve this problem

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


Re: [BUGS] BUG #2435: pg_dump/pg_restore with tar format misses indices and constraints

2006-05-12 Thread Tom Lane
"Sidney Li" <[EMAIL PROTECTED]> writes:
> when backing up with "pg_dump -o -Ft database_name" then
> later restoring with pg_restore, the indices and constraints/triggers are
> not restored.

Seems pretty unlikely.  More details, or better a test case, would help.
I think you've probably misdiagnosed your problem, and with no details
there's not much we can do to help.  See
http://www.postgresql.org/docs/8.1/static/bug-reporting.html

regards, tom lane

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [BUGS] possible bug in SELECT with UNION

2006-05-12 Thread Dario Basso Cardoso

Thank you

With UNION ALL the SQL work correct for my case...

Dario.

Tom Lane escreveu:


Dario Basso Cardoso <[EMAIL PROTECTED]> writes:
 


I receive two (2) rows if i union with other table i receive one (1) row!!!
   



You do know that UNION is defined to eliminate duplicate output rows?
(UNION ALL doesn't eliminate duplicates, and might be what you want.)

If that's not what you're seeing then you need to provide more info.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


 




---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [BUGS] backup database by pg_dump

2006-05-12 Thread Douglas Toltzman
Are you sure your working directory is what you think it is?  You may want to specify a full path for the output, and see if that works.  I suspect your working directory is not set correctly.On May 12, 2006, at 3:11 AM, Thanh Thao Nguyen wrote:Can you help me?     To back up database, I use pg_dump command as normal in command prompt     1. C:\Program Files\PostgreSQL\8.1\bin\pg_dump -h 192.168.77.117 -p 5432 -U quangvu -C BENET2 > a.sql     or      2. C:\Program Files\PostgreSQL\8.1\bin\pg_dump -h 192.168.77.117 -p 5432 -U quangvu -C -f aaa.zzz BENET2     -> It's OK     But, now i want to use in VBNET code, so I try:     Dim str As String = "C:\Program Files\PostgreSQL\8.1\bin\pg_dump"  Dim para As String = " -h 192.168.77.117 -p 5432 -U quangvu -C BENET2 > a.sql "     Process.Start(str, para)     It run but I can't see the result in my directory? What wrong?     Thanks 		Love cheap thrills? Enjoy PC-to-Phone  calls to 30+ countries for just 2¢/min with Yahoo! Messenger with Voice. Douglas Toltzman[EMAIL PROTECTED](910) 526-5938