Re: Connection issue

2019-02-06 Thread Ricardo Martin Gomez
Hi,
Can you read the event viewer?

Obtener Outlook para Android


From: Adrian Klaver 
Sent: Wednesday, February 6, 2019 1:43:24 PM
To: Maximilian Tyrtania
Cc: Ricardo Martin Gomez; pgsql-general@lists.postgresql.org
Subject: Re: Connection issue

On 2/6/19 8:30 AM, Maximilian Tyrtania wrote:
> Hi again,
>
>
>> On 6. Feb 2019, at 17:19, Adrian Klaver  wrote:
>>
>> On 2/6/19 7:18 AM, Maximilian Tyrtania wrote:
>>> Well, the problem being a Parallels issue is just a wild theory of mine, it 
>>> could well be something else. Honstly I don't recall updating anything in 
>>> that area. As Mr. Gomez suggested I tried to
>>
>> So from a previous post:
>>
>>> Have you recently updated any of the involved software?
>>
>> Well, sure, but after I saw I couldn't connect ...
>>
>> So what happened in the interval between the time you could connect and the 
>> time you could not?
>
> I did update parts of my app (including the plugin which in turn encapsulates 
> libpq). I did not update my parallels installation, as far as I remember. 
> Sorry if I was unclear about that.

What is the plugin?

Can you roll back the plugin upgrade to see if that is the problem?


>
>>> ping - worked
>>> telnet - did not work (infact I couldn't telnet anywhere)
>>
>> In my experience telnet is generally disabled these days.
>
> I had to enable it on my Windows box, if that's what you mean. The "telnet" 
> command works by itself, but I didnt receive anything when trying to telnet 
> to some other machine.
>

Probably because Telnet is not enabled on the server as it is not a
secure protocol:
https://en.wikipedia.org/wiki/Telnet

>
> Ah, thanks for digging that up. Hmm, sounds as if something is definetly 
> wrong on my windows box.
>
> I'll try contacting the Parallels support guys.
>
> Thanks again,
>
> Max
>


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


How to find out tables that are frequently read/ write?

2019-02-06 Thread Jason W
Apologize first because I am not familiar with database. So I probably did not 
find the right doc before posting my question.

I received a chart which is plotted by X - date, and Y - throughput (M/ sec). 
It shows that recently (after N Jan) the read/ write throughput was increased 
drastically.

So I lookup on the internet, finding doc like [1] points out that some pg_X 
tables, such as pg_stat_user_tables, looks like can be used to check such 
stats. For instance,

   SELECT schemaname, relname, idx_tup_fetch + seq_tup_read as total_read
  FROM pg_stat_user_tables
WHERE idx_tup_fetch is not NULL and idx_tup_fetch + seq_tup_read != 0
ORDER BY total_read desc
 LIMIT 10;

Is this a correct way to find tables frequently being read? If not what's a 
better way to achieve this? And how about write? Or any other docs that I 
should read as well?

I appreciate any suggestions, thanks.

[1]. https://www.postgresql.org/docs/current/monitoring-stats.html

Re: Implementing an expanded object in C

2019-02-06 Thread Michel Pelletier
Thanks Andrew, sorry for my late reply it took me a while to get time to
analyze the issue.

You are of course correct, I had confusion around the create type
statement, but the good news is, I have figured out the final ins and outs
of creating an expanded type, and my matrix type can now be used as
variables plpgsql functions and works great!  Thanks to you and Tom and
everyone else who helped me get unblocked and making progress.

-Michel

On Sun, Jan 27, 2019 at 7:14 PM Andrew Gierth 
wrote:

> > "Michel" == Michel Pelletier  writes:
>
>  Michel> Replying to my own problem here, I guess this was a situation
>  Michel> where explaining it in detail revealed the problem to me. By
>  Michel> specifying my type is 'passedbyvalue'
>
> That cannot possibly be appropriate.
>
>  Michel> CREATE TYPE matrix (
>  Michel> internallength = 8,
>
> Your type is clearly not a fixed-length type, because fixed-length types
> cannot have expanded datums. A fixed-length type must contain its entire
> representation within the fixed length - it is not allowed to be a
> pointer to something else.
>
> --
> Andrew (irc:RhodiumToad)
>


Re: Connection issue

2019-02-06 Thread Adrian Klaver

On 2/6/19 8:30 AM, Maximilian Tyrtania wrote:

Hi again,



On 6. Feb 2019, at 17:19, Adrian Klaver  wrote:

On 2/6/19 7:18 AM, Maximilian Tyrtania wrote:

Well, the problem being a Parallels issue is just a wild theory of mine, it 
could well be something else. Honstly I don't recall updating anything in that 
area. As Mr. Gomez suggested I tried to


So from a previous post:


Have you recently updated any of the involved software?


Well, sure, but after I saw I couldn't connect ...

So what happened in the interval between the time you could connect and the 
time you could not?


I did update parts of my app (including the plugin which in turn encapsulates 
libpq). I did not update my parallels installation, as far as I remember. Sorry 
if I was unclear about that.


What is the plugin?

Can you roll back the plugin upgrade to see if that is the problem?





ping - worked
telnet - did not work (infact I couldn't telnet anywhere)


In my experience telnet is generally disabled these days.


I had to enable it on my Windows box, if that's what you mean. The "telnet" 
command works by itself, but I didnt receive anything when trying to telnet to some other 
machine.



Probably because Telnet is not enabled on the server as it is not a 
secure protocol:

https://en.wikipedia.org/wiki/Telnet



Ah, thanks for digging that up. Hmm, sounds as if something is definetly wrong 
on my windows box.

I'll try contacting the Parallels support guys.

Thanks again,

Max




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



Re: Connection issue

2019-02-06 Thread Adrian Klaver

On 2/6/19 7:18 AM, Maximilian Tyrtania wrote:

Well, the problem being a Parallels issue is just a wild theory of mine, it 
could well be something else. Honstly I don't recall updating anything in that 
area. As Mr. Gomez suggested I tried to


So from a previous post:

> Have you recently updated any of the involved software?

Well, sure, but after I saw I couldn't connect ...

So what happened in the interval between the time you could connect and 
the time you could not?




ping - worked
telnet - did not work (infact I couldn't telnet anywhere)


In my experience telnet is generally disabled these days.


tracert - worked

from my windows 10 box (didn't bother to check on my Mac as I have noc issues there). 
Still curious as to why the server would say "Connection reset by peer".


Well if you are running Windows --> Parallels --> OS X(Mac) --> Serve, 
you are effectively testing the Mac also.


As to 'Connection reset by peer':

A grep of the Postgres source find this:

interfaces/libpq/win32.c

* Contains table and functions for looking up win32 socket error
* descriptions. But will/may contain other win32 helper functions
* for libpq.


WSAECONNRESET, "Connection reset by peer"

Looking up WSAECONNRESET finds this:

https://docs.microsoft.com/en-us/windows/desktop/WinSock/windows-sockets-error-codes-2


WSAECONNRESET
10054

Connection reset by peer.
An existing connection was forcibly closed by the remote host. This 
normally results if the peer application on the remote host is suddenly 
stopped, the host is rebooted, the host or remote network interface is 
disabled, or the remote host uses a hard close (see setsockopt for more 
information on the SO_LINGER option on the remote socket). This error 
may also result if a connection was broken due to keep-alive activity 
detecting a failure while one or more operations are in progress. 
Operations that were in progress fail with WSAENETRESET. Subsequent 
operations fail with WSAECONNRESET.




Thanks, Max




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