[GENERAL] Connecting matlab with postgresql

2017-06-29 Thread Ilya Roublev
Hi,

You could use PgMex (http://pgmex.alliedtesting.com/) - high-performance 
PostgreSQL client library for Matlab that enables a Matlab-based application to 
communicate with PostgreSQL database in the Matlab native way by passing data 
in a form of matrices, multi-dimensional arrays and structures. The library is 
written in pure C which gives a significant performance boost for both small 
and data-heavy database requests. Both Windows and Linux platforms are 
supported.

And PgMex does that much faster and for essentially greater volumes of data 
than Matlab Database Toolbox. For comparison of their performance see here: 
https://alliedtesting.github.io/pgmex-blog/2017/06/06/performance-comparison-of-postgresql-connectors-in-matlab-part-I/

Ilya


Re: [GENERAL] Connecting to SQL Server from Windows using FDW

2016-01-23 Thread ivo silvestre
Hi John,

Thanks, but I already saw that link. The problem is to installing the
tds_fwd extension on postgres. And I don't know how to (never tried)
compile it...

What comes with postgres by default is the postgres fdw
, that
allow to link 2 different postgres servers, but in this case that doesn't
help me.


On 23 January 2016 at 04:40, John J. Turner  wrote:

> On Jan 22, 2016, at 1:05 PM, ivo silvestre  wrote:
>
> > I need to create a linked server between 2 Windows servers. In one I've
> PostgreSQL with admin privileges and in the other MS SQL with only read
> access.
> >
> > I need to create a view (or a foreign table?) in PostgreSQL from a table
> in MS SQL in another server ...
> > ... I found GeoffMontee's Github, but I don't know how to install it on
> Windows...
>
> Perhaps this link may help:
>
> https://www.mssqltips.com/sqlservertip/3663/sql-server-and-postgresql-foreign-data-wrapper-configuration--part-3/
>
> The only caveat I see offhand is the use of the 'sa' account, but I can't
> vouch for that being a required mapping.
>
> Cheers,
> John
>
>


-- 
Ivo Silvestre
__
*técnico sig | gis technician*


__


Re: [GENERAL] Connecting to SQL Server from Windows using FDW

2016-01-23 Thread John J. Turner
> On 23 January 2016 at 04:40, John J. Turner  wrote:
> On Jan 22, 2016, at 1:05 PM, ivo silvestre  wrote:
> 
> > I need to create a linked server between 2 Windows servers. In one I've 
> > PostgreSQL with admin privileges and in the other MS SQL with only read 
> > access.
> >
> > I need to create a view (or a foreign table?) in PostgreSQL from a table in 
> > MS SQL in another server ...
> > ... I found GeoffMontee's Github, but I don't know how to install it on 
> > Windows...
> 
> Perhaps this link may help:
> https://www.mssqltips.com/sqlservertip/3663/sql-server-and-postgresql-foreign-data-wrapper-configuration--part-3/
> 
> The only caveat I see offhand is the use of the 'sa' account, but I can't 
> vouch for that being a required mapping.


On Jan 23, 2016, at 4:08 AM, ivo silvestre  wrote:
> Hi John,
> 
> Thanks, but I already saw that link. The problem is to installing the tds_fwd 
> extension on postgres. And I don't know how to (never tried) compile it...
> 
> What comes with postgres by default is the postgres fdw, that allow to link 2 
> different postgres servers, but in this case that doesn't help me.


Sorry Ivo, my bad - I managed to gloss over the salient point for your issue in 
this link - you're on Windows, his Postgres was on Linux!

Compiling an extension on Windows, last time I tried many moons ago was 
unfortunately not successful, which involved compiling the whole pg source tree 
via MinGW.

Hazarding a thought - although it's discontinued, it might be worth checking 
out Windows Subsystem for UNIX-based Applications (SUA):
https://en.wikipedia.org/wiki/Windows_Services_for_UNIX

But I suspect anything you managed to compile with that would still be 
incompatible with your pg instance...

Beyond that, perhaps the gurus here have some sage advice...

- John

Re: [GENERAL] Connecting to SQL Server from Windows using FDW

2016-01-22 Thread Adrian Klaver

On 01/22/2016 10:05 AM, ivo silvestre wrote:

Hi,

I need to create a linked server between 2 Windows servers. In one I've
PostgreSQL with admin privileges and in the other MS SQL with only read
access.

I need to create a view (or a foreign table?) in PostgreSQL from a table
in MS SQL in another server. The table in the MS SQL is constantly
growing and I need on-the-fly access to the data.

After some web search I found GeoffMontee's Github, but I don't know how
to install it on Windows...

Is there anyone how already did something like this and could help me out..?


Seems like it is an open issue:

https://github.com/GeoffMontee/tds_fdw/issues/53



Thanks in advance!

Kind regards,

--
Ivo Silvestre
__
*técnico sig | gis technician*


__



--
Adrian Klaver
adrian.kla...@aklaver.com


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


[GENERAL] Connecting to SQL Server from Windows using FDW

2016-01-22 Thread ivo silvestre
Hi,

I need to create a linked server between 2 Windows servers. In one I've
PostgreSQL with admin privileges and in the other MS SQL with only read
access.

I need to create a view (or a foreign table?) in PostgreSQL from a table in
MS SQL in another server. The table in the MS SQL is constantly growing and
I need on-the-fly access to the data.

After some web search I found GeoffMontee's Github, but I don't know how to
install it on Windows...

Is there anyone how already did something like this and could help me out..?

Thanks in advance!

Kind regards,

-- 
Ivo Silvestre
__
*técnico sig | gis technician*


__


Re: [GENERAL] Connecting to SQL Server from Windows using FDW

2016-01-22 Thread John J. Turner
On Jan 22, 2016, at 1:05 PM, ivo silvestre  wrote:

> I need to create a linked server between 2 Windows servers. In one I've 
> PostgreSQL with admin privileges and in the other MS SQL with only read 
> access.
> 
> I need to create a view (or a foreign table?) in PostgreSQL from a table in 
> MS SQL in another server ...
> ... I found GeoffMontee's Github, but I don't know how to install it on 
> Windows...

Perhaps this link may help:
https://www.mssqltips.com/sqlservertip/3663/sql-server-and-postgresql-foreign-data-wrapper-configuration--part-3/

The only caveat I see offhand is the use of the 'sa' account, but I can't vouch 
for that being a required mapping.

Cheers,
John



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


Re: [GENERAL] Connecting to 2 different DB on same machine

2015-04-22 Thread Adrian Klaver

On 04/22/2015 10:49 AM, puneet252002 wrote:

Hi Team, I am running in a confusion on how to connect two different
database at different path. 1. Default PostgreSQL DB 2. ManageEngine
Servicedesk Plus DB I have installed PostgreSQL for windows successfully
and connected to default database of PostgreSQL. Now I to connect
ManageEngine Servicedesk Plus Database located at path
C:\ManageEngine\ServiceDesk. database name is ServiceDesk. How to
connect above 2 different DB on PGADMIN III? Regards Puneet


Did you follow the instructions from below to set up the database?:

https://www.manageengine.com/products/service-desk/help/adminguide/introduction/setting_up_database.html




--
Adrian Klaver
adrian.kla...@aklaver.com


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


Re: [GENERAL] Connecting to 2 different DB on same machine

2015-04-22 Thread John R Pierce

On 4/22/2015 10:49 AM, puneet252002 wrote:
Hi Team, I am running in a confusion on how to connect two different 
database at different path. 1. Default PostgreSQL DB 2. ManageEngine 
Servicedesk Plus DB I have installed PostgreSQL for windows 
successfully and connected to default database of PostgreSQL. Now I to 
connect ManageEngine Servicedesk Plus Database located at path 
C:\ManageEngine\ServiceDesk. database name is ServiceDesk. How to 
connect above 2 different DB on PGADMIN III? Regards Puneet 


if thats two different database *servers* running on the same system, 
they would need to use two different port numbers.the default port 
is 5432, so this alternate database server would have to be running on 
some other port, like 5433.


if thats just two different databases on the same server instance, you'd 
specify the database name when you connect to the default port.




--
john r pierce, recycling bits in santa cruz



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


[GENERAL] Connecting to 2 different DB on same machine

2015-04-22 Thread puneet252002
Hi Team,I am running in a confusion on how to connect two different database
at different path. 1. Default PostgreSQL DB2. ManageEngine Servicedesk Plus
DBI have installed PostgreSQL for windows successfully and connected to
default database of PostgreSQL. Now I to connect ManageEngine Servicedesk
Plus Database located at path C:\ManageEngine\ServiceDesk. database name
is ServiceDesk.How to connect above 2 different DB on PGADMIN III?
RegardsPuneet



--
View this message in context: 
http://postgresql.nabble.com/Connecting-to-2-different-DB-on-same-machine-tp5846406.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-08 Thread Jorge Arevalo
On Thu, Aug 7, 2014 at 3:43 PM, Adrian Klaver adrian.kla...@aklaver.com
wrote:

 On 08/07/2014 01:39 AM, Jorge Arevalo wrote:


 What OS are you on?

 Per:
 http://www.postgresql.org/__docs/9.1/interactive/auth-__
 methods.html#AUTH-PEER

 http://www.postgresql.org/docs/9.1/interactive/auth-
 methods.html#AUTH-PEER

 Peer authentication is only available on operating systems
 providing the getpeereid() function, the SO_PEERCRED socket
 parameter, or similar mechanisms. Currently that includes Linux,
 most flavors of BSD including Mac OS X, and Solaris.



 Linux system  (Ubuntu 12.04). Also tested in Mac OS 10.8.

 Forgot to mention: in pg_hba.conf there is a previous line:

 local postgres peer


 That would be the issue, assuming you are doing something along lines of
 psql -d some_db -U postgres per:

 http://www.postgresql.org/docs/9.1/interactive/auth-pg-hba-conf.html

  The first record with a matching connection type, client address,
 requested database, and user name is used to perform authentication. There
 is no fall-through or backup: if one record is chosen and the
 authentication fails, subsequent records are not considered.


 If you are not connecting as above, you will need to show us your
 connection string.



Actually, it's connecting now. I've applied the map to the first entry in
pg_hba.conf

local all postgres peer map=vp.

So, I'm identifying vagrant with postgres, as desired, and it works.

Many thanks for your responses!

Best regards,

-- 
Jorge Arevalo

http://about.me/jorgeas80







 No map specified for that line.



 --
 Jorge Arevalo




 --
 Adrian Klaver
 adrian.kla...@aklaver.com



Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-07 Thread Jorge Arevalo
On Thu, Aug 7, 2014 at 1:14 AM, Adrian Klaver adrian.kla...@aklaver.com
wrote:

 On 08/06/2014 03:43 PM, Jorge Arevalo wrote:

 Hello,

 I want to connect to my local installation of PostgreSQL 9.1 using my
 machine user (who is vagrant). So, after reading PostgreSQL
 documentation, I thought I just needed to:

 1. Add username map in pg_ident.conf:

 # MAPNAME   SYSTEM-USERNAME PG-USERNAME

 vp   vagrantpostgres


 2. Using the map in pg_hba.conf

 # TYPE  DATABASEUSERADDRESS METHOD

 local   all  all
peer map=vp

 But I'm getting the error

 sql: FATAL:  Peer authentication failed for user vagrant

 If I try to connect to my server using psql.

 I guess I'm misunderstanding the PostgreSQL manual. But, how could I get
 what I need? (locally connect with the user vagrant like if it was the
 postgres user)


 What OS are you on?

 Per:
 http://www.postgresql.org/docs/9.1/interactive/auth-methods.html#AUTH-PEER

 Peer authentication is only available on operating systems providing the
 getpeereid() function, the SO_PEERCRED socket parameter, or similar
 mechanisms. Currently that includes Linux, most flavors of BSD including
 Mac OS X, and Solaris.



Linux system  (Ubuntu 12.04). Also tested in Mac OS 10.8.

Forgot to mention: in pg_hba.conf there is a previous line:

local postgres peer

No map specified for that line.





 --
 Jorge Arevalo

 http://about.me/jorgeas80



 --
 Adrian Klaver
 adrian.kla...@aklaver.com




-- 
Jorge Arevalo
Freelance developer

http://about.me/jorgeas80


Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-07 Thread Jorge Arevalo
On Thu, Aug 7, 2014 at 1:08 AM, John R Pierce pie...@hogranch.com wrote:

 On 8/6/2014 3:43 PM, Jorge Arevalo wrote:


 I want to connect to my local installation of PostgreSQL 9.1 using my
 machine user (who is vagrant). So, after reading PostgreSQL documentation,
 I thought I just needed to:



 wouldn't it be easier to ...

 create user vagrant superuser;
 create database vagrant owner vagrant;

 ?



 --
 john r pierce  37N 122W
 somewhere on the middle of the left coast



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



That's an option, yes. I just wanted to avoid the creation of a new
superuser, if I can identify my vagrant machine user with db postgres user



-- 
Jorge Arevalo
Freelance developer

http://about.me/jorgeas80


Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-07 Thread Ray Stell

On Aug 6, 2014, at 6:56 PM, Frank Pinto fr...@ayalo.co wrote:
 
 and make sure you restarted the server so your changes take effect.
 

reload will get it, also, and is sometimes easier to come by. 

The pg_hba.conf file is read on start-up and when the main server process 
receives a SIGHUP signal. If you edit the file on an active system, you will 
need to signal the postmaster (using pg_ctl reload or kill -HUP) to make it 
re-read the file.
http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-07 Thread Adrian Klaver

On 08/07/2014 01:39 AM, Jorge Arevalo wrote:



What OS are you on?

Per:

http://www.postgresql.org/__docs/9.1/interactive/auth-__methods.html#AUTH-PEER
http://www.postgresql.org/docs/9.1/interactive/auth-methods.html#AUTH-PEER

Peer authentication is only available on operating systems
providing the getpeereid() function, the SO_PEERCRED socket
parameter, or similar mechanisms. Currently that includes Linux,
most flavors of BSD including Mac OS X, and Solaris.



Linux system  (Ubuntu 12.04). Also tested in Mac OS 10.8.

Forgot to mention: in pg_hba.conf there is a previous line:

local postgres peer


That would be the issue, assuming you are doing something along lines of 
psql -d some_db -U postgres per:


http://www.postgresql.org/docs/9.1/interactive/auth-pg-hba-conf.html

 The first record with a matching connection type, client address, 
requested database, and user name is used to perform authentication. 
There is no fall-through or backup: if one record is chosen and the 
authentication fails, subsequent records are not considered.



If you are not connecting as above, you will need to show us your 
connection string.




No map specified for that line.



--
Jorge Arevalo





--
Adrian Klaver
adrian.kla...@aklaver.com


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


[GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-06 Thread Jorge Arevalo
Hello,

I want to connect to my local installation of PostgreSQL 9.1 using my
machine user (who is vagrant). So, after reading PostgreSQL documentation,
I thought I just needed to:

1. Add username map in pg_ident.conf:

# MAPNAME   SYSTEM-USERNAME PG-USERNAME

vp   vagrantpostgres


2. Using the map in pg_hba.conf

# TYPE  DATABASEUSERADDRESS METHOD

local   all  all
peer map=vp

But I'm getting the error

sql: FATAL:  Peer authentication failed for user vagrant

If I try to connect to my server using psql.

I guess I'm misunderstanding the PostgreSQL manual. But, how could I get
what I need? (locally connect with the user vagrant like if it was the
postgres user)

Many thanks in advance (and sorry for the cross-posting. I asked this in
serverfault too, but I think this is the right place)

-- 
Jorge Arevalo

http://about.me/jorgeas80


Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-06 Thread Frank Pinto
Looks like you're doing it right, you actually have to specify the user
though:

psql -U postgres

and make sure you restarted the server so your changes take effect.

Frank


On Wed, Aug 6, 2014 at 4:43 PM, Jorge Arevalo jorgearev...@libregis.org
wrote:

 Hello,

 I want to connect to my local installation of PostgreSQL 9.1 using my
 machine user (who is vagrant). So, after reading PostgreSQL documentation,
 I thought I just needed to:

 1. Add username map in pg_ident.conf:

 # MAPNAME   SYSTEM-USERNAME PG-USERNAME

 vp   vagrantpostgres


 2. Using the map in pg_hba.conf

 # TYPE  DATABASEUSERADDRESS METHOD

 local   all  all
 peer map=vp

 But I'm getting the error

 sql: FATAL:  Peer authentication failed for user vagrant

 If I try to connect to my server using psql.

 I guess I'm misunderstanding the PostgreSQL manual. But, how could I get
 what I need? (locally connect with the user vagrant like if it was the
 postgres user)

 Many thanks in advance (and sorry for the cross-posting. I asked this in
 serverfault too, but I think this is the right place)

 --
 Jorge Arevalo

 http://about.me/jorgeas80



Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-06 Thread John R Pierce

On 8/6/2014 3:43 PM, Jorge Arevalo wrote:


I want to connect to my local installation of PostgreSQL 9.1 using my 
machine user (who is vagrant). So, after reading PostgreSQL 
documentation, I thought I just needed to:





wouldn't it be easier to ...

create user vagrant superuser;
create database vagrant owner vagrant;

?



--
john r pierce  37N 122W
somewhere on the middle of the left coast



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


Re: [GENERAL] Connecting with PostgreSQL 9.1 using the Ubuntu machine user and peer authentication method

2014-08-06 Thread Adrian Klaver

On 08/06/2014 03:43 PM, Jorge Arevalo wrote:

Hello,

I want to connect to my local installation of PostgreSQL 9.1 using my
machine user (who is vagrant). So, after reading PostgreSQL
documentation, I thought I just needed to:

1. Add username map in pg_ident.conf:

# MAPNAME   SYSTEM-USERNAME PG-USERNAME

vp   vagrantpostgres


2. Using the map in pg_hba.conf

# TYPE  DATABASEUSERADDRESS METHOD

local   all  all
   peer map=vp

But I'm getting the error

sql: FATAL:  Peer authentication failed for user vagrant

If I try to connect to my server using psql.

I guess I'm misunderstanding the PostgreSQL manual. But, how could I get
what I need? (locally connect with the user vagrant like if it was the
postgres user)



What OS are you on?

Per:
http://www.postgresql.org/docs/9.1/interactive/auth-methods.html#AUTH-PEER

Peer authentication is only available on operating systems providing 
the getpeereid() function, the SO_PEERCRED socket parameter, or similar 
mechanisms. Currently that includes Linux, most flavors of BSD including 
Mac OS X, and Solaris.





--
Jorge Arevalo

http://about.me/jorgeas80



--
Adrian Klaver
adrian.kla...@aklaver.com


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


[GENERAL] Connecting Multiple LibreOffice Base Users to a Remote Postgres Database

2013-08-05 Thread Don Parris
Hi all,

I have been posting on my blog about getting LibreOffice Base and
PostgreSQL working together.  My latest actually focuses on getting
multiple users connecting to a single, remote, stand-alone PostgreSQL
server.  You can set this up fairly quickly and - in my case, anyway - with
no programming involved.

http://dcparris.net/2013/08/04/distributing-your-libreoffice-postgresql-database-across-systems-and-users-the-basics/

Of course, if you want to enforce business rules and security, you'll need
to employ server-side tools and programming, as well as possibly using Base
macros or Python on the client side.  I am not yet certain about how to
implement transactions, so that (following the project below), one can
complete a form and press a Submit button to make the whole transaction
fire at once.

My previous post is not so much of a tutorial, but more of an opportunity
to showcase a small project using LibreOffice Base as a front-end to
PostgreSQL.

http://dcparris.net/2013/07/22/ill-call-it-ldinero/

In any case, I hope these will be of some use to others here.  Please enjoy
and let me know if you need any clarification of any of my points.

Regards,
Don

-- 
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
http://dcparris.net/
https://www.xing.com/profile/Don_Parrishttp://www.linkedin.com/in/dcparris
GPG Key ID: F5E179BE


[GENERAL] Connecting to Postgres using Windows 7

2011-05-25 Thread Geoffrey Becker
I'm relatively new to postgres.  I've got a Visual Basic (VB) 
application that i would like to connect to a Postgres database using 
ODBC .  Both the VB application and postgres are on my laptop and both 
work beautifully independent of each other.  Trouble is, I have a 
windows 7 64bit OS and therefore I have been unable to get VB to connect 
to the database.  My code is as follows:


Public Class Form1

Dim cCon As ADODB.Connection

Private Sub Button1_Click(ByVal sender As System.Object, ByVal 
e As System.EventArgs) Handles Button1.Click


On Error GoTo EH

cCon.ConnectionString = 
DSN=MyDatabase;uid=MyUserID;pwd=MyPassword


cCon.Open()
MsgBox(O.K., vbInformation, Connection Message)
Exit Sub
EH:
MsgBox(Err.Description, vbCritical, Error Message)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e 
As System.EventArgs) Handles MyBase.Load

cCon = New ADODB.Connection
End Sub
End Class

When I try to connect, all I get is a Server does not exist or access 
is denied error.  I've tried configuring ODBC using odbcad32.exe as it 
seems that is necessary on a 64 bit OS, but I'm not sure if that even 
the right way to go.


Any help i could get would be much appreciated.

Thanks,

Geoff

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


Re: [GENERAL] Connecting to Postgres using Windows 7

2011-05-25 Thread Craig Ringer

On 05/25/2011 09:49 PM, Geoffrey Becker wrote:


When I try to connect, all I get is a Server does not exist or access
is denied error. I've tried configuring ODBC using odbcad32.exe as it
seems that is necessary on a 64 bit OS, but I'm not sure if that even
the right way to go.


*which* odbcad32.exe?

Due to a nasty historical quirk Microsoft is stuck with for backward 
compat, there are both 64-bit and 32-bit versions of odbcad32.exe .


http://support.microsoft.com/kb/942976

http://robertoschiabel.wordpress.com/2008/02/28/windows-x64-32bit-odbc-vs-64bit-odbc/

(Is this in the PgODBC documentation? It should be.)

--
Craig Ringer

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


Re: [GENERAL] Connecting to Postgres using Windows 7

2011-05-20 Thread George Weaver


- Original Message - 
From: Geoffrey Becker



I'm relatively new to postgres.  I've got a Visual Basic (VB)
application that i would like to connect to a Postgres database using
ODBC .  Both the VB application and postgres are on my laptop and both
work beautifully independent of each other.  Trouble is, I have a
windows 7 64bit OS and therefore I have been unable to get VB to connect
to the database.  My code is as follows:



Public Class Form1



Dim cCon As ADODB.Connection



Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click



On Error GoTo EH



cCon.ConnectionString =
DSN=MyDatabase;uid=MyUserID;pwd=MyPassword


Is this your actual connection string?  If your using a DSN does it
specify the Server Name and Port where PostgreSQL is listening?

See: http://www.connectionstrings.com/postgre-sql


cCon.Open()
MsgBox(O.K., vbInformation, Connection Message)
Exit Sub
EH:
MsgBox(Err.Description, vbCritical, Error Message)
End Sub



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
cCon = New ADODB.Connection
End Sub
End Class



When I try to connect, all I get is a Server does not exist or access
is denied error.  I've tried configuring ODBC using odbcad32.exe as it
seems that is necessary on a 64 bit OS, but I'm not sure if that even
the right way to go.


You may need to install the psqlODBC 64 bit driver if you trying to connect 
from a 64 bit machine.



Any help i could get would be much appreciated.



Thanks,



Geoff


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



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


[GENERAL] Connecting to Postgres using Windows 7

2011-05-18 Thread Geoffrey Becker
I'm relatively new to postgres.  I've got a Visual Basic (VB) 
application that i would like to connect to a Postgres database using 
ODBC .  Both the VB application and postgres are on my laptop and both 
work beautifully independent of each other.  Trouble is, I have a 
windows 7 64bit OS and therefore I have been unable to get VB to connect 
to the database.  My code is as follows:


Public Class Form1

Dim cCon As ADODB.Connection

Private Sub Button1_Click(ByVal sender As System.Object, ByVal 
e As System.EventArgs) Handles Button1.Click


On Error GoTo EH

cCon.ConnectionString = 
DSN=MyDatabase;uid=MyUserID;pwd=MyPassword


cCon.Open()
MsgBox(O.K., vbInformation, Connection Message)
Exit Sub
EH:
MsgBox(Err.Description, vbCritical, Error Message)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e 
As System.EventArgs) Handles MyBase.Load

cCon = New ADODB.Connection
End Sub
End Class

When I try to connect, all I get is a Server does not exist or access 
is denied error.  I've tried configuring ODBC using odbcad32.exe as it 
seems that is necessary on a 64 bit OS, but I'm not sure if that even 
the right way to go.


Any help i could get would be much appreciated.

Thanks,

Geoff

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


[GENERAL] Connecting matlab with postgresql

2011-04-29 Thread Sukuchha Shrestha
Hello nice people,

I am sure many of you have idea about how to connect matlab with postgresql.

Connecting with matab database toolbox is possible which i have not tried yet 
because i dont have access to that toolbox.

I have read in internet that its possible to connect without having a database 
toolbox.

Could anybody explain here how to connect in a detailed step ! Consider me 
studying in class 1 of postgresql when explaining :)

Sukuchha 

Re: [GENERAL] Connecting matlab with postgresql

2011-04-29 Thread fork
Sukuchha Shrestha sukuchha at yahoo.de writes:

 Could anybody explain here how to connect in a detailed step ! Consider me
studying in class 1 of postgresql when explaining :)

It may not be much help to you, but on a Unix shell I tend to run psql through
some text manipulation pipes and then into a csv which I read with dlmread().

And I use Octave, not Matlab, which plays slightly more nicely in a unix batch
environment.

Sorry if that is just noise for you.


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


Re: [GENERAL] Connecting to Teradata via Postgresql

2009-09-01 Thread Simon Riggs

On Sun, 2009-08-30 at 23:21 +0800, Ow Mun Heng wrote:

 Anyone here has a teradata box ? Are you able to connect to it from withing
 postgresql?
 
 I would like to pull 1or 2 tables from the box (sync) and was wondering if
 there's anyway to do that w/o using dbi-link.
 
 I actually am trying dbi-link but it seem as though it doesn't support
 DBD::Teradata.
 
 Based on the error descriptions, and some googling, seems like Teradata.pm
 does not support the column_info DBI method of getting the column
 descriptions and such.
 
 is there any other methods available?

The open source version of DBD::Teradata is a cut down version and I
doubt this would be the only problem with it. Have you tried the
licenced version? If that doesn't work then probably best to report it
to the authors.

Otherwise, I'd do a bteq export in CSV format and reload using COPY.
It's likely to be faster too.

-- 
 Simon Riggs   www.2ndQuadrant.com


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


[GENERAL] Connecting to Teradata via Postgresql

2009-08-30 Thread Ow Mun Heng
Hi All,

Anyone here has a teradata box ? Are you able to connect to it from withing
postgresql?

I would like to pull 1or 2 tables from the box (sync) and was wondering if
there's anyway to do that w/o using dbi-link.

I actually am trying dbi-link but it seem as though it doesn't support
DBD::Teradata.

Based on the error descriptions, and some googling, seems like Teradata.pm
does not support the column_info DBI method of getting the column
descriptions and such.

is there any other methods available?

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


Re: [GENERAL] Connecting to Teradata via Postgresql

2009-08-30 Thread David Fetter
On Sun, Aug 30, 2009 at 11:21:55PM +0800, Ow Mun Heng wrote:
 Hi All,
 
 Anyone here has a teradata box?  Are you able to connect to it from
 withing postgresql?

If you can get me a test environment including Teradata, I'd be
delighted to add support to DBI-Link, most likely in the form of
examples.

Cheers,
David.
-- 
David Fetter da...@fetter.org http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter  XMPP: david.fet...@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

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


Re: [GENERAL] connecting to a remote pq always require a password

2009-06-19 Thread Jasen Betts
On 2009-06-18, David Shen davidshe...@googlemail.com wrote:
 Hi,

 I am trying to use the libpq to connect to my postgresql 8.3 server.
 If I use dbname = mydb, the connection made successfully because I
 am using a socket connection. But if I use host = 127.0.0.1 dbname =
 mydb, the error message is no password supplied.

 In the pg_hba.conf file, I even change the host access control to this:
 hostall all 127.0.0.1/32  trust

 but it still does not work. What I missed?

postgres doesn't know who you are! specify a user in the connection
string.

you can use ident sameuser over TCP connections but it is no more
secure than the originating host. (it works via RFC1413)


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


[GENERAL] connecting to a remote pq always require a password

2009-06-18 Thread David Shen
Hi,

I am trying to use the libpq to connect to my postgresql 8.3 server.
If I use dbname = mydb, the connection made successfully because I
am using a socket connection. But if I use host = 127.0.0.1 dbname =
mydb, the error message is no password supplied.

In the pg_hba.conf file, I even change the host access control to this:
hostall all 127.0.0.1/32  trust

but it still does not work. What I missed?


-- 
Best Regards,
David Shen

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


Re: [GENERAL] connecting to a remote pq always require a password

2009-06-18 Thread John DeSoi


On Jun 18, 2009, at 8:11 AM, David Shen wrote:

In the pg_hba.conf file, I even change the host access control to  
this:

hostall all 127.0.0.1/32  trust

but it still does not work. What I missed?


Did you reload the configuration (or restart the sever) after making  
this change?


pg_ctl reload -D /path/to/your/data




John DeSoi, Ph.D.





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


Re: [GENERAL] connecting to a remote pq always require a password

2009-06-18 Thread Lennin Caro



--- On Thu, 6/18/09, David Shen davidshe...@googlemail.com wrote:

 From: David Shen davidshe...@googlemail.com
 Subject: [GENERAL] connecting to a remote pq always require a password
 To: pgsql-general@postgresql.org
 Date: Thursday, June 18, 2009, 12:11 PM
 Hi,
 
 I am trying to use the libpq to connect to my postgresql
 8.3 server.
 If I use dbname = mydb, the connection made successfully
 because I
 am using a socket connection. But if I use host =
 127.0.0.1 dbname =
 mydb, the error message is no password supplied.
 
 In the pg_hba.conf file, I even change the host access
 control to this:
 host    all     
    all     
    127.0.0.1/32       
   trust
 
 but it still does not work. What I missed?
 
 
 -- 
 Best Regards,
 David Shen
 
 -- 
 Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-general
 

waht is the ip number of the host machien and the remote machine to try connect

you can pass a password to the string conection

host=127.0.0.1 dbname=mydb user=myuser password=mypassword

maybe the problem is the net direction 127.0.0.x check this 






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


Re: [GENERAL] Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully

2009-05-01 Thread Tom Lane
Peter Geoghegan peter.geoghega...@gmail.com writes:
 I'm developing a PostgreSQL application for Windows CE 5 on a PDT/ PDA
 in C++/Qt, using Hiroshi Saito's libpq port for that platform. Since
 the connection is established over wi-fi, and wi-fi connectivity is
 often flaky, I feel that I have to fail gracefully to as great an
 extent as possible. The following utility function,
 VerifyDbConnection(), is called before every piece of database work:

 void MainInterface::VerifyDbConnection()
 {
 if (PQstatus(conn) != CONNECTION_OK)
 {
   ... try to recover ...
 }
 }

PQstatus does *not* probe to see if there's a live connection to the
database; it just returns the state left behind by the last operation.
So this code will just fall through and not do anything useful until
after you've already had a failure.  The forcible PQreset is probably
not the most graceful way of recovering, either.

What I'd try is a ping to the database server, and not initiate any
libpq operation unless the server is answering pings.  If you get
a failure due to connectivity loss midway through an operation,
PQreset is appropriate then --- but don't do it to recover from
a momentary network outage.

regards, tom lane

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


Re: [GENERAL] Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully

2009-05-01 Thread Peter Geoghegan
Wow, a response from the famous Tom Lane to my lame problem :-) .

 What I'd try is a ping to the database server, and not initiate any
 libpq operation unless the server is answering pings.  If you get
 a failure due to connectivity loss midway through an operation,
 PQreset is appropriate then --- but don't do it to recover from
 a momentary network outage.

That's interesting. In general, it's hard to ping from a windows
program, unless you want to repeatedly invoke ping.exe. I'm not sure
that I can even retrieve the result of that. That strikes me as fairly
kludgey - acceptable for some utility shellscript, but probably not
for what is supposed to be a responsive program.

Perhaps it would be preferable to call the function after the
operation, but before the application reports success. I'll look into
it.

Regards,
Peter Geoghegan

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


[GENERAL] Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully

2009-04-30 Thread Peter Geoghegan
Hello,

I'm developing a PostgreSQL application for Windows CE 5 on a PDT/ PDA
in C++/Qt, using Hiroshi Saito's libpq port for that platform. Since
the connection is established over wi-fi, and wi-fi connectivity is
often flaky, I feel that I have to fail gracefully to as great an
extent as possible. The following utility function,
VerifyDbConnection(), is called before every piece of database work:

void MainInterface::VerifyDbConnection()
{
if (PQstatus(conn) != CONNECTION_OK)
{
for(;;)
{
PQreset(conn);
if(PQstatus(conn) == CONNECTION_OK)
return;

QMessageBox msgbox_connection_lost;
msgbox_connection_lost.setText(Connection to the 
database is lost,
and cannot be re-established. 
This may be due to the fact that you're too 
far away from the
Wi-fi access point, or because 
the backoffice computer is turned off, or it 
may be a low level
connectivity problem. );
QPushButton* retry_button =
msgbox_connection_lost.addButton(tr(Reconnect),
QMessageBox::ActionRole);
QPushButton* exit_button =
msgbox_connection_lost.addButton(tr(Exit), QMessageBox::ActionRole);
msgbox_connection_lost.setWindowTitle(Connection 
lost);
msgbox_connection_lost.exec();

if(msgbox_connection_lost.clickedButton() == 
retry_button)
{
continue;
}
else if(msgbox_connection_lost.clickedButton() == 
exit_button)
{
exit(0);
return;
}
}
}

}

This seemed to work fine initially; I'd abruptly stop the database
server, and I would see a messagebox informing me of a connectivity
problem. Then, I'd start the server, click the retry button, and have
connectivity restored. However, when I walk out of range of the wi-fi
access point, which is the probable cause of losing connectivity in
the real world, my program crashes without displaying an error message
(I would expect to see a visual C++ runtime error message).

Can someone suggest a reason for this, or a workaround?

Regards,
Peter Geoghegan

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-20 Thread Albe Laurenz
Joey Morris wrote:
 This is my first attempt at using libpq, and I'm running across a strange
 problem. Here is my bare-bones program:
 
 #include stdio.h
 #include libpq-fe.h
 
 int main(int argc, char **argv) {
   PGconn *conn;
   fprintf(stderr, connecting\n);
   conn = PQconnectdb(dbname=postgres);
   PQfinish(conn);
   return 0;
 }
 
 I expected this program to print connecting, but in fact I get no output
 whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see
 connecting as expected. What could be going on here?

I tried your program, and it compiles and runs on my MinGW installation
and also writes the output to stderr.

One silly question first: are you sure that you actually call your
executable? You didn't name it test.exe, did you?

If you have problems printing to stderr, you could write to a log file:
outf = fopen(logfile.txt, a); fprintf(outf, whatever); fclose(outf);
or something like that.
If that doesn't work, odds are good that your code is not executed at all.

Yours,
Laurenz Albe

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


[GENERAL] connecting using libpq breaks printf

2009-02-19 Thread Joey Morris
This is my first attempt at using libpq, and I'm running across a strange
problem. Here is my bare-bones program:

#include stdio.h
#include libpq-fe.h

int main(int argc, char **argv) {
  PGconn *conn;
  fprintf(stderr, connecting\n);
  conn = PQconnectdb(dbname=postgres);
  PQfinish(conn);
  return 0;
}

I expected this program to print connecting, but in fact I get no output
whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see
connecting as expected. What could be going on here?

A few notes:
 - I'm running PostgreSQL 8.3.6 on Windows XP. I used the one-click
installer
   to install.
 - I'm compiling the program with MinGW. I get no compiler warnings or
errors.
 - I can connect to the database just fine using pgAdmin and the
command-line
   client. The database is running on localhost.
 - I've tried adding code to see if PQstatus(conn) == CONNECTION_OK, but
this
   hasn't been useful. Since fprintf() isn't working, I can't display a
message
   showing the result of the comparison.
 - I've tried various combinations of connection options in case there was
an
   issue with the hostname, database name, username, or password. I always
get
   the same result: no output.
 - I've tried printing to stdout and to a file, but neither helped.

Thanks for any help you can provide.

Joey



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


[GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
This is my first attempt at using libpq, and I'm running across a strange
problem. Here is my bare-bones program:

#include stdio.h
#include libpq-fe.h

int main(int argc, char **argv) {
  PGconn *conn;
  fprintf(stderr, connecting\n);
  conn = PQconnectdb(dbname=postgres);
  PQfinish(conn);
  return 0;
}

I expected this program to print connecting, but in fact I get no output
whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see
connecting as expected. What could be going on here?

A few notes:
 - I'm running PostgreSQL 8.3.6 on Windows XP. I used the one-click installer
   to install.
 - I'm compiling the program with MinGW. I get no compiler warnings or errors.
 - I can connect to the database just fine using both pgAdmin and the
   command-line client. The database is running on localhost.
 - I've tried adding code to see if PQstatus(conn) == CONNECTION_OK, but this
   hasn't been useful. Since fprintf() isn't working, I can't display a message
   showing the result of the comparison.
 - I've tried various combinations of connection options in case there was an
   issue with the hostname, database name, username, or password. I always get
   the same result: no output.
 - I've tried printing to stdout and to a file, but neither helped.

Thanks for any help you can provide.
Joey

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Lennin Caro
 This is my first attempt at using libpq, and I'm running
 across a strange
 problem. Here is my bare-bones program:
 
 #include stdio.h
 #include libpq-fe.h
 
 int main(int argc, char **argv) {
   PGconn *conn;
   fprintf(stderr, connecting\n);
   conn = PQconnectdb(dbname=postgres);
   PQfinish(conn);
   return 0;
 }
 
 I expected this program to print connecting,
 but in fact I get no output
 whatsoever. If I comment out the PQconnectdb and PQfinish
 lines, I see
 connecting as expected. What could be going on
 here?
 
 A few notes:
  - I'm running PostgreSQL 8.3.6 on Windows XP. I used
 the one-click installer
to install.
  - I'm compiling the program with MinGW. I get no
 compiler warnings or errors.
  - I can connect to the database just fine using both
 pgAdmin and the
command-line client. The database is running on
 localhost.
  - I've tried adding code to see if PQstatus(conn) ==
 CONNECTION_OK, but this
hasn't been useful. Since fprintf() isn't
 working, I can't display a message
showing the result of the comparison.
  - I've tried various combinations of connection
 options in case there was an
issue with the hostname, database name, username, or
 password. I always get
the same result: no output.
  - I've tried printing to stdout and to a file, but
 neither helped.
 
 Thanks for any help you can provide.
 Joey


try 
fprintf(stdout,Connection \n);
printf(Connection \n);


  

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Aurimas Černius

Hi,



This is my first attempt at using libpq, and I'm running across a strange
problem. Here is my bare-bones program:

#includestdio.h
#include libpq-fe.h

int main(int argc, char **argv) {
   PGconn *conn;
   fprintf(stderr, connecting\n);
   conn = PQconnectdb(dbname=postgres);
   PQfinish(conn);
   return 0;
}

I expected this program to print connecting, but in fact I get no output
whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see
connecting as expected. What could be going on here?


Did you use *exactly* the same command line to compile both versions?
What is that command line(s)?



A few notes:
  - I'm running PostgreSQL 8.3.6 on Windows XP. I used the one-click installer
to install.
  - I'm compiling the program with MinGW. I get no compiler warnings or errors.
  - I can connect to the database just fine using both pgAdmin and the
command-line client. The database is running on localhost.
  - I've tried adding code to see if PQstatus(conn) == CONNECTION_OK, but this
hasn't been useful. Since fprintf() isn't working, I can't display a message
showing the result of the comparison.
  - I've tried various combinations of connection options in case there was an
issue with the hostname, database name, username, or password. I always get
the same result: no output.
  - I've tried printing to stdout and to a file, but neither helped.

Thanks for any help you can provide.
Joey




--
Aurimas

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
Lennin Caro lennin.c...@yahoo.com wrote on Wed, Feb 18, 2009 at 06:53:32AM 
-0800:
 try 
 fprintf(stdout,Connection \n);
 printf(Connection \n);

Thanks, but both produce the same behavior as fprintf(stderr, Connection \n):
It prints when the PQconnectdb and PQfinish lines are commented out but not
when they are present.

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Aurimas Černius

Hi,

Looks like you accidently wrote to me personnally, not to mailing list.


On Wed, Feb 18, 2009 at 10:01 AM, Aurimas Černiusauri...@gmail.com  wrote:

Did you use *exactly* the same command line to compile both versions?
What is that command line(s)?


Yes, I used the same compilation command line for both versions:

gcc -o pq_test -IC:\Program Files\PostgreSQL\8.3\include
-LC:\Program Files\PostgreSQL\8.3\lib -lpq pq_test.c



Libraries should be places after the source file, that is (not sure 
about -L, but for -l surely):


gcc -o pq_test -IC:\Program Files\PostgreSQL\8.3\include pq_test.c 
-LC:\Program Files\PostgreSQL\8.3\lib -lpq


I don't if that's the problem, but it's not hard to try :)

--
Aurimas

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
Aurimas Černius auri...@gmail.com wrote on Wed, Feb 18, 2009 at 06:08:07PM 
+0200:
 Libraries should be places after the source file, that is (not sure  
 about -L, but for -l surely):

 gcc -o pq_test -IC:\Program Files\PostgreSQL\8.3\include pq_test.c  
 -LC:\Program Files\PostgreSQL\8.3\lib -lpq

 I don't if that's the problem, but it's not hard to try :)

Thanks for the suggestion, but unfortunately it didn't fix this problem.

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Aurimas Černius

Hi,



Aurimas Černiusauri...@gmail.com  wrote on Wed, Feb 18, 2009 at 06:08:07PM 
+0200:

Libraries should be places after the source file, that is (not sure
about -L, but for -l surely):

gcc -o pq_test -IC:\Program Files\PostgreSQL\8.3\include pq_test.c
-LC:\Program Files\PostgreSQL\8.3\lib -lpq

I don't if that's the problem, but it's not hard to try :)


Thanks for the suggestion, but unfortunately it didn't fix this problem.



How do you run the program, in console or by double clicking on 
executable. Try the second. Does the console window apear on the screen?


--
Aurimas

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread David Wilson
On Wed, Feb 18, 2009 at 9:47 AM, Joey Morris rjmorri...@gmail.com wrote:

 I expected this program to print connecting, but in fact I get no output
 whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see
 connecting as expected. What could be going on here?

Try adding fflush(stderr); after your fprintf() call. If the
connection is hanging and output hasn't been flushed, you wouldn't see
much.


-- 
- David T. Wilson
david.t.wil...@gmail.com

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
David Wilson david.t.wil...@gmail.com wrote on Wed, Feb 18, 2009 at 
11:36:44AM -0500:
 Try adding fflush(stderr); after your fprintf() call. If the
 connection is hanging and output hasn't been flushed, you wouldn't see
 much.

No, this doesn't help, either. Thanks for the suggestion.

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Sam Mason
On Wed, Feb 18, 2009 at 06:08:07PM +0200, Aurimas Cernius wrote:
 Joey Morris wrote:
  gcc -o pq_test -IC:\Program Files\PostgreSQL\8.3\include -LC:\Program 
  Files\PostgreSQL\8.3\lib -lpq pq_test.c

gcc won't give many warnings unless you give it a -Wall flag; it may be
doing strange things and not telling you, doubt it though the code looks
nice and simple and compiles and runs here OK.  I'm running on a Linux
box though, but that shouldn't matter for this code.

Have you got a debugger available, it could help to single step through
and see what's going on.

Just thought, it's not because it can't find the DLL is it?

-- 
  Sam  http://samason.me.uk/

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Mikko Partio
On Wed, Feb 18, 2009 at 4:47 PM, Joey Morris rjmorri...@gmail.com wrote:

 This is my first attempt at using libpq, and I'm running across a strange
 problem. Here is my bare-bones program:

 #include stdio.h
 #include libpq-fe.h

 int main(int argc, char **argv) {
  PGconn *conn;
  fprintf(stderr, connecting\n);
  conn = PQconnectdb(dbname=postgres);
  PQfinish(conn);
  return 0;
 }



Works fine with linux + gcc. Must be something in your environment.

Regards

Mikko


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
 How do you run the program, in console or by double clicking on  
 executable. Try the second. Does the console window apear on the screen?

Aha! This tip has led to the solution. I had been running the program from
an emacs shell buffer. If I run it from the Windows console or by
double-clicking the executable, a dialog box pops up with this error
message:

The application has failed to start because LIBPQ.dll was not found.
Re-installing the application may fix this problem.

At run-time, the system apparently cannot find libpq.dll and is aborting
immediately. The reason is that the directory containing libpq.dll was not
in my DLL search path. I added C:\Program Files\PostgreSQL\8.3\bin to my
PATH environment variable, and now the program works as expected. Note that
adding C:\Program Files\PostgreSQL\8.3\lib to the PATH doesn't completely
solve the problem, since bin contains some necessary DLLs that aren't in lib
(such as ssleay32.dll).

Alternatively, I could have copied the DLLs to C:\Windows\system32 or to the
directory containing the executable, but I like the PATH solution better.

Thanks, everyone, for your help!

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


Re: [GENERAL] connecting using libpq breaks printf

2009-02-18 Thread Joey Morris
Aurimas Černius auri...@gmail.com wrote on Wed, Feb 18, 2009 at 05:01:14PM 
+0200:
 Did you use *exactly* the same command line to compile both versions?
 What is that command line(s)?

Yes, I used the same compilation command line for both versions:

gcc -o pq_test -IC:\Program Files\PostgreSQL\8.3\include -LC:\Program 
Files\PostgreSQL\8.3\lib -lpq pq_test.c

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


Re: [GENERAL] Connecting to old 7.1 Database

2009-02-04 Thread Schwaighofer Clemens
On Tue, Nov 18, 2008 at 18:34, Andy Greensted ajg...@ohm.york.ac.uk wrote:

 So, two questions:

 - Is there anyway to run a newer version (8.3.5) of psql in some sort of
 'backwards compatible' mode?

 - Do you have any tips on making 7.1.3 compile on a newer system?

The last time I had to compile super old code (was super old apache
with super old php) I had to setup a separate libs, etc enviroment
wherein I could compile it.

Perhaps you can find a very old Live CD from gentoo, knoppix or other
and use this?


-- 
[ Clemens Schwaighofer  -=:~ ]
[ IT Engineer/Manager]
[ E-Graphics Communications, TEQUILA\ Japan IT Group ]
[6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7703Fax: +81-(0)3-3545-7343 ]
[ http://www.tequila.jp  ]

Advertising Age Global Agency of the Year 2008
Adweek Global Agency of the Year 2008

This e-mail is intended only for the named person or entity to which 
it is addressed and contains valuable business information that is 
privileged, confidential and/or otherwise protected from disclosure.  
Dissemination, distribution or copying of this e-mail or the 
information herein by anyone other than the intended recipient, or 
an employee or agent responsible for delivering the message to the 
intended recipient, is strictly prohibited.  All contents are the 
copyright property of TBWA Worldwide, its agencies or a client of 
such agencies. If you are not the intended recipient, you are 
nevertheless bound to respect the worldwide legal rights of TBWA 
Worldwide, its agencies and its clients. We require that unintended 
recipients delete the e-mail and destroy all electronic copies in 
their system, retaining no copies in any media.If you have received 
this e-mail in error, please immediately notify us via e-mail to 
disclai...@tbwaworld.com.  We appreciate your cooperation.

We make no warranties as to the accuracy or completeness of this 
e-mail and accept no liability for its content or use.  Any opinions
expressed in this e-mail are those of the author and do not 
necessarily reflect the opinions of TBWA Worldwide or any of its 
agencies or affiliates. 


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


[GENERAL] Connecting to old 7.1 Database

2008-11-22 Thread Andy Greensted

Hi All,

I need to connect to a version 7.1 PostgreSQL database. Unfortunately, I 
cannot get the 7.1.3 source to compile. configure gives this error:


checking types of arguments for accept()... configure: error: could not 
determine argument types


I'm not posting to pgsql-bugs because I think this is to do with me 
having a much newer environment (gentoo linux) than was around when 
7.1.3 was released.


So, two questions:

- Is there anyway to run a newer version (8.3.5) of psql in some sort of 
'backwards compatible' mode?


- Do you have any tips on making 7.1.3 compile on a newer system?

Many thanks
Andy

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


Re: [GENERAL] Connecting to old 7.1 Database

2008-11-20 Thread Andy Greensted
After a trying a few different versions, 7.2.8 seems to compile OK and 
is happy connecting to a 7.1 server.


Andy

Andy Greensted wrote:

Hi All,

I need to connect to a version 7.1 PostgreSQL database. Unfortunately, I
cannot get the 7.1.3 source to compile. configure gives this error:

checking types of arguments for accept()... configure: error: could not
determine argument types

I'm not posting to pgsql-bugs because I think this is to do with me
having a much newer environment (gentoo linux) than was around when
7.1.3 was released.

So, two questions:

- Is there anyway to run a newer version (8.3.5) of psql in some sort of
'backwards compatible' mode?

- Do you have any tips on making 7.1.3 compile on a newer system?

Many thanks
Andy




--
Dr. Andrew Greensted  Department of Electronics
Bio-Inspired Engineering  University of York, YO10 5DD, UK

Tel: +44(0)1904 432828Mailto: [EMAIL PROTECTED]
Fax: +44(0)1904 432335Web: http://www.bioinspired.com/users/ajg112

2009 IEEE Congress on Evolutionary Computation: http://www.cec-2009.org

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


Re: [GENERAL] Connecting to old 7.1 Database

2008-11-19 Thread Raymond O'Donnell
On 19/11/2008 10:57, Andy Greensted wrote:

 - Is there anyway to run a newer version (8.3.5) of psql in some sort of
 'backwards compatible' mode?

Newer versions of pg_dump are usually able to dump data from older PG
versions, so in theory you ought to be able to suck your data from the
old DB and load it into a newer one. I dunno about 7.1 - 8.3, though -
that's quite a gulf!

If that doesn't work, maybe you could try 7.4.23 which is still
supported and available from the website.

Ray.

--
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[EMAIL PROTECTED]
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
--

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


[GENERAL] Connecting to old 7.1 Database

2008-11-19 Thread Andy Greensted

Hi All,

I need to connect to a version 7.1 PostgreSQL database. Unfortunately, I
cannot get the 7.1.3 source to compile. configure gives this error:

checking types of arguments for accept()... configure: error: could not
determine argument types

I'm not posting to pgsql-bugs because I think this is to do with me
having a much newer environment (gentoo linux) than was around when
7.1.3 was released.

So, two questions:

- Is there anyway to run a newer version (8.3.5) of psql in some sort of
'backwards compatible' mode?

- Do you have any tips on making 7.1.3 compile on a newer system?

Many thanks
Andy


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


[GENERAL] Connecting to an existing transaction state.

2008-07-30 Thread Alex Gen
Hello,

I’m in the process of creating a set of scripts for testing certain locking 
features in an application.
What I would like to do:
1. Start a connection from machine-01 through the m01-s1.sql script.
2.While (1) is running, start another transaction on the same database from 
machine-02 using m02-s1.sql.

At this point in time, there are two open transactions on certain tables in the 
same database.

3. Using m01-s2.sql I would like to execute a certain SQL statement – BUT 
within the scope of the transaction begun by m01-s1.sql.
4. Current situation: Since there are several .sql scripts, each getting its 
own connection and executing sql stmts – they are not aware of activities of 
the other scripts (i.e. the open transactions).
5. What I’d like to do: After a transaction has been started from a machine, I 
should be able to save the transaction reference (id?) temporarily somewhere.
6. The next statement (new .sql file) that wishes to execute within the scope 
of the above transaction – should be able to get the transaction reference (id) 
and latch onto it in its current state. This way it continues to perform as 
part of a whole – rather than only executing the statements that it had.

Any guidance in this will help.

Cheers!
AlexiG




  __
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at 
Yahoo! http://uk.docs.yahoo.com/ymail/new.html

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


Re: [GENERAL] Connecting to an existing transaction state.

2008-07-30 Thread Francisco Reyes
On 10:37 am 07/28/08 Alex Gen [EMAIL PROTECTED] wrote:
 3. Using m01-s2.sql I would like to execute a certain SQL statement
 – BUT within the scope of the transaction begun by m01-s1.sql.

I believe that is not possible.
Specially if you are within a transaction on each of the scripts.

As far as I know all the work getting done inside a transaction is ONLY
visible to that transaction. It would actually be pretty bad if the
database allowed a process to see an uncommited state from a transaction
that may end up rolling back.

What are you trying to test?
You mentioned how you are testing, but what is the business need? Or
business concern?

ie It could be something like.. we are concerned that if we run these two
scripts one may lock the other.


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


Re: [GENERAL] Connecting to an existing transaction state.

2008-07-30 Thread Alvaro Herrera
Alex Gen wrote:
 Hello,
 
 I’m in the process of creating a set of scripts for testing certain locking 
 features in an application.
 What I would like to do:
 1. Start a connection from machine-01 through the m01-s1.sql script.
 2.While (1) is running, start another transaction on the same database from 
 machine-02 using m02-s1.sql.
 
 At this point in time, there are two open transactions on certain tables in 
 the same database.
 
 3. Using m01-s2.sql I would like to execute a certain SQL statement – BUT 
 within the scope of the transaction begun by m01-s1.sql.
 4. Current situation: Since there are several .sql scripts, each getting its 
 own connection and executing sql stmts – they are not aware of activities of 
 the other scripts (i.e. the open transactions).
 5. What I’d like to do: After a transaction has been started from a machine, 
 I should be able to save the transaction reference (id?) temporarily 
 somewhere.
 6. The next statement (new .sql file) that wishes to execute within the scope 
 of the above transaction – should be able to get the transaction reference 
 (id) and latch onto it in its current state. This way it continues to perform 
 as part of a whole – rather than only executing the statements that it had.

You cannot do this directly by simply using SQL files being fed to psql.
What you can do is open one psql process reading from a named pipe, and
write SQL commands to this pipe.

I was able to do this with some shell tricks; it read a single SQL file
which had commands prefixed by a session number, and executed each
command in a different session by echoing them to the pipe attached to
each session.  (You must have a separate process keeping the pipe open
for writing in between; otherwise psql gets a SIGPIPE and dies after the
first echo finishes).

I don't have the script around anymore though :-(

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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


Re: [GENERAL] Connecting to an existing transaction state.

2008-07-30 Thread Craig Ringer
Alvaro Herrera wrote:
 Alex Gen wrote:
 Hello,

 I’m in the process of creating a set of scripts for testing certain locking 
 features in an application.
 What I would like to do:
 1. Start a connection from machine-01 through the m01-s1.sql script.
 2.While (1) is running, start another transaction on the same database from 
 machine-02 using m02-s1.sql.

 At this point in time, there are two open transactions on certain tables in 
 the same database.

 3. Using m01-s2.sql I would like to execute a certain SQL statement – BUT 
 within the scope of the transaction begun by m01-s1.sql.
 4. Current situation: Since there are several .sql scripts, each getting its 
 own connection and executing sql stmts – they are not aware of activities of 
 the other scripts (i.e. the open transactions).
 5. What I’d like to do: After a transaction has been started from a machine, 
 I should be able to save the transaction reference (id?) temporarily 
 somewhere.
 6. The next statement (new .sql file) that wishes to execute within the 
 scope of the above transaction – should be able to get the transaction 
 reference (id) and latch onto it in its current state. This way it continues 
 to perform as part of a whole – rather than only executing the statements 
 that it had.
 
 You cannot do this directly by simply using SQL files being fed to psql.
 What you can do is open one psql process reading from a named pipe, and
 write SQL commands to this pipe.

Yep. You can also write a file that sources the others, and use psql to
load that. Eg:

BEGIN;
\i m01-s1.sql
\i m01-s2.sql
COMMIT;

Another option is to write a wrapper program using one of the scripting
languages with PostgreSQL interfaces (Python, Perl, etc) that
establishes a connection then loads a sequence of snippets and sends
them. That's a little more flexible, but not much more complicated.

--
Craig Ringer

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


[GENERAL] Connecting to an existing transaction state.

2008-07-28 Thread Alex Gen
Hello,

I’m in the process of creating a set of scripts for testing certain locking 
features in an application.
What I would like to do:
1. Start a connection from machine-01 through the m01-s1.sql script.
2.While (1) is running, start another transaction on the same database from 
machine-02 using m02-s1.sql.

At this point in time, there are two open transactions on certain tables in the 
same database.

3. Using m01-s2.sql I would like to execute a certain SQL statement – BUT 
within the scope of the transaction begun by m01-s1.sql.
4. Current situation: Since there are several .sql scripts, each getting its 
own connection and executing sql stmts – they are not aware of activities of 
the other scripts (i.e. the open transactions).
5. What I’d like to do: After a transaction has been started from a machine, I 
should be able to save the transaction reference (id?) temporarily somewhere.
6. The next statement (new .sql file) that wishes to execute within the scope 
of the above transaction – should be able to get the transaction reference (id) 
and latch onto it in its current state. This way it continues to perform as 
part of a whole – rather than only executing the statements that it had.

Any guidance in this will help.

Cheers!
AlexiG



  __
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at 
Yahoo! http://uk.docs.yahoo.com/ymail/new.html

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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-10 Thread Abhishek MANDHANA
In any case, it's obvious in your screenshot that you left the server and
location fields blank in the connection setup form. This is most likely
the cause of your problem.

*doesnt work either..OLE-DB error persists. thanks for the readmefile.
*
On Wed, Apr 9, 2008 at 8:04 PM, Craig Ringer [EMAIL PROTECTED]
wrote:

 Abhishek MANDHANA wrote:

  Did 30 seconds search worked ? for me its didnt ?
 
  Please just dont test the connection, the applet shows Connection
  successful
  , Are you able to create it  and see it under Server Explorer?
 
 

 I mostly use Linux. I'm on Vista right now, but I have never used Visual
 Basic and have none of the tools for it.  I have Visual Studio for C++
 installed, but not for Visual Basic .NET. So I can't test it, and I'm afraid
 I'm not going to install VB.net to test it. As such, I'm working from
 information available on the 'net, such as the PostgreSQL OLE DB provider
 documentation (which, by the way, is hard to find - I landed up digging it
 out of ViewCVS). You, however, will have a copy of the file that came with
 your copy of the OLE DB provider.

 This is the README file. I strongly suggest having a look:

 http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/oledb/oledb/README?rev=1.7content-type=text/x-cvsweb-markup

 In any case, it's obvious in your screenshot that you left the server
 and location fields blank in the connection setup form. This is most
 likely the cause of your problem. Try putting localhost in the server
 box, and the name of your database in the location box. If you have not
 created a database yet, you will need to do so. See the PostgreSQL
 documentation on how to do that.

 As for the error message, it basically means oops, it didn't work and I
 don't know why. The PostgreSQL OLE DB provider README explains how to get
 more detailed error information.

 --
 Craig Ringer



[GENERAL] connecting VB to postgreSQL

2008-04-09 Thread leoabhi

 Hello,

 I wish to connect Visual Studio 2008(VB) to PostgreSQL..

I used the following help file to do it ..
http://support.microsoft.com/?scid=kb%3Ben-us%3B316649x=12y=14

Unfortunately, it does not connect..although when you test connection, using
test connection switch, VB displays test connection successful. The error
which i get is included in Snapshot .

The error in English means
Multiple-step OLE DB operation generated errors. 
Check each OLE DB status value, if available. No work was done.

Please see enclosed snapsots..
http://www.nabble.com/file/p16583837/Vb_error1.bmp Vb_error1.bmp 

any help/suggestion would be great or else any other suggestion/program to
connect VB to postgreSQL
http://www.nabble.com/file/p16583837/VB_Error.bmp VB_Error.bmp 

Thanks
Abhi

-- 
View this message in context: 
http://www.nabble.com/connecting-VB-to-postgreSQL-tp16583837p16583837.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread leoabhi

Hi Richard,

is it possible to check them individually how ? well..!! I think it has
something to do with settings. couldnt even add a connection because once i
click ok, it show the OLE-DB error, so no question about executing
statements..
In tried with mdb database it works.

Found some more help.
http://support.microsoft.com/?scid=kb%3Ben-us%3B269495x=9y=10

Please see a snapshot of settings i could change .. The above help file also
speaks about Connection string (FILENAME). Any idea how this setting is to
be done if necessary for adding a postgresql connection.

Please reply.

Thanks

abhi
http://www.nabble.com/file/p16584555/settings_VB.bmp settings_VB.bmp 

leoabhi wrote:
 
  Hello,
 
  I wish to connect Visual Studio 2008(VB) to PostgreSQL..
 
 I used the following help file to do it ..
 http://support.microsoft.com/?scid=kb%3Ben-us%3B316649x=12y=14
 
 Unfortunately, it does not connect..although when you test connection,
 using test connection switch, VB displays test connection successful. The
 error which i get is included in Snapshot .
 
 The error in English means
 Multiple-step OLE DB operation generated errors. 
 Check each OLE DB status value, if available. No work was done.
 
 Please see enclosed snapsots..
  http://www.nabble.com/file/p16583837/Vb_error1.bmp Vb_error1.bmp 
 
 any help/suggestion would be great or else any other suggestion/program to
 connect VB to postgreSQL
  http://www.nabble.com/file/p16583837/VB_Error.bmp VB_Error.bmp 
 
 Thanks
 Abhi
 
 

-- 
View this message in context: 
http://www.nabble.com/connecting-VB-to-postgreSQL-tp16583837p16584555.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Richard Huxton

leoabhi wrote:

The error in English means
Multiple-step OLE DB operation generated errors. 
Check each OLE DB status value, if available. No work was done.


Well, did you check each OLE DB status value? Which failed and what 
was it doing? Are there any errors logged at the server? Did you turn 
statement logging on at the server and see what statements were being 
executed?


--
  Richard Huxton
  Archonet Ltd

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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Richard Huxton

leoabhi wrote:

Hi Richard,

is it possible to check them individually how ?


No idea - you're one using .net - how would you normally check?

 well..!! I think it has

something to do with settings. couldnt even add a connection because once i
click ok, it show the OLE-DB error, so no question about executing
statements..
In tried with mdb database it works.

Found some more help.
http://support.microsoft.com/?scid=kb%3Ben-us%3B269495x=9y=10

Please see a snapshot of settings i could change .. The above help file also
speaks about Connection string (FILENAME). Any idea how this setting is to
be done if necessary for adding a postgresql connection.


No idea. You're still not telling us what the error message is when you 
try to connect.


I don't use .net, but if you write code to connect to any database then 
the connect method/function will return some sort of status code to 
indicate success or failure. There will then be a way of getting a 
precise error code and message.


I'm assuming you can connect from this machine using psql and/or 
pgadmin, yes?


I'm assuming you've turned on connection logging at the server and have 
checked to see what's happening there, yes?


What happened when you tried the example code in the driver's tutorial?

--
  Richard Huxton
  Archonet Ltd

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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread leoabhi

Hello,

In brief.

TASK : Write a code in VB so that i can connect to postgreSQL and then
execute some stataments from my VB application.

I didnt want to code it ..I found the other way round very similar but
without coding.

Visual basic has a server explorer .. which can be used to connect to
various database(Eg:Access database,mdb or in our case postgreSQL) and then
you can execute the SQL statements in VB, now once you open Server explorer
you need to ADD/Create/setup a  A CONNECTION TO DATABASE which you want to
use., i.e. setup a connection to postgreSQL.

now my first 2 posts speak about this setup and problem/error i had while
setting up connection..it gives OLE-DB error which we already spoke
about..STILL UNRESOLVED.

All goes around setup required to connect to postgreSQL using VB ,Server
Explorer.
I need the settings to be done in Server explorer , so tht i could connect
to postgreSQL...please see snapshots from first posts..That is all you will
neeed.you will understand it quickly now i hope..I know this speaks much
around VB but you need to know why OLE-DB error occurs when you connect a
database?

I have found another way to connect , still i need to check its surety,
hopefully tomo it works 

I hope this helped you understand me better , please reply if you find any
solution. I will again post update about it tomorrow., but if this works it
would be gr8 atleast for me ;-)

I'm assuming you can connect from this machine using psql and/or
pgadmin, yes? 
Yes richard , I am able to connect

I'm assuming you've turned on connection logging at the server and have
checked to see what's happening there, yes? 
Yes i turned it on and it helped me to find out the other method , Thanks.

Thank you

Abhi

No idea. You're still not telling us what the error message is when you
try to connect.

I don't use .net, but if you write code to connect to any database then
the connect method/function will return some sort of status code to
indicate success or failure. There will then be a way of getting a
precise error code and message.

I'm assuming you can connect from this machine using psql and/or
pgadmin, yes?

I'm assuming you've turned on connection logging at the server and have
checked to see what's happening there, yes?

What happened when you tried the example code in the driver's tutorial?

-- 
   Richard Huxton
   Archonet Ltd 
-- 
View this message in context: 
http://www.nabble.com/connecting-VB-to-postgreSQL-tp16583837p16592116.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Craig Ringer

leoabhi wrote:


now my first 2 posts speak about this setup and problem/error i had while
setting up connection..it gives OLE-DB error which we already spoke
about..STILL UNRESOLVED.

All goes around setup required to connect to postgreSQL using VB ,Server
Explorer.
I need the settings to be done in Server explorer , so tht i could connect
to postgreSQL...please see snapshots from first posts..That is all you will
neeed.you will understand it quickly now i hope..I know this speaks much
around VB but you need to know why OLE-DB error occurs when you connect a
database?


A 30 second Google search suggests that server is ... the server 
hostname or IP address, and location is the database name.


--
Craig Ringer

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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Abhishek MANDHANA
Did 30 seconds search worked ? for me its didnt ?

Please just dont test the connection, the applet shows Connection successful
, Are you able to create it  and see it under Server Explorer?

Abhi


On Wed, Apr 9, 2008 at 7:39 PM, Craig Ringer [EMAIL PROTECTED]
wrote:

 leoabhi wrote:

  now my first 2 posts speak about this setup and problem/error i had while
  setting up connection..it gives OLE-DB error which we already spoke
  about..STILL UNRESOLVED.
 
  All goes around setup required to connect to postgreSQL using VB ,Server
  Explorer.
  I need the settings to be done in Server explorer , so tht i could
  connect
  to postgreSQL...please see snapshots from first posts..That is all you
  will
  neeed.you will understand it quickly now i hope..I know this speaks much
  around VB but you need to know why OLE-DB error occurs when you connect
  a
  database?
 

 A 30 second Google search suggests that server is ... the server
 hostname or IP address, and location is the database name.

 --
 Craig Ringer




-- 
Mandhana Abhishek R.
http://abhishekrm.googlepages.com


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Craig Ringer

Abhishek MANDHANA wrote:

Did 30 seconds search worked ? for me its didnt ?

Please just dont test the connection, the applet shows Connection successful
, Are you able to create it  and see it under Server Explorer?
  


I mostly use Linux. I'm on Vista right now, but I have never used Visual 
Basic and have none of the tools for it.  I have Visual Studio for C++ 
installed, but not for Visual Basic .NET. So I can't test it, and I'm 
afraid I'm not going to install VB.net to test it. As such, I'm working 
from information available on the 'net, such as the PostgreSQL OLE DB 
provider documentation (which, by the way, is hard to find - I landed up 
digging it out of ViewCVS). You, however, will have a copy of the file 
that came with your copy of the OLE DB provider.


This is the README file. I strongly suggest having a look:
   
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/oledb/oledb/README?rev=1.7content-type=text/x-cvsweb-markup


In any case, it's obvious in your screenshot that you left the server 
and location fields blank in the connection setup form. This is most 
likely the cause of your problem. Try putting localhost in the 
server box, and the name of your database in the location box. If 
you have not created a database yet, you will need to do so. See the 
PostgreSQL documentation on how to do that.


As for the error message, it basically means oops, it didn't work and I 
don't know why. The PostgreSQL OLE DB provider README explains how to 
get more detailed error information.


--
Craig Ringer

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


Re: [GENERAL] connecting VB to postgreSQL

2008-04-09 Thread Francisco Figueiredo Jr.
On Wed, Apr 9, 2008 at 7:20 AM, leoabhi [EMAIL PROTECTED] wrote:

   Hello,

Hello Abhi!

   I wish to connect Visual Studio 2008(VB) to PostgreSQL..


Have you tried Npgsql?

http://www.npgsql.org
http://project.npgsql.org
http://documentation.npgsql.org

I hope it helps.


-- 
Regards,

Francisco Figueiredo Jr.
fxjr.blogspot.com
www.npgsql.org

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


Re: [GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-07 Thread Dave Page

Andreas Tille wrote:

On Wed, 5 Sep 2007, Andreas Tille wrote:


On Mon, 4 Sep 2007, Albe Laurenz wrote:


The best list for this kind of thing is certainly the Npgsql
mailing list:
http://gborg.postgresql.org/mailman/listinfo/npgsql-general


Just subscribed.


Well, I looked at the archives of this list and also at

   http://gborg.postgresql.org/mailman/listinfo/npgsql-hackers

There is no posting at the later list for 2007 and only zero to
two postings per month on the general list.  This frequency is
very typical for dead projects.  Do you think I'm well advised
to use Npsql at all or is this an unreasonable conclusion?


Npgsql is very much alive and kicking - you're just looking at the old 
website. Try: http://pgfoundry.org/projects/npgsql/


Regards, Dave

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


Re: [GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-07 Thread Andreas Tille

On Wed, 5 Sep 2007, Andreas Tille wrote:


On Mon, 4 Sep 2007, Albe Laurenz wrote:


The best list for this kind of thing is certainly the Npgsql
mailing list:
http://gborg.postgresql.org/mailman/listinfo/npgsql-general


Just subscribed.


Well, I looked at the archives of this list and also at

   http://gborg.postgresql.org/mailman/listinfo/npgsql-hackers

There is no posting at the later list for 2007 and only zero to
two postings per month on the general list.  This frequency is
very typical for dead projects.  Do you think I'm well advised
to use Npsql at all or is this an unreasonable conclusion?

Kind regards

  Andreas.

--
http://fam-tille.de

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


Re: [GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-04 Thread Albe Laurenz
 it is my first shot using Mono and I failed to get the example from
 
 http://www.mono-project.de/wiki/keyword/PostgreSQL/
 
 working.  The reason is obviousely that whatever I tried 
 NpgsqlConnection
 tries to use password authentication but I have configured my system
 that ident authentication is used by default.
 
 I'm using Debian GNU/Linux testing running postgresql 8.2 and 
 mono 1.2.
 Could anybody enlight me how to connect to a database where users have
 no password set because always ident authentication is used 
 on local host.

The best list for this kind of thing is certainly the Npgsql
mailing list:
http://gborg.postgresql.org/mailman/listinfo/npgsql-general

What error messages do you get when you try to connect?

Yours,
Laurenz Albe

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


Re: [GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-04 Thread Andreas Tille

On Mon, 4 Sep 2007, Albe Laurenz wrote:


The best list for this kind of thing is certainly the Npgsql
mailing list:
http://gborg.postgresql.org/mailman/listinfo/npgsql-general


Just subscribed.


What error messages do you get when you try to connect?


When I use the connection string

  string connStr = 
Server=127.0.0.1;Port=5432;User=tillea;Database=InfluenzaWeb;;

I get

Npgsql.NpgsqlException:
Passwort-Authentifizierung für Benutzer 'tillea' fehlgeschlagen
  -- Translation: Password authentication for user 'tillea' failed
Severity: FATAL
Code: 28000
  at Npgsql.NpgsqlConnector.CheckErrors () [0x0]
  at Npgsql.NpgsqlConnector.Open () [0x0]
  at Npgsql.NpgsqlConnectorPool.GetPooledConnector (Npgsql.NpgsqlConnection 
Connection) [0x0]


So npgsql is obviousely trying password authentication and I have no idea
how to ask for ident authetication.  I also tried
   Server=localhost

If I leave out the Server parameter at all I get

System.ArgumentException: Connection string argument missing!
Parameter name: SERVER

(which is different to other psql connectors I know from Python or Perl).

Kind regards

 Andreas.

PS:  I've seen a another private answer to my mail in my incoming box but due to
 a problem here it was deleted. :(
 Could the kind poster please repost his mail because I don't see it in
 the archive?

 Many thanks, Andreas.


--
http://fam-tille.de

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


[GENERAL] Connecting to PostgreSQL server with Mono using ident authetication

2007-09-03 Thread Andreas Tille

Hi,

it is my first shot using Mono and I failed to get the example from

   http://www.mono-project.de/wiki/keyword/PostgreSQL/

working.  The reason is obviousely that whatever I tried NpgsqlConnection
tries to use password authentication but I have configured my system
that ident authentication is used by default.

I'm using Debian GNU/Linux testing running postgresql 8.2 and mono 1.2.
Could anybody enlight me how to connect to a database where users have
no password set because always ident authentication is used on local host.

I hope this is the right list for this kind of questions.  Any hint for
a better place to ask is welcome as well.

Kind regards

Andreas.

PS: It would be welcome if you keep me in CC because I'm not subscribed
to the list, but I can read the archive as well.

--
http://fam-tille.de

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org/


[GENERAL] Connecting from one computer to another over lan

2007-08-09 Thread dalmasen

I've installed postgresql 8.2 on a windows vista machine and are trying to
connect to it from another one.
the server has ip 192.168.1.100 and the client 192.168.1.102

As I understand it, I should make some configuration changes in pg_hba.conf
to make this happen.
Both machines has both ipv4 and ipv6 installed (Vista standard I guess).

Ive tried some different settings in the pg_hba.conf (trying one at a time,
commenting out the rest):

# IPv4 local connections:
#hostall all 127.0.0.1/32  md5
#hostall all 192.168.0.0/16md5
hostall all 0.0.0.0/0  md5
# IPv6 local connections:
#hostall all ::1/128   md5


I've also changed listten_addresses in postgresql.conf to:
listen_addresses = '*'

-

I've installed VmWare player on the server. I guess that it's why it have so
many adapters:
Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::7dba:9969:999b:5bfe%11
   IPv4 Address. . . . . . . . . . . : 192.168.1.100
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Wireless LAN adapter Wireless Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Local Area Connection 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::440f:5179:acc9:5799%14
   IPv4 Address. . . . . . . . . . . : 192.168.243.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter Local Area Connection 3:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::d48:1d79:2215:543a%16
   IPv4 Address. . . . . . . . . . . : 192.168.11.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Tunnel adapter Local Area Connection* 6:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Local Area Connection* 7:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::5efe:192.168.1.100%12
   Default Gateway . . . . . . . . . :

Tunnel adapter Local Area Connection* 10:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Local Area Connection* 11:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::5efe:192.168.243.1%15
   Default Gateway . . . . . . . . . :

Tunnel adapter Local Area Connection* 12:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::5efe:192.168.11.1%17
   Default Gateway . . . . . . . . . :

--

And the client:
Ethernet-anslutning Anslutning till lokalt nätverk:

   Anslutningsspecifika DNS-suffix . :
   IPv4-adress . . . . . . . . . . . : 192.168.1.102
   Nätmask . . . . . . . . . . . . . : 255.255.255.0
   Standard-gateway. . . . . . . . . : 192.168.1.1

Tunnelanslutning: Anslutning till lokalt nätverk*:

   Tillstånd . . . . . . . . . . . . : Frånkopplad
   Anslutningsspecifika DNS-suffix . :

Tunnelanslutning: Anslutning till lokalt nätverk* 2:

   Anslutningsspecifika DNS-suffix . :
   Länklokal IPv6-adress . . . . . . : fe80::5efe:192.168.1.102%10
   Standard-gateway. . . . . . . . . :

(sorry for the swedish ;)

--

Any suggestions?
-- 
View this message in context: 
http://www.nabble.com/Connecting-from-one-computer-to-another-over-lan-tf4237412.html#a12056368
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


[GENERAL] Connecting a sequence with table column

2007-04-01 Thread RPK

I am using PGSQL 8.2.3 on Windows XP and pgAdmin 1.6.3. While adding columns
to a table from pgAdmin front-end, an option appears sequence with a
drop-down box on the column creation window, but it remains disabled. I have
already created a sequence but want to connect that sequence with this
column. How can I do this? Why this disabled drop-down box not enabling?
-- 
View this message in context: 
http://www.nabble.com/Connecting-a-sequence-with-table-column-tf3502025.html#a9780334
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] Connecting a sequence with table column

2007-04-01 Thread Chris

RPK wrote:

I am using PGSQL 8.2.3 on Windows XP and pgAdmin 1.6.3. While adding columns
to a table from pgAdmin front-end, an option appears sequence with a
drop-down box on the column creation window, but it remains disabled. I have
already created a sequence but want to connect that sequence with this
column. How can I do this? Why this disabled drop-down box not enabling?


The pg-admin guys would be able to answer this best:

http://www.pgadmin.org/support/

(While some are on the general postgres lists, most wouldn't be).

--
Postgresql  php tutorials
http://www.designmagick.com/

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org/


[GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread novnov

I am trying to connect to a postgres 8.1 installation on a ubuntu box from
windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf file
HINT see server log for details.

The server ip address is 192.168.1.10. The workstation ip address is
192.168.2.100. The server firewall allows connections on port 5432. I am
past the 'is the server open on port 5432?' errors, now it's 'missing or
erroneous pg_hba.conf'. I've added a line like this to that file:

host   all   all   192.168.2.100   md5 (have tried trust also)

As far as spacing of those entries goes, it's in keeping with the other
entries. 

Also I edited the postgresql.conf file so that listen_address = '*'

If I rem the line I added, I get a different error message (FATAL: no
pg_hba.conf entry for host 192.168.1.100, user postgres, database
template1, SSL off).

Note that is not the ip address of the xp workstation (192.168.2.100) or the
ubuntu server (192.168.1.10), that's the ip address of a router that stands
between them. But I'm guessing that the workstation can 'see' the ubuntu
postgresql installation, or altering the pg_hba.conf file wouldn't have any
effect at all.

I'd sure appreciate any help with this. I'm not sure how to check the log on
the ubuntu server as the error suggests...yes, I'm new to this, might do
better if I could could use one of the postgres gui tools, but that's
exactly what I'm not able to do at the moment g.


-- 
View this message in context: 
http://www.nabble.com/Connecting-to-a-remote-server%2C-pg_hba.conf-error--tf3297991.html#a9174496
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread Douglas McNaught
novnov [EMAIL PROTECTED] writes:

 I am trying to connect to a postgres 8.1 installation on a ubuntu box from
 windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf file
 HINT see server log for details.

 The server ip address is 192.168.1.10. The workstation ip address is
 192.168.2.100. The server firewall allows connections on port 5432. I am
 past the 'is the server open on port 5432?' errors, now it's 'missing or
 erroneous pg_hba.conf'. I've added a line like this to that file:

 host   all   all   192.168.2.100   md5 (have tried trust also)

I think you need a netmask on this IP:

host   all   all   192.168.2.100/32   md5

-Doug

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] Connecting to a remote server, pg_hba.conf error?

2007-02-26 Thread novnov

Wonderful, that solved it...THANK YOU!


Douglas McNaught wrote:
 
 novnov [EMAIL PROTECTED] writes:
 
 I am trying to connect to a postgres 8.1 installation on a ubuntu box
 from
 windows xp. I get this error: FATAL: missing or erroneous pg_hba.conf
 file
 HINT see server log for details.

 The server ip address is 192.168.1.10. The workstation ip address is
 192.168.2.100. The server firewall allows connections on port 5432. I am
 past the 'is the server open on port 5432?' errors, now it's 'missing or
 erroneous pg_hba.conf'. I've added a line like this to that file:

 host   all   all   192.168.2.100   md5 (have tried trust also)
 
 I think you need a netmask on this IP:
 
 host   all   all   192.168.2.100/32   md5
 
 -Doug
 
 ---(end of broadcast)---
 TIP 3: Have you checked our extensive FAQ?
 
http://www.postgresql.org/docs/faq
 
 

-- 
View this message in context: 
http://www.nabble.com/Connecting-to-a-remote-server%2C-pg_hba.conf-error--tf3297991.html#a9175269
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


[GENERAL] Connecting performance

2006-12-20 Thread 马庆
Dear :

 These days, I come across a problem that I can’t solve i , so I ask U 
for help.

 Problem Description:

   I use RedHat AS 4 + PostgreSQL 8.1 as our server. As long as 
the server program starts, it’ll immediately open 10~20 connects to the DB to 
handle the request.

   But my college ask me “Do you know Oracle, it has connect 
pool to queue the request, so you needn’t open so much connects. Does 
PostgreSQL has such function?”

 

 Does anybody know something about it? Please tell me. 

Thanks



 MARK



Re: [GENERAL] Connecting performance

2006-12-20 Thread mike
Sounds like pgpool. http://pgpool.projects.postgresql.org/

On Thu, 2006-12-21 at 12:01 +0800, 马庆 wrote:
 Dear :
 
  These days, I come across a problem that I can’t solve i , so
 I ask U for help.
 
  Problem Description:
 
I use RedHat AS 4 + PostgreSQL 8.1 as our server.
 As long as the server program starts, it’ll immediately open 10~20
 connects to the DB to handle the request.
 
But my college ask me “Do you know Oracle, it has
 connect pool to queue the request, so you needn’t open so much
 connects. Does PostgreSQL has such function?”
 
  
 
  Does anybody know something about it? Please tell me. 
 
 Thanks
 
 
 MARK
 
 


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


Re: [GENERAL] Connecting via ssh tunnel

2006-11-27 Thread Weerts, Jan
Hi all!

[EMAIL PROTECTED] wrote:
 On Friday 24 November 2006 12:56, ben short wrote:
 I have a postgresql server setup on a Solaris 10 box. I can
 connect to the db via psql from the local machine. What I have
 been trying to do it connect with pgAdmin from my workstation. I
 have setup the tunnel correctly, local port 5432 and destination
 localhost:5432. Everytime I try to connect I get the following
 message. 
 
 I guess the tunnel isn't correct. You connect on the same ports -
 seems wrong to me. I'm using a tunnel like this:
 
 ssh -l user -L :localhost:5432 servername

actually 
  ssh -l USER -L 5432:localhost:5432 SOMEOTHERHOSTTHANLOCALHOST

is ok. the localhost part is evaluated on the SOMEOTHERHOST
and dns lookup is done there. I have been bitten by this before.
If SOMEOTHERHOST is the same host, this would obviously not
work, since the ssh tunnel and the postgres server cannot
listen on the same port.

I am not sure if the error message you are seeing is the same
one you would get when a connection is impossible. To me it
looks like a connection was initiated by the server closed
it.

Regards
  Jan

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


Re: [GENERAL] Connecting via ssh tunnel

2006-11-27 Thread ben short

Ok I have fixed it.

My port fowarding was fine but i needed to set AllowTcpForwarding to
yes in sshd_config.

Ben

On 11/27/06, Weerts, Jan [EMAIL PROTECTED] wrote:

Hi all!

[EMAIL PROTECTED] wrote:
 On Friday 24 November 2006 12:56, ben short wrote:
 I have a postgresql server setup on a Solaris 10 box. I can
 connect to the db via psql from the local machine. What I have
 been trying to do it connect with pgAdmin from my workstation. I
 have setup the tunnel correctly, local port 5432 and destination
 localhost:5432. Everytime I try to connect I get the following
 message.

 I guess the tunnel isn't correct. You connect on the same ports -
 seems wrong to me. I'm using a tunnel like this:

 ssh -l user -L :localhost:5432 servername

actually
  ssh -l USER -L 5432:localhost:5432 SOMEOTHERHOSTTHANLOCALHOST

is ok. the localhost part is evaluated on the SOMEOTHERHOST
and dns lookup is done there. I have been bitten by this before.
If SOMEOTHERHOST is the same host, this would obviously not
work, since the ssh tunnel and the postgres server cannot
listen on the same port.

I am not sure if the error message you are seeing is the same
one you would get when a connection is impossible. To me it
looks like a connection was initiated by the server closed
it.

Regards
  Jan



---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org/


Re: [GENERAL] Connecting via ssh tunnel

2006-11-27 Thread Uwe C. Schroeder
On Monday 27 November 2006 02:38, Weerts, Jan wrote:
 Hi all!

 [EMAIL PROTECTED] wrote:
  On Friday 24 November 2006 12:56, ben short wrote:
  I have a postgresql server setup on a Solaris 10 box. I can
  connect to the db via psql from the local machine. What I have
  been trying to do it connect with pgAdmin from my workstation. I
  have setup the tunnel correctly, local port 5432 and destination
  localhost:5432. Everytime I try to connect I get the following
  message.
 
  I guess the tunnel isn't correct. You connect on the same ports -
  seems wrong to me. I'm using a tunnel like this:
 
  ssh -l user -L :localhost:5432 servername

 actually
   ssh -l USER -L 5432:localhost:5432 SOMEOTHERHOSTTHANLOCALHOST

 is ok. the localhost part is evaluated on the SOMEOTHERHOST
 and dns lookup is done there. I have been bitten by this before.
 If SOMEOTHERHOST is the same host, this would obviously not
 work, since the ssh tunnel and the postgres server cannot
 listen on the same port.

Thinking about it I agree that this would work, unless you have postgresql 
running on localhost (which is the case in my installation)


Uwe

--
Open Source Solutions 4U, LLC   1618 Kelly St
Phone:  +1 707 568 3056 Santa Rosa, CA 95401
Cell:   +1 650 302 2405 United States
Fax:+1 707 568 6416

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org/


Re: [GENERAL] Connecting via ssh tunnel

2006-11-27 Thread Jim Nasby

On Nov 24, 2006, at 2:56 PM, ben short wrote:

I have a postgresql server setup on a Solaris 10 box. I can connect to
the db via psql from the local machine. What I have been trying to do
it connect with pgAdmin from my workstation. I have setup the tunnel
correctly, local port 5432 and destination localhost:5432. Everytime I
try to connect I get the following message.

2006-11-24 20:42:48 ERROR  : Error connecting to the server: server
closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

I havent altered the config files, so postgresql should be listening
on localhost.


I *think* that's pointing at a pg_hba.conf issue; is there anything  
in the logs?


Send *exact details* of how you're setting this up and someone might  
be able to help further...

--
Jim Nasby[EMAIL PROTECTED]
EnterpriseDB  http://enterprisedb.com  512.569.9461 (cell)



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


[GENERAL] Connecting via ssh tunnel

2006-11-24 Thread ben short

Hi,

I have a postgresql server setup on a Solaris 10 box. I can connect to
the db via psql from the local machine. What I have been trying to do
it connect with pgAdmin from my workstation. I have setup the tunnel
correctly, local port 5432 and destination localhost:5432. Everytime I
try to connect I get the following message.

2006-11-24 20:42:48 ERROR  : Error connecting to the server: server
closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

I havent altered the config files, so postgresql should be listening
on localhost.

Any one got any ideas?

Ben

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


Re: [GENERAL] Connecting via ssh tunnel

2006-11-24 Thread Leonel Nunez
 Hi,

 I have a postgresql server setup on a Solaris 10 box. I can connect to
 the db via psql from the local machine. What I have been trying to do
 it connect with pgAdmin from my workstation. I have setup the tunnel
 correctly, local port 5432 and destination localhost:5432. Everytime I
 try to connect I get the following message.

 2006-11-24 20:42:48 ERROR  : Error connecting to the server: server
 closed the connection unexpectedly
   This probably means the server terminated abnormally
   before or while processing the request.

 I havent altered the config files, so postgresql should be listening
 on localhost.


on solaris :

telnet localhost 5432   does connect ?

 Any one got any ideas?

 Ben

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



leonel



---(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: [GENERAL] Connecting via ssh tunnel

2006-11-24 Thread Tom Lane
ben short [EMAIL PROTECTED] writes:
 I have a postgresql server setup on a Solaris 10 box. I can connect to
 the db via psql from the local machine. What I have been trying to do
 it connect with pgAdmin from my workstation. I have setup the tunnel
 correctly, local port 5432 and destination localhost:5432.

Surely that is not a correct tunnel setup ... you can't have both ends
being the same port number on the same machine.  There Can Be Only One
process listening on a given port per machine.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org/


Re: [GENERAL] Connecting via ssh tunnel

2006-11-24 Thread Uwe C. Schroeder
On Friday 24 November 2006 12:56, ben short wrote:
 Hi,

 I have a postgresql server setup on a Solaris 10 box. I can connect to
 the db via psql from the local machine. What I have been trying to do
 it connect with pgAdmin from my workstation. I have setup the tunnel
 correctly, local port 5432 and destination localhost:5432. Everytime I
 try to connect I get the following message.

I guess the tunnel isn't correct. You connect on the same ports - seems wrong 
to me. I'm using a tunnel like this:

ssh -l user -L :localhost:5432 servername

and then connect psql on the client machine with

psql -h localhost -p  -U user dbname


Uwe


--
Open Source Solutions 4U, LLC   1618 Kelly St
Phone:  +1 707 568 3056 Santa Rosa, CA 95401
Cell:   +1 650 302 2405 United States
Fax:+1 707 568 6416

---(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: [GENERAL] Connecting via ssh tunnel

2006-11-24 Thread Ray Stell
On Fri, Nov 24, 2006 at 04:42:56PM -0500, Tom Lane wrote:
 
 Surely that is not a correct tunnel setup ... you can't have both ends
 being the same port number on the same machine.  There Can Be Only One
 process listening on a given port per machine.


I think he is refering the -L option of ssh that specifies that the given
port on the local (client) host is to be forwarded to the given host and
port on the remote side.  I do this on a test web server all the time:
-L8080:localhost:8080 If I enter the url localhost:8080 in the browser
it is forwarded on to the remote via the ssh tunnel.

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[GENERAL] Connecting to another postgres DB from pg/SQL

2006-11-23 Thread Szymanski, Michal (GE Money)
During execution of  PL/pgSQL procedure I have to send somehow few date to 
another Postgress database. Is to possible to connect 
to other database , if yes what is performance of such solution? Is it possible 
to create DB link between two Postgres application?

Michał Szymański


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] Connecting to another postgres DB from pg/SQL

2006-11-23 Thread Shoaib Mir

You can use the dblink (
http://developer.postgresql.org/cvsweb.cgi/pgsql/contrib/dblink/) contrib
module for that purpose.

Thanks,

Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 11/22/06, Szymanski, Michal (GE Money) [EMAIL PROTECTED] wrote:


During execution of  PL/pgSQL procedure I have to send somehow few date to
another Postgress database. Is to possible to connect
to other database , if yes what is performance of such solution? Is it
possible to create DB link between two Postgres application?

Michał Szymański


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq



[GENERAL] Connecting to PostgreSQL Server

2006-09-24 Thread Lukasz

Hello,

I installed a postgresql server on one of the machine in my network with 
an example IP 192.168.254.102. I have no problem to connect to the 
server from this machine, but when I want to have access to pgsql server 
from other pc with an example IP 192.168.254.105 it says that I have no 
access to database and it suggests adding this line to pg_hba.conf file:


host all all 192.168.0.0/24 md5

Even when I add it, the error is the same.

My pga_hba file looks like this:
# TYPE  DATABASEUSERCIDR-ADDRESS  METHOD

# IPv4 local connections:
hostall all 127.0.0.1/32  md5
# IPv6 local connections:
#hostall all ::1/128   md5
host all all 192.168.0.0/24  md5

The beginning of the postgresql.conf:

listen_addresses = '*'  # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all

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


Re: [GENERAL] Connecting to PostgreSQL Server

2006-09-24 Thread viniciusasousa

I am brazilian and have write dificility ,but code pg_hba is:
host all all 192.168.254.105/32  md5

and after reload configuration.


Belê!


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] Connecting to PostgreSQL Server

2006-09-24 Thread Shane Ambler
On 21/9/2006 18:36, Lukasz [EMAIL PROTECTED] wrote:

 Hello,
 
 I installed a postgresql server on one of the machine in my network with
 an example IP 192.168.254.102. I have no problem to connect to the
 server from this machine, but when I want to have access to pgsql server
 from other pc with an example IP 192.168.254.105 it says that I have no
 access to database and it suggests adding this line to pg_hba.conf file:
 
 host all all 192.168.0.0/24 md5

That is a generic message and doesn't match your network config.

Change the 192.168.0.0/24 to 192.168.254.0/24 (assuming your netmask is
255.255.255.0) to allow any computer on your local network to connect or
192.168.254.105/32 to allow the one example computer to connect.

 
 Even when I add it, the error is the same.
 
 My pga_hba file looks like this:
 # TYPE  DATABASEUSERCIDR-ADDRESS  METHOD
 
 # IPv4 local connections:
 hostall all 127.0.0.1/32  md5
 # IPv6 local connections:
 #hostall all ::1/128   md5
 host all all 192.168.0.0/24 md5
 
 The beginning of the postgresql.conf:
 
 listen_addresses = '*'# what IP address(es) to listen on;
 # comma-separated list of addresses;
 # defaults to 'localhost', '*' = all
 
 ---(end of broadcast)---
 TIP 5: don't forget to increase your free space map settings
 

-- 

Shane Ambler
[EMAIL PROTECTED]

Get Sheeky @ http://Sheeky.Biz


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


[GENERAL] Connecting to PostgreSQL on Linux with windows

2006-05-12 Thread mmaclennan
Hi, I have a linux box (Fedora 3) running the latest version of
PostgreSQL and PostGIS. I am trying connect to the database through a
windows computer but can't seem to make the connection work. I've
configured the pb_hba.config file in the usr directory to as host
all all 192.168.1.0/24md5 but it doesn't seem
to work.

I know these are the correct settings because I installed PostgreSQL on
a windows based machine and can access that version no problem with the
aformentioned settings. Can a windows machine connect to a Linux
version of Postgresql if so what am I doing wrong?


---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] Connecting to PostgreSQL on Linux with windows

2006-05-12 Thread chris smith

On 10 May 2006 07:46:01 -0700, mmaclennan [EMAIL PROTECTED] wrote:

Hi, I have a linux box (Fedora 3) running the latest version of
PostgreSQL and PostGIS. I am trying connect to the database through a
windows computer but can't seem to make the connection work. I've
configured the pb_hba.config file in the usr directory to as host
all all 192.168.1.0/24md5 but it doesn't seem
to work.

I know these are the correct settings because I installed PostgreSQL on
a windows based machine and can access that version no problem with the
aformentioned settings. Can a windows machine connect to a Linux
version of Postgresql if so what am I doing wrong?


What exactly doesn't work ? Do you get an error message? Does it time out? ...

--
Postgresql  php tutorials
http://www.designmagick.com/

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


Re: [GENERAL] Connecting to PostgreSQL on Linux with windows

2006-05-12 Thread Tom Lane
mmaclennan [EMAIL PROTECTED] writes:
 Hi, I have a linux box (Fedora 3) running the latest version of
 PostgreSQL and PostGIS. I am trying connect to the database through a
 windows computer but can't seem to make the connection work. I've
 configured the pb_hba.config file in the usr directory to as host
 all all 192.168.1.0/24md5 but it doesn't seem
 to work.

As already noted, providing no more detail than doesn't seem to work
is a good way to guarantee you won't get any useful responses.  I'll
suggest two likely possibilities though:

* you forgot to start the postmaster with the option to make it listen
for TCP connections (tcpip_socket or listen_addresses depending on PG
vintage)

* you've got the kernel firewall configured in a way that doesn't let
through any packets to port 5432.  (I believe this is default on most
RHEL/Fedora versions :-()

regards, tom lane

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


  1   2   >