Re: [GENERAL] Row level security policy - calling function for right hand side value of 'in' in using_expression

2017-02-02 Thread Tom Lane
Jong-won Choi writes: > I have a RLS policy definition like: > CREATE POLICY promoter_policy ON Agency > USING (promoter in build_valid_promoter_list()) > WITH CHECK (promoter in build_valid_promoter_list()); That's failing basic SQL expression

[GENERAL] Row level security policy - calling function for right hand side value of 'in' in using_expression

2017-02-02 Thread Jong-won Choi
I have a RLS policy definition like: CREATE POLICY promoter_policy ON Agency USING (promoter in build_valid_promoter_list()) WITH CHECK (promoter in build_valid_promoter_list()); The build_valid_promoter_list function definition is: CREATE OR REPLACE FUNCTION

Re: [GENERAL] Average - Pg 9.2

2017-02-02 Thread David G. Johnston
On Thursday, February 2, 2017, Patrick B wrote: > Hi guys, > > I've got a table which has id and created date columns. > > I want to get the average of inserted rows monthly. > How can I get this data? > > This query is not working as it is showing me same data in both

[GENERAL] Average - Pg 9.2

2017-02-02 Thread Patrick B
Hi guys, I've got a table which has id and created date columns. I want to get the average of inserted rows monthly. How can I get this data? This query is not working as it is showing me same data in both columns. select created_date, AVG(id) OVER(ORDER BY created_date) AS avr from test

Re: [GENERAL] Synchronous Commit, WAL archiving and statement_timeout

2017-02-02 Thread Michael Paquier
On Fri, Feb 3, 2017 at 2:15 AM, JP Jacoupy wrote: > I expected the statement to timeout because the synchronous_commit wouldn't > work since the Slave is down while rollbacking on the Master. Queries being stuck because of synchronous replication are already committed

Re: [GENERAL] Synchronous Commit, WAL archiving and statement_timeout

2017-02-02 Thread Adrian Klaver
On 02/02/2017 09:15 AM, JP Jacoupy wrote: Hello, I noticed something strange and I would like to understand what's happening. I have the following environment: - 2 PostgreSQL instance running in hot-standby with synchronous commit activated. There have been many changes in replication

Re: [GENERAL] pgbouncer increase pool_size, reload does not work

2017-02-02 Thread Adrian Klaver
On 02/02/2017 03:27 AM, alexanderfelipewo wrote: hello! i have a question for pgbouncer in case someone has faced this and there is a solution available. i have a db with pgbouncer where the pool_size is set to 50 (i ve noticed this using both session/transaction modes). Sometimes there are

Re: [GENERAL] pgbouncer increase pool_size, reload does not work

2017-02-02 Thread Jehan-Guillaume de Rorthais
On Thu, 2 Feb 2017 04:27:45 -0700 (MST) alexanderfelipewo wrote: > hello! > > i have a question for pgbouncer in case someone has faced this and there is > a solution available. > > i have a db with pgbouncer where the pool_size is set to 50 (i ve noticed > this

[GENERAL] Synchronous Commit, WAL archiving and statement_timeout

2017-02-02 Thread JP Jacoupy
Hello, I noticed something strange and I would like to understand what's happening. I have the following environment: - 2 PostgreSQL instance running in hot-standby with synchronous commit activated. (further called Master & Slave) - The archiving of the WAL files is activated on the master

[GENERAL] pgbouncer increase pool_size, reload does not work

2017-02-02 Thread alexanderfelipewo
hello! i have a question for pgbouncer in case someone has faced this and there is a solution available. i have a db with pgbouncer where the pool_size is set to 50 (i ve noticed this using both session/transaction modes). Sometimes there are waiting sessions b/c more than 50 want to execute sth

Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread John R Pierce
On 2/2/2017 12:13 PM, PAWAN SHARMA wrote: For testing i have created > > 1:create user user1; 2:create user user2; 3:create group dba_group; > 4:grant dba_group to user1; 5:ALTER group dba_group CREATEDB > CREATEROLE; > > > but still user1 don't have createdb and createrole privilege, even he

Re: [GENERAL] Fastest simple key-value store, multiple writers, like Redis?

2017-02-02 Thread Nicolas Paris
Le 02 févr. 2017 à 20:00, Rob Nikander écrivait : > Hi, > > I'm working on a project with multiple different data storage backends. I'd > like to consolidate and use Postgres for more things. In one new situation > we're starting to use Redis, thinking it will perform better than Postgres for > a

Re: [GENERAL] Fastest simple key-value store, multiple writers, like Redis?

2017-02-02 Thread Khalil Khamlichi
You can keep using redis and use FDW to access it as if it was a postgres table. It does read and write to redis and can present redis data as regular tables to you. I never really had to choose between redis and postgres. Postgres was always for safety and persistance and redis for sharing data

[GENERAL] Re: PSQL 9.5 select for update locks too many rows when using numeric instead of int

2017-02-02 Thread Sfiligoi, Igor
Uhm... maybe I misinterpreted the results. Looking better, the root cause seems to be that the query planner is not using the index, resorting to a seq scan instead. OK... that makes more sense. Sorry for the bogus email. Igor From: pgsql-general-ow...@postgresql.org

[GENERAL] PSQL 9.5 select for update locks too many rows when using numeric instead of int

2017-02-02 Thread Sfiligoi, Igor
Dear PSQL team. I just found a weird problem. When I pass a numeric type to a select for update statement, it locks loads of rows, instead of a single one! See explains below. Is this a known bug (in 9.5)? Any chance it was fixed in a more recent release? Thanks, Igor Note: My table has

Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread PAWAN SHARMA
On Fri, Feb 3, 2017 at 12:47 AM, John R Pierce wrote: > On 2/2/2017 11:09 AM, PAWAN SHARMA wrote: > > > 1: Create User > 2:Create group > 3:Alter Group Add/Remove User's.. > > > create user user1; > create user user2; > create group group1; > grant group1 to

Consider pgmodeler - Re: [GENERAL] Data Modeling Tools - Version specific to Postgres

2017-02-02 Thread James Bullock
On 02/01/2017 01:35 PM, Greg Slawek wrote: > > Can anyone recommend a data modeling tool (preferably Mac OSX compatible)? > > I would like to be sure it can export version specific SQL code (ie 9.1 vs > 9.4) > I'm very happy with pgmodeler, which I picked up about 6-8 weeks ago. It's an open

Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread John R Pierce
On 2/2/2017 11:09 AM, PAWAN SHARMA wrote: 1: Create User 2:Create group 3:Alter Group Add/Remove User's.. create user user1; create user user2; create group group1; grant group1 to user1, user2; in fact in postgres, both users and groups are roles, the only distinction is in

Re: [GENERAL] Fastest simple key-value store, multiple writers, like Redis?

2017-02-02 Thread Simon Riggs
On 2 February 2017 at 19:00, Rob Nikander wrote: > I'm working on a project with multiple different data storage backends. I'd > like to consolidate and use Postgres for more things. In one new situation > we're starting to use Redis, thinking it will perform better than

Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread PAWAN SHARMA
On Fri, Feb 3, 2017 at 12:08 AM, John R Pierce wrote: > On 2/2/2017 8:24 AM, Moreno Andreo wrote: > > > Can we use AD(Active Directory) groups concepts in postgres as we are > using this concepts in SQL server. > > So, is there any possible to work with AD groups such as

[GENERAL] Fastest simple key-value store, multiple writers, like Redis?

2017-02-02 Thread Rob Nikander
Hi, I'm working on a project with multiple different data storage backends. I'd like to consolidate and use Postgres for more things. In one new situation we're starting to use Redis, thinking it will perform better than Postgres for a table that is updated a lot by concurrent background jobs.

Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread John R Pierce
On 2/2/2017 8:24 AM, Moreno Andreo wrote: Can we use AD(Active Directory) groups concepts in postgres as we are using this concepts in SQL server. So, is there any possible to work with AD groups such as (IT-DBA, IT-APPS..etc ) in postgresql. Like this?

Re: [GENERAL] (solved) R: Very strange problem on index

2017-02-02 Thread Alban Hertroys
On 2 February 2017 at 14:57, Job wrote: > Hi Raymond, > > Thank nyou for your appreciated feedback. But what's your answer to his question? You still didn't tell. > Here is the original message: > > i really strange problem, quite near to paranormal, is occurring

Re: [SPAM] [GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread Moreno Andreo
Hi Pawan, Il 02/02/2017 16:49, PAWAN SHARMA ha scritto: Hi All,

[GENERAL] AD(Active Directory) groups concepts in postgres

2017-02-02 Thread PAWAN SHARMA
Hi All, Can we use AD(Active Directory) groups concepts in postgres as we are using this concepts in SQL server. So, is there any possible to work with AD groups such as (IT-DBA, IT-APPS..etc ) in postgresql. -Pawan

Re: [GENERAL] Avoiding repeating simple field definitions

2017-02-02 Thread John R Pierce
On 2/2/2017 7:20 AM, Guyren Howe wrote: I saw a thing somewhere about avoiding repeating the same field definitions. So an app I’m working on uses an exactly 6-character sting as an identifier, which appears in many places. are you talking about data normalization ?

Re: [GENERAL] Avoiding repeating simple field definitions

2017-02-02 Thread Adrian Klaver
On 02/02/2017 07:20 AM, Guyren Howe wrote: I saw a thing somewhere about avoiding repeating the same field definitions. So an app I’m working on uses an exactly 6-character sting as an identifier, which appears in many places. The thing would be? Can you show an example of the 6 character

[GENERAL] Avoiding repeating simple field definitions

2017-02-02 Thread Guyren Howe
I saw a thing somewhere about avoiding repeating the same field definitions. So an app I’m working on uses an exactly 6-character sting as an identifier, which appears in many places. IIRC, the thing I read proposed defining a type AS IMPLICIT, but I’m not sure. Mainly because the docs urge

R: [GENERAL] (solved) R: Very strange problem on index

2017-02-02 Thread Job
Hi Raymond, Thank nyou for your appreciated feedback. Here is the original message: i really strange problem, quite near to paranormal, is occurring during a server migration. We have a table with some millions of record, perfectly working on other Postgresql 9.6.1 machines:

Re: [GENERAL] (solved) R: Very strange problem on index

2017-02-02 Thread Raymond O'Donnell
On 02/02/17 12:53, Job wrote: I create a table copy, with indexes, and it worked perfecly. Then i dropped the original table and recreated it back by a copy of the newest. Same problems, lack during searches and indexes not used. I didn't see your original message so may have missed this,

[GENERAL] (solved) R: Very strange problem on index

2017-02-02 Thread Job
I create a table copy, with indexes, and it worked perfecly. Then i dropped the original table and recreated it back by a copy of the newest. Same problems, lack during searches and indexes not used. I restart Postgresql 9.6.1 engine and now index is working perfectly! Maybe a cache or

[GENERAL] Very strange problem on index

2017-02-02 Thread Job
Hi guys, i really strange problem, quite near to paranormal, is occurring during a server migration. We have a table with some millions of record, perfectly working on other Postgresql 9.6.1 machines: Table "public.webrecord" Column | Type