PostgresSQL 10 on remote server - Socket is not connected (0x00002749/10057)

2020-01-22 Thread Tanja Savic
Hi,

I’m running a pgAdmin from Windows 10 :
pgAdmin  Version: 4.17
Python Version: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 
bit (Intel)]

and I’m able to connect to the remote server. I can see schemas and tables, but 
when I want to run a query I get this error:

could not send data to server: Socket is not connected (0x2749/10057) could 
not send SSL negotiation packet: Socket is not connected (0x2749/10057)

Running queries on local DB instance is ok, error happens only when I connect 
to the remote server.
DB Version : PostgresSQL 10.10

I do not remember doing some changes that could cause this error. Is there any 
solution for this problem, cause I didn’t googled out any?

Thank you for you time.
Best,
Tanja




RE: PostgresSQL 10 on remote server - Socket is not connected (0x00002749/10057)

2020-01-24 Thread Tanja Savic
Hi,

Thank you for your replies.

I can connect to remote server using psql and it works normally, I can do the 
select, function calls..

But in pgAdmin, even SELECT 1 doesn't work.

Also, the weirdest thing is that it actually worked for a brief moment, because 
I logged using pgAdmin and created some simple function  which I can call 
without a problem when I'm logged using psql.
But to call it from pgAdmin, it gives me the error again (Socket is not 
connected (0x2749/10057))

BR,
Tanja


-Original Message-
From: Adrian Klaver  
Sent: Wednesday, January 22, 2020 5:15 PM
To: Tanja Savic ; 
pgsql-general@lists.postgresql.org
Subject: Re: PostgresSQL 10 on remote server - Socket is not connected 
(0x2749/10057)

On 1/22/20 2:18 AM, Tanja Savic wrote:
> Hi,
> 
> I'm running a pgAdmin from Windows 10 :
> 
> pgAdmin Version: 4.17
> 
> Python Version:**3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC
> v.1916 32 bit (Intel)]
> 
> and I'm able to connect to the remote server. I can see schemas and 
> tables, but when I want to run a query I get this error:
> 
> could not send data to server: Socket is not connected
> (0x2749/10057) could not send SSL negotiation packet: Socket is 
> not connected (0x2749/10057)

What are the connection settings?

What is the query that fails?

Can you connect to the remote using psql?

> 
> Running queries on local DB instance is ok, error happens only when I 
> connect to the remote server.
> 
> DB Version : PostgresSQL 10.10
> 
> I do not remember doing some changes that could cause this error. Is 
> there any solution for this problem, cause I didn't googled out any?
> 
> Thank you for you time.
> 
> Best,
> 
> Tanja
> 


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




RE: PostgresSQL 10 on remote server - Socket is not connected (0x00002749/10057)

2020-01-27 Thread Tanja Savic
Hi,

I reset tcpip stack but didn't work, same error and behavior.


Tanja

-Original Message-
From: Adrian Klaver  
Sent: Friday, January 24, 2020 5:30 PM
To: Tanja Savic ; 
pgsql-general@lists.postgresql.org
Subject: Re: PostgresSQL 10 on remote server - Socket is not connected 
(0x2749/10057)

On 1/24/20 2:31 AM, Tanja Savic wrote:
> Hi,
> 
> Thank you for your replies.
> 
> I can connect to remote server using psql and it works normally, I can do the 
> select, function calls..
> 
> But in pgAdmin, even SELECT 1 doesn't work.
> 
> Also, the weirdest thing is that it actually worked for a brief moment, 
> because I logged using pgAdmin and created some simple function  which I can 
> call without a problem when I'm logged using psql.
> But to call it from pgAdmin, it gives me the error again (Socket is 
> not connected (0x2749/10057))

 From the pgAdmin issue tracker(you will need Postgres community account to see 
below):

https://redmine.postgresql.org/issues/4970

The relevant part:

"An error occured opening the socket after Windows Update from 17.09 to
19.09:

could not send data to server: Socket is not connected
(0x2749/10057) could not send startup packet. Socket is not connected 
(0x2749/10057)

"

"There is discussion here on this - 
https://answers.microsoft.com/en-us/windows/forum/windows_10-networking/some-programsapps-unable-to-connect-after-windows/689f7204-63fa-4f03-857a-3e4b0ff7d0ce
One of the solution was to reset tcpip stack. I would suggest you to try 
it once.
Kindly let us know if it fixed for you."

There was no response from the issue submitter so I assume the above worked.

> 
> BR,
> Tanja
> 



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


pg_ctl can't start db server

2020-05-29 Thread Tanja Savic
Hi,

We did the upgrade of PostgreSQL 10 to 12 on linux server. Everything was fine 
(can connect via pgAdmin, data is there...) except two tablespaces which are 
still in directory for PostgreSQL 10.
So we followed these steps to move tablespaces: 
https://www.enterprisedb.com/blog/moving-tablespaces-postgresql
The problem was at the end while executing:
$ pg_ctl start

This is the error trace:

pg_ctl: another server might be running; trying to start server anyway
waiting for server to startpostgres: could not access the server 
configuration file "/var/lib/postgresql/12/main/postgresql.conf": No such file 
or directory
stopped waiting
pg_ctl: could not start server
Examine the log output.

The configuration file path is /etc/postgresql/12/main/ postgresql.conf and it 
is configured in /var/lib/postgresql/12/main/postmaster.opts:

"/usr/lib/postgresql/12/bin/postgres "-D" "/var/lib/postgresql/12/main" "-c" 
"config_file=/etc/postgresql/12/main/postgresql.conf"

Why does pg_ctl complains about the postgresql.conf path?


Thank you,
Tanja



RE: pg_ctl can't start db server

2020-06-01 Thread Tanja Savic
Hi,

@Tom Adding -D in command worked. I just used 
pg_ctl start -D [data-directory ]

PGDATA was not set permanently although I tried to set it (with postgres user):
export PGDATA=" /var/lib/postgresql/12/main"

@Adrian It's Ubuntu and output of pg_lsclusters was this:
12  main24538 online postgres /var/lib/postgresql/12/main 
/var/log/postgresql/postgresql-12-main.log

Thank you for your replies.
BR,
Tanja

-Original Message-
From: Tom Lane  
Sent: Friday, May 29, 2020 5:32 PM
To: Tanja Savic 
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pg_ctl can't start db server

Tanja Savic  writes:
> The configuration file path is /etc/postgresql/12/main/ postgresql.conf and 
> it is configured in /var/lib/postgresql/12/main/postmaster.opts:

> "/usr/lib/postgresql/12/bin/postgres "-D" "/var/lib/postgresql/12/main" "-c" 
> "config_file=/etc/postgresql/12/main/postgresql.conf"

> Why does pg_ctl complains about the postgresql.conf path?

I don't remember the exact interaction between -D and an explicit config_file 
setting, but evidently it's not working the way you wish.
See

https://www.postgresql.org/docs/current/runtime-config-file-locations.html

which suggests that you should use -D to point at the directory where 
postgresql.conf is, and set the data directory with a parameter within 
postgresql.conf.

(Note that pg_ctl probably only understands this way, even though theoretically 
the postmaster can deal with other approaches to setting up an external config 
file.)

regards, tom lane




Move configuration files with pg_upgrade

2020-06-04 Thread Tanja Savic
Hello,

I did Postgresql upgrade from v10 to v12 using pg_upgrade (on Linux Ubuntu 
server).
Of course i wanted settings in pg_hba.conf and postgresql.conf to keep, but 
after the upgrade there were new configuration files and I moved it manually.

Is it possible somehow to migrate these old
configuration files with pg_upgrade or it shall be done manually?

Cheers,
Tanja