Re: [BUGS] BUG #5503: error in trigger function with dropped columns

2010-06-18 Thread Robert Haas
On Sun, Jun 13, 2010 at 7:20 PM, Maxim Boguk  wrote:
> I think changes in 9.0 now mask actual bug instead of fix it. If I was
> wrong, still would be useful to know how to use return record from
> trigger function in that case, because I can't make a working version
> at all.

Why do you think that?  I tried both the example you gave here and the
example from your followup email on the 15th in 9.0beta, and the
behavior seems correct there.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

-- 
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 #5510: ODBC database 8.4.2 not working on windows 7 32 bit

2010-06-18 Thread Ravi

The following bug has been logged online:

Bug reference:  5510
Logged by:  Ravi
Email address:  surabi...@gmail.com
PostgreSQL version: 8
Operating system:   Windows 7
Description:ODBC database 8.4.2 not working on windows 7 32 bit
Details: 

ODBC database 8.4.2 not working on windows 7 32 bit.

When I click "Test setting" I get the following 
error:
Could not connect to the server;
A connection attempt failed because the connected 
party did not properly respond after a period of t
time.

I have tried disabling the firewall etc.

I suspect ODBC is not compatible with windows 7.

I have been able to set it up and got it working 
on Vista, XP for 
serveral years.

-- 
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 #5511: Handling of case in Username and database names are inconsistant.

2010-06-18 Thread Brett Sutton

The following bug has been logged online:

Bug reference:  5511
Logged by:  Brett Sutton
Email address:  bsut...@noojee.com.au
PostgreSQL version: 8.4.4
Operating system:   Ubuntu 10.04
Description:Handling of case in Username and database names are
inconsistant.
Details: 

When using jdbc and a username or database is created using mixed case you
cannot then access either with mixed case.

Essentially if you peform:
create user Abc;
Postgres creates a user abc (as expected).

The problem is that you cannot the use mixed case name in a jdbc url.import
java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;


public class PostgresCaseBug
{
static public void main(String args[])
{
String adminUsername = "postgres";

// NOTE: change this password to match your local db.
String adminPassword = "adminPasswordGoesHere";  

// Assumes that you have postgres running on localhost.
String server = "localhost";

String databaseName = "testdb";
String username = "testUser";  // Note the username is mixed 
case.
String password = "password";

String adminURL = "jdbc:postgresql://" + server + 
"/postgres?user=" +
adminUsername //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "&password=" + adminPassword;//$NON-NLS-1$ 


Connection con = null;
PreparedStatement stmt = null;

try
{
Class.forName("org.postgresql.Driver");
con = DriverManager.getConnection(adminURL);
String sql = "create user " + username + " with 
password '" + password +
"'"; //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
stmt = con.prepareStatement(sql);
stmt.execute();
stmt.close();
System.out.println("User " + username + " created"); 
//$NON-NLS-1$
//$NON-NLS-2$

// Now create the database and make the new user the 
owner.
stmt = con.prepareStatement("create database " + 
databaseName + " with
owner " + username); //$NON-NLS-1$ //$NON-NLS-2$
stmt.execute();
System.out.println("Database " + databaseName + " 
created");
//$NON-NLS-1$//$NON-NLS-2$
con.close();

// First prove we can connect if we artificially force 
the username to 
// all lower case
String url = "jdbc:postgresql://" + server + "/" + 
databaseName +
"?user=" + username.toLowerCase() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "&password=" + password;//$NON-NLS-1$ 

// we can connect without a problem.
con = DriverManager.getConnection(url);
System.out.println("Connected with url=" + url); 
//$NON-NLS-1$
con.close();


// Now attempt to connect with the user we just created 
without force the
username
// to lower case.
url = "jdbc:postgresql://" + server + "/" + 
databaseName + "?user=" +
username //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "&password=" + password;//$NON-NLS-1$ 


// Throws exception: password authentication failed for 
user "testUser"
// Even though we just created the user. If we attempt 
the connection
// using an all lower case version of the account then 
the authentication
succeeds.
con = DriverManager.getConnection(url); // throws an 
exception even
though we just created the user. 

}
catch (SQLException e)
{
System.out.println(e.getMessage());
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
finally
{
try
{
if (stmt != null && stmt.isClosed() == false)
stmt.close();
if (con != null && con.isClosed() == false)
con.close();
}
catch (SQLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
   

[BUGS] odbc driver could not be loaded due to system error code 127

2010-06-18 Thread Praveen Upadhyaya (ZA)
Hi,

Good Day

I am trying to create a DSN for POSTGRESQL db. I have installed the package 
from psqlodbc_08_04_0200

I am getting the following error. Can you please help?


odbc driver could not be loaded due to system error code 127

OS : Windows 2000 SP 4

Kind regards

U Praveen Kumar
Sr Domino Architect
Dimension Data | www.dimensiondata.com
Tel: +27 11 5750922 | Fax: +27 11 5760922 | Mobile: +27 76 7773733
Email : praveen.upadhy...@za.didata.com
Best Practice makes the System Perfect



This email and all contents are subject to the following disclaimer:

"http://www.dimensiondata.com/emaildisclaimer.htm";


Re: [BUGS] BUG #5511: Handling of case in Username and database names are inconsistant.

2010-06-18 Thread Tom Lane
"Brett Sutton"  writes:
> Essentially if you peform:
> create user Abc;
> Postgres creates a user abc (as expected).

Yeah, because *in the context of SQL* the standard mandates
case-folding.  But note that the actual user name here is "abc".
Not "Abc".

> The problem is that you cannot the use mixed case name in a jdbc url.import

I'm not sure that JDBC would be doing you any favors to try to support
that.  If it were to fold case for usernames in connection URLs, then
you'd have a problem logging into users that actually *were* mixed case.
The next step would be to invent a quoting convention for usernames in
URLs, and then you just have a mess.

We went around on this many years ago in the context of what psql should
do with user and database names supplied on the command line.  The
eventual conclusion, which has worked well since then, was that such
names should be taken as-is and not folded.  Now that was partially
forced by the fact that the shell would interfere with any plausible
quoting convention, but I think it's still a good precedent for handling
user and database names in other non-SQL contexts such as URLs.

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


[BUGS] pg_upgrade issues

2010-06-18 Thread depstein
PostgreSQL 9.0 beta 2
Windows XP Professional SP2

While migrating the database from 8.4 to 9.0 using pg_upgrade (now part of the 
Postgres project), the following issues came up:

1. When using the --logfile option, pg_upgrade quits with an error like this:

The process cannot access the file because it is being used by another process.

There were problems executing ""C:\PostgreSQL\8.4\bin/pg_ctl" -l "pg_upgrade.log
" -D "D:\PostgreSQL84_matlab1b" -o "-p 5432 -c autovacuum=off -c autovacuum_free
ze_max_age=20" start >> "pg_upgrade.log" 2>&1"

2. Although pg_upgrade has a username option, this option is not used when 
pg_dump is called, which tries to use the current logon account name as the 
user name. As a result, pg_upgrade can only be used when the command shell is 
launched under the postgres account. (I know that this is mentioned on the doc 
page, but this doesn't seem right).

3. The old database had the pgadmin debugger installed. The module is part of 
8.4 and 9.0 distributions for Windows. However, pg_upgrade reported the 
following error:

ERROR:  could not load library "C:/PostgreSQL/9.0/lib/pldbgapi.dll": The 
specified module could not be found.

I had to uninstall the debugger from the old database before I could proceed.


Re: [BUGS] pg_upgrade issues

2010-06-18 Thread depstein
Another issue:

4. The --link option doesn't seem to work on Windows: pg_upgrade still copies 
data from the old cluster to the new. There doesn't appear to be a way to 
upgrade a database on Windows without copying the entire uncompressed database, 
which can be a problem where disk space is limited.

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