[GENERAL] RowDescription via the SQL?

2016-06-01 Thread Dmitry Igrishin
Hi, It's possible to query pg_prepared_statements view to obtain the information about parameters used in the statement that was prepared. But I don't found how to get the information about the rows that will be returned when the statement is eventually executed. (It's possible to get this informa

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-01 Thread Patrick Baker
> > >> > I maybe be missing it, but I see no LIMIT in the function. > > I do see OFFSET and it looks backwards to me?: > > || $1 ||' offset '|| > > https://www.postgresql.org/docs/9.5/static/sql-select.html > > LIMIT Clause > > The LIMIT clause consists of two independent sub-clauses: > > LIMIT { c

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-01 Thread Adrian Klaver
On 06/01/2016 05:10 PM, Patrick Baker wrote: Hi guys, I need a function ( PL/PGSQL ) to perform a deletion of some BLOBS... I have four tables: *- original_table1_b =* Original table, where the BLOBS are *- table1_n_b =* Table where everything related to the BLOBS is stored (file_i

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-01 Thread David G. Johnston
On Wednesday, June 1, 2016, Patrick Baker wrote: > > >> >> ​I'd suggest you setup a test environment with some unimportant data on a >> non-production machine and try it yourself. >> ​ >> ​​ >> >> David J. >> ​ >> >> >> > Thanks.. but if I'm asking the list that's because I'm already testing it >

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-01 Thread Patrick Baker
> > > ​I'd suggest you setup a test environment with some unimportant data on a > non-production machine and try it yourself. > ​ > ​​ > > David J. > ​ > > > Thanks.. but if I'm asking the list that's because I'm already testing it and it's not working... ;) Patrick

Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 8:10 PM, Patrick Baker wrote: > Hi guys, > > I need a function ( PL/PGSQL ) to perform a deletion of some BLOBS... > > ​[...] ​ > When I will call the function: *select function_1_name(5000) or **select > function_1_name(15000)* will it respect the limited by the rows? >

[GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-01 Thread Patrick Baker
Hi guys, I need a function ( PL/PGSQL ) to perform a deletion of some BLOBS... I have four tables: *- original_table1_b =* Original table, where the BLOBS are > *- table1_n_b =* Table where everything related to the BLOBS is stored > (file_id, account_id, note_id, etc) > *- table2_y_b =* Table B

Re: [GENERAL] postgres_fdw and Kerberos authentication

2016-06-01 Thread Jean-Marc Lessard
Stephen Frost [sfr...@snowman.net] wrote: > The database owner operating system user has to be trusted, along with any > superusers in the database, but if you assume those, then having PG manage > the different Kerberos cache files > (one for each backend which has authenticated via Kerberos an

Re: [GENERAL] Slides for PGCon2016; "FTS is dead ? Long live FTS !"

2016-06-01 Thread Kaare Rasmussen
On 2016-05-31 13:24, Stefan Keller wrote: > We chose RUM just because there are GIN and VODKA :) > But some people already suggested several meanings like Really Useful iMdex :) > We are open for suggestion. So I propose: "Ranking UMdex" ;-) How about "Russian Unbelievable Magic"? Or just

Re: [GENERAL] Checkpoint Err on Startup of Rsynced System

2016-06-01 Thread Jim Longwill
Jeff Janes, Ok. I checked this further and just found that the pg_xlog area is symlinked to another area.. and indeed that other area was not being rsynced (!) and I thought it was. So, I just fixed this, re-ran it and now it is working. Now I believe I have a stable postgres running on M2.

Re: [GENERAL] Checkpoint Err on Startup of Rsynced System

2016-06-01 Thread Jeff Janes
On Tue, May 31, 2016 at 10:13 AM, Jim Longwill wrote: > I am trying to setup a 2nd, identical, db server (M2) for development and > I've run into a problem with starting up the 2nd Postgres installation. > > Here's what I've done: > 1) did a 'clone' of 1st (production) machine M1 (so both machin

Re: [GENERAL] Row security policies documentation question

2016-06-01 Thread Alexander M. Sauer-Budge
> On May 31, 2016, at 7:48 PM, Adrian Klaver wrote: > > For a good review of what is possible with RLS take a look at this blog: > > http://blog.2ndquadrant.com/application-users-vs-row-level-security/ > Fantastic! Thanks!

Re: [GENERAL] Row security policies documentation question

2016-06-01 Thread Alexander M. Sauer-Budge
> On May 31, 2016, at 5:16 PM, David G. Johnston > wrote: > > On Tue, May 31, 2016 at 4:59 PM, Alexander M. Sauer-Budge > mailto:ambu...@alum.mit.edu>> wrote: > Hello, > > Section 5.7. on Row Security Policies > (https://www.postgresql.org/docs/current/static/ddl-rowsecurity.html >

Re: [GENERAL] Switching roles as an replacement of connection pooling tools

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 9:56 AM, Tom Lane wrote: > "David G. Johnston" writes: > > ​Would a scheme whereby you basically only get to SET ROLE one time work? > > Basically the connection layer logs in and immediately SET SESSION > > AUTHORIZATION AND SET ROLE [WITH SETTINGS?] to another role. For

Re: [GENERAL] Switching roles as an replacement of connection pooling tools

2016-06-01 Thread Tom Lane
"David G. Johnston" writes: > ​Would a scheme whereby you basically only get to SET ROLE one time work? > Basically the connection layer logs in and immediately SET SESSION > AUTHORIZATION AND SET ROLE [WITH SETTINGS?] to another role. For all > intents and purposes the session now looks as if

Re: [GENERAL] Switching roles as an replacement of connection pooling tools

2016-06-01 Thread David G. Johnston
On Wed, Jun 1, 2016 at 8:59 AM, CN wrote: > On Tue, May 31, 2016, at 10:20 PM, Tom Lane wrote: > > There's also a bunch of issues having to do with the fact that the > > semantics of SET SESSION AUTHORIZATION are defined by the SQL standard > > and don't exactly match what you'd want, in many cas

Re: [GENERAL] Switching roles as an replacement of connection pooling tools

2016-06-01 Thread CN
On Tue, May 31, 2016, at 10:23 PM, Melvin Davidson wrote: > That being said, IMHO, I believe having a separate schema for every > user is poor database design This is the best arrangement I can think of now for my use case: 1. Each schema holds an application independent from other schemas

Re: [GENERAL] Switching roles as an replacement of connection pooling tools

2016-06-01 Thread CN
On Tue, May 31, 2016, at 10:20 PM, Tom Lane wrote: > There's also a bunch of issues having to do with the fact that the > semantics of SET SESSION AUTHORIZATION are defined by the SQL standard > and don't exactly match what you'd want, in many cases, for "become > this other role". Some of them in

Re: [GENERAL] postgres_fdw and Kerberos authentication

2016-06-01 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Jean-Marc Lessard writes: > > A nice way to meet security requirements would be to provide single sign on > > support for the postgres_fdw. > > As long as you have defined a user in the source and destination databases, > > and configure the Kerberos auth

Re: [GENERAL] [HACKERS] Change in order of criteria - reg

2016-06-01 Thread Amit Langote
On 2016/06/01 13:07, sri harsha wrote: > Hi, > > In PostgreSQL , does the order in which the criteria is given matter ?? > For example > > Query 1 : Select * from TABLE where a > 5 and b < 10; > > Query 2 : Select * from TABLE where b <10 and a > 5; > > Are query 1 and query 2 the same in P