[BUGS] BUG #6410: Windows say a unpleasant warning when stop a pgsql service

2012-01-26 Thread harukat
The following bug has been logged on the website:

Bug reference:  6410
Logged by:  TAKATSUKA Haruka
Email address:  haru...@sraoss.co.jp
PostgreSQL version: 9.1.2
Operating system:   Windows Server 2008 R2
Description:

(I also tested 8.3.17, 8.4.9 and 9.2-dev.)

Windows say a unpleasant warning message into the eventlog when stop a pgsql
service.

Event ID: 1530
Log Name: Application
Source: Microsoft-Windows-User Profiles Service
Description:
 Windows detected your registry file is still in use by other applications
 or services. The file will be unloaded now. The applications or services
 that hold your registry file may not function properly afterwards.

I added the following lines to the end of pgwin32_ServiceMain() for trial,

---
+   Sleep(1000);
pgwin32_SetServiceStatus(SERVICE_STOPPED);
}
---

and I confirmed that the warning message was not output.
It seems this is not an essential fix, but useful to easily erase
unpleasant messages.


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


[BUGS] One question about VACUUMDB command - please

2012-01-26 Thread Sasa . Petrovic





Dear Sirs,
I'm trying to put some scipt into scheduler on my server 2000 to make auto
vacuum one time in mouth.
Why this comand that I write belove ask me for password, even I create user
into DB with same password like user on my server that execute this
command?

Can you suggest me some other solutions?

C:\vacuumdb --host=127.0.0.1 --full --dbname=postgres

Thanks,
Best Regards,
Sasa Petrovic
Sistemi Informativi
Falc East - Knjazevac
--
Il contenuto di questo messaggio è strettamente riservato e ad uso
esclusivo del destinatario previsto dal mittente. E' proibito ogni utilizzo
non autorizzato. Se ricevete questo messaggio senza esserne il
destinatario, Vi preghiamo di notificarlo al mittente via e-mail e di
distruggere il messaggio.

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential information. Any unauthorised use is forbidden. If you
are not the intended recipient, please contact the sender by e-mail and
destroy the message.
--

[BUGS] BUG #6411: Backend process' crash when a foreign table is used in a dependent subquery on select clause

2012-01-26 Thread emre . hasegeli
The following bug has been logged on the website:

Bug reference:  6411
Logged by:  Using a Foreign Table in a Dependent Subquery
Email address:  emre.haseg...@tart.com.tr
PostgreSQL version: 9.1.2
Operating system:   Linux 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 2
Description:

I installed Dave Page's MySQL Foreign Data Wrapper on GitHub [1]. It works
fine until foreign table is used in a dependent subquery on select clause.

How to reproduce:

Create extension mysql_fdw;

Create server AMySQLServer
foreign data wrapper mysql_fdw 
options (address '***', port '3306');

Create user mapping for public 
server AMySQLServer
options (username '***', password '***');

Create foreign table AForeignTable (id integer) server AMySQLServer options
(query 'Select id from ASchema.ATable');

Select id, (select true from AForeignTable where AForeignTable.id =
ATable.id) from ATable;

WARNING:  57P02: terminating connection because of crash of another server
process
DETAIL:  The postmaster has commanded this server process to roll back the
current transaction and exit, because another server process exited
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.

[1] https://github.com/dpage/mysql_fdw



-- 
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] One question about VACUUMDB command - please

2012-01-26 Thread Euler Taveira de Oliveira
On 26-01-2012 05:31, sasa.petro...@falc.biz wrote:
 Why this comand that I write belove ask me for password, even I create user
 into DB with same password like user on my server that execute this command?
 
PostgreSQL doesn't inherit authentication properties from operational system.
Instead you could use environment variables [1], pgpass.conf file [2] or even
tune pg_hba.conf [3] to not ask the password for certain host/user/database.


[1] http://www.postgresql.org/docs/current/static/libpq-envars.html
[2] http://www.postgresql.org/docs/current/static/libpq-pgpass.html
[3] http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html


-- 
   Euler Taveira de Oliveira - Timbira   http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

-- 
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] Different error messages executing CREATE TABLE or ALTER TABLE to create a column xmin

2012-01-26 Thread Vik Reykja
On Wed, Jan 25, 2012 at 22:19, Giuseppe Sucameli brush.ty...@gmail.comwrote:

 thinking you have no skills, I wrote a patch too and posted it to
 hackers ML about 2 days ago, but I didn't subscribe that list so
 it is stalled, waiting for someone's approval.

 For this reason my email is not displayed in the archives.
 I'm so sorry both have wasted our time in writing 2 patches for
 the same bug.


I think your patch is more complete than mine so it's definitely not
wasted.  I spent several hours on mine and now I have a little bit of
skills :-)

Thank you for your effort; I'm sorry if you feel you have wasted your time.


Re: [BUGS] Different error messages executing CREATE TABLE or ALTER TABLE to create a column xmin

2012-01-26 Thread Robert Haas
On Thu, Jan 26, 2012 at 5:43 AM, Vik Reykja vikrey...@gmail.com wrote:
 On Wed, Jan 25, 2012 at 22:19, Giuseppe Sucameli brush.ty...@gmail.com
 wrote:

 thinking you have no skills, I wrote a patch too and posted it to
 hackers ML about 2 days ago, but I didn't subscribe that list so
 it is stalled, waiting for someone's approval.

 For this reason my email is not displayed in the archives.
 I'm so sorry both have wasted our time in writing 2 patches for
 the same bug.

 I think your patch is more complete than mine so it's definitely not
 wasted.  I spent several hours on mine and now I have a little bit of skills
 :-)

 Thank you for your effort; I'm sorry if you feel you have wasted your time.

I think Vik's patch is better, because it doesn't rely as much on
things that happen to be true today - like which relkinds have system
columns associated with them.  But I do agree we ought to handle both
the ADD COLUMN and RENAME COLUMN cases, and as such have posted an
update of Vik's patch on the other thread.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Compan

-- 
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] Windows x86-64 One-Click Install (9.1.2-1, 9.0.6-1) hangs on initialising the database cluster (with work-around)

2012-01-26 Thread Eric Borts

On 1/26/2012 1:17 AM, Dave Page wrote:

Dharmendra, can you look into this please?

Eric, is there anything unusual about the configuration of your
machine? Suffice it to say, this doesn't normally happen.

Hi Dave, I'm guessing the answer to that question is yes. The machine 
came preinstalled with Norton Internet Security, but this was turned off 
when I ran the install. After further investigation to the .bat file, I 
realized that I am also missing the Edit option when I right click a 
batch file.


I investigated, uninstalled stuff, disabled a lot of stuff in my 
registry, and nearly bricked my computer. After three hours, I'm going 
to have to ask for suggestions. Here's what I found/tried:


1. uninstalled Norton Internet Security (and rebooted)
2. uninstalled Acrobat Reader
3. disabled all ContextMenuHandlers by
a. renaming HKCR/*/shellex to oldshellex
b. renaming HKCR/AllFileSystemsObjects/shellex to oldshellex
c. tried, but was unable to rename HKCR/batfile/ShellEx, so renamed 
HKCR/batfile/ShellEx/ContextMenuHandlers to oldContextMenuHandlers
4. disabled all non-Microsoft shell extensions using ShellExView 
http://www.nirsoft.net/utils/shexview.html

5. rebooted - computer bricked (black screen when Windows should be loading)
6. booted in safe mode
7. tested script (from my original response) and right click.
a. no Edit option in batch file context menu
b. script hung as before
8. Undid steps 3 and 4 in safe mode
9. Rebooted - booted into windows properly
10. Still no Edit in context menu and script still hangs

I'm open to suggestions. I think it might be related to Edit menu 
missing from my batch file, as this is the only odd thing that I can 
tell about my machine. I have another similar machine (earlier model 
Vaio) that both has the Edit menu and runs the test script successfully. 
I compared the HKCR/batfile registry trees (using TortoiseSVN diff) and 
they are identical. Short of comparing the entire registry I'm at a loss.


Would it be too dangerous to use WScript.Shell.Exec or to use 
WScript.Shell.Run %COMPSEC% /c ? This has been an 11 hour struggle for 
me so far, and I know at least a few others have had this same problem. 
Here is a link to my work around on enterprisedb 
http://forums.enterprisedb.com/posts/list/2870.page#11379.


Thanks,
Eric

Reference Links:
http://www.pcreview.co.uk/forums/edit-print-open-missing-shell-context-menu-cmd-and-bat-files-t2551124.html
http://windowsxp.mvps.org/slowrightclick.htm
http://www.nirsoft.net/utils/shexview.html



Re: [BUGS] BUG #6411: Backend process' crash when a foreign table is used in a dependent subquery on select clause

2012-01-26 Thread Heikki Linnakangas

On 26.01.2012 14:46, emre.haseg...@tart.com.tr wrote:

The following bug has been logged on the website:

Bug reference:  6411
Logged by:  Using a Foreign Table in a Dependent Subquery
Email address:  emre.haseg...@tart.com.tr
PostgreSQL version: 9.1.2
Operating system:   Linux 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 2
Description:

I installed Dave Page's MySQL Foreign Data Wrapper on GitHub [1]. It works
fine until foreign table is used in a dependent subquery on select clause.


This mailing list is really for bugs in PostgreSQL itself, but I'll give 
this a shot...



How to reproduce:

Create extension mysql_fdw;

Create server AMySQLServer
 foreign data wrapper mysql_fdw
 options (address '***', port '3306');

Create user mapping for public
 server AMySQLServer
 options (username '***', password '***');

Create foreign table AForeignTable (id integer) server AMySQLServer options
(query 'Select id from ASchema.ATable');

Select id, (select true from AForeignTable where AForeignTable.id =
ATable.id) from ATable;

WARNING:  57P02: terminating connection because of crash of another server
process
DETAIL:  The postmaster has commanded this server process to roll back the
current transaction and exit, because another server process exited
abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.

[1] https://github.com/dpage/mysql_fdw


I'm guessing that there's mysql_fdw's rescan function isn't working 
correctly. Looking at the source, it seems to be calling 
mysql_row_seek(festate-result, 0);. But according to MySQL's docs 
[1], that 2nd argument should be an opaque value returned by 
mysql_row_tell() or mysql_row_seek(), not a row number. I think 
mysql_data_seek should be used there instead of mysql_row_seek().


That said, I have no idea if that's causing the crash.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
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] Windows x86-64 One-Click Install (9.1.2-1, 9.0.6-1) hangs on initialising the database cluster (with work-around)

2012-01-26 Thread Eric Borts

Also, here is a link to the same issue on StackOverflow:
http://stackoverflow.com/questions/3559719/wscript-shell-run-doesnt-work-consistently

Also solved using %COMSPEC% /c, though it doesn't say why this is a problem.

Cheers,
Eric

On 1/26/2012 11:37 AM, Eric Borts wrote:

On 1/26/2012 1:17 AM, Dave Page wrote:

Dharmendra, can you look into this please?

Eric, is there anything unusual about the configuration of your
machine? Suffice it to say, this doesn't normally happen.

Hi Dave, I'm guessing the answer to that question is yes. The 
machine came preinstalled with Norton Internet Security, but this was 
turned off when I ran the install. After further investigation to the 
.bat file, I realized that I am also missing the Edit option when I 
right click a batch file.


I investigated, uninstalled stuff, disabled a lot of stuff in my 
registry, and nearly bricked my computer. After three hours, I'm going 
to have to ask for suggestions. Here's what I found/tried:


1. uninstalled Norton Internet Security (and rebooted)
2. uninstalled Acrobat Reader
3. disabled all ContextMenuHandlers by
a. renaming HKCR/*/shellex to oldshellex
b. renaming HKCR/AllFileSystemsObjects/shellex to oldshellex
c. tried, but was unable to rename HKCR/batfile/ShellEx, so 
renamed HKCR/batfile/ShellEx/ContextMenuHandlers to oldContextMenuHandlers
4. disabled all non-Microsoft shell extensions using ShellExView 
http://www.nirsoft.net/utils/shexview.html
5. rebooted - computer bricked (black screen when Windows should be 
loading)

6. booted in safe mode
7. tested script (from my original response) and right click.
a. no Edit option in batch file context menu
b. script hung as before
8. Undid steps 3 and 4 in safe mode
9. Rebooted - booted into windows properly
10. Still no Edit in context menu and script still hangs

I'm open to suggestions. I think it might be related to Edit menu 
missing from my batch file, as this is the only odd thing that I can 
tell about my machine. I have another similar machine (earlier model 
Vaio) that both has the Edit menu and runs the test script 
successfully. I compared the HKCR/batfile registry trees (using 
TortoiseSVN diff) and they are identical. Short of comparing the 
entire registry I'm at a loss.


Would it be too dangerous to use WScript.Shell.Exec or to use 
WScript.Shell.Run %COMPSEC% /c ? This has been an 11 hour struggle 
for me so far, and I know at least a few others have had this same 
problem. Here is a link to my work around on enterprisedb 
http://forums.enterprisedb.com/posts/list/2870.page#11379.


Thanks,
Eric

Reference Links:
http://www.pcreview.co.uk/forums/edit-print-open-missing-shell-context-menu-cmd-and-bat-files-t2551124.html
http://windowsxp.mvps.org/slowrightclick.htm
http://www.nirsoft.net/utils/shexview.html





[BUGS] Doc-bug; minor typo in auto_explain documentation

2012-01-26 Thread Peter Geoghegan
I noticed the following in the auto_explain documentation:

This can have extremely negative impact on performance.

Surely it should say:

This can have an extremely negative impact on performance.

-- 
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

-- 
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] 8.4, 9.0 bug (doesn't exist in 9.1) related to window functions

2012-01-26 Thread Tom Lane
Jeff Davis pg...@j-davis.com writes:
 In REL8_4_STABLE and REL9_0_STABLE:

 = select ntile(3) OVER ( ORDER BY CASE WHEN count(i) = 0 THEN NULL ELSE
 count(i) END asc ) from ( SELECT NULL::integer as i limit 0 ) s ;
 ERROR:  cannot extract attribute from empty tuple slot

I believe this is the same case fixed here:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=c1d9579dd

and as noted in that commit message, it didn't appear worth the risk
of fixing it in released branches.

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] pgcrypto decrypt_iv() issue

2012-01-26 Thread Tom Lane
Stefan Kaltenbrunner ste...@kaltenbrunner.cc writes:
 from some looking at the code in pgcrypto.c it seems to me that the
 coding pattern in most functions there only checks for errors from the
 corresponding initialization function, in the case of say decrypt_iv()
 that means only the IV and the key are actually validated because that
 is what the init function sees(it never sees that data!), if the actual
 decrypt call fails (because the data is maybe a bit weird^broken) it
 will happily ignore that and return random data.

Yeah.  In pg_decrypt() we have

err = px_combo_init(c, (uint8 *) VARDATA(key), klen, NULL, 0);
if (!err)
err = px_combo_decrypt(c, (uint8 *) VARDATA(data), dlen,
   (uint8 *) VARDATA(res), rlen);

but in pg_decrypt_iv() it's just

err = px_combo_init(c, (uint8 *) VARDATA(key), klen,
(uint8 *) VARDATA(iv), ivlen);
if (!err)
px_combo_decrypt(c, (uint8 *) VARDATA(data), dlen,
 (uint8 *) VARDATA(res), rlen);

It looks to me like the result of px_combo_decrypt should be assigned to
err here.  If I make that change, the test case you provide is
rejected:

ERROR:  decrypt_iv error: Data not a multiple of block size

but the module's regression tests all still pass, indicating that this
sort of case isn't tested.

pg_encrypt_iv() has the identical usage error with respect to
px_combo_encrypt.

Marko, does this look right to you?

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