[GENERAL] postgres_fdw how to pushdown parent table's JOIN

2016-07-24 Thread 德哥
PostgreSQL continued in sharding technology fdw based roots, the 9.6 Subject to the conditions set, and JOIN support SORT pushed down to the data node execution. Here is a test Create several shard databases for subfix in 0 1 2 3 do psql -c "create database db $ subfix" done Create a master d

[GENERAL] Database and Table stats gets reset automatically

2016-07-24 Thread Sameer Kumar
Hi, I have PostgreSQL v9.4.4 running in my environment. It has been up for over 2 years now. I noticed that suddenly the statistics have been reset and all the stat tables/columns got restarted from. This happened 2 weeks ago. I noticed only recently after I looked at the plot over last week (whi

Re: [GENERAL] Return results of join with polymorphically-defined table in pl/pgsql

2016-07-24 Thread John R Pierce
On 7/24/2016 4:45 PM, Peter Devoy wrote: However, I would like to create a function which returns the resultset of an INNER JOIN with table1 being polymorphic and table2 being a result set of column types which do not change. Is this possible? SQL tables are /not/ polymorphic. -- john r pie

Re: [GENERAL] Return results of join with polymorphically-defined table in pl/pgsql

2016-07-24 Thread David G. Johnston
On Sunday, July 24, 2016, Peter Devoy wrote: > > However, I would like to create a function which returns the resultset > of an INNER JOIN with table1 being polymorphic and table2 being a > result set of column types which do not change. Is this possible? > Providing a concrete example might hel

[GENERAL] Return results of join with polymorphically-defined table in pl/pgsql

2016-07-24 Thread Peter Devoy
Hi list The example at the bottom of this (http://stackoverflow.com/questions/11740256/11751557#11751557) answer shows how the anyelement polymorphic type can be used to have a function accept -- and return rows from -- an arbitrary table decided by the user at runtime. However, I would like to c

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread Tom Lane
Melvin Davidson writes: > I am not so sure another extension is needed. Would it not make more sense > just to use the dblink extension? That would be a quick-n-dirty fix, but it would give up all the guarantees NOTIFY provides about messages being sent if and only if the sending transaction comm

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread Tom Lane
Mehran Ziadloo writes: > What I meant was that the notifications are received by the client > connectionsas if it was generated within their corresponding database (let's > name thedatabase with a client connection listening to it; DB_C), then a > notification generated by a NOTIFY command with

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread Sylvain Marechal
I understand that: 1) you like to use postgres as a "bus" to transfer messages between connected clients; 2) only one database server is concerned (no redundancy at all); 3) it is the client code (perl, php ...) that send the notification (ie, notifications are not sent by triggers for example) M

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread Melvin Davidson
On Sun, Jul 24, 2016 at 9:35 AM, Adrian Klaver wrote: > On 07/24/2016 03:31 AM, Mehran Ziadloo wrote: > >> I'm sorry, you are right. Let me rephrase that. >> >> What I meant was that the notifications are received by the client >> connections >> as if it was generated within their corresponding d

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread Adrian Klaver
On 07/24/2016 03:31 AM, Mehran Ziadloo wrote: I'm sorry, you are right. Let me rephrase that. What I meant was that the notifications are received by the client connections as if it was generated within their corresponding database (let's name the database with a client connection listening to i

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread Mehran Ziadloo
I'm sorry, you are right. Let me rephrase that. What I meant was that the notifications are received by the client connectionsas if it was generated within their corresponding database (let's name thedatabase with a client connection listening to it; DB_C), then a notification generated by a NOT

Re: [GENERAL] A simple extension immitating pg_notify

2016-07-24 Thread John R Pierce
On 7/23/2016 8:24 PM, Mehran Ziadloo wrote: I'm looking for a way to send notifications from within one database to another. As if pg_notify accepted a database name, or even to all of the databases. So far I could not find a way to do so. Then someone told me that I need to implement this featu