Re: [GENERAL] pg_restore real file size

2016-02-25 Thread John R Pierce
On 2/25/2016 8:26 PM, drum.lu...@gmail.com wrote: I'm doing the pg_restore now in a 1.5TB file: *# ls -la* postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql But, the restore has gone over 1.6 TB the dump file does not contain the indexes, just CREATE INDEX statements -- john r pi

[GENERAL] pg_restore real file size

2016-02-25 Thread drum.lu...@gmail.com
Hi all, I'm doing the pg_restore now in a 1.5TB file: *# ls -la* postgres postgres 1575324616939 Feb 20 13:55 devdb_0.sql But, the restore has gone over 1.6 TB *# \l+* 1639 GB How is that even possible? *pg_restore command:* /usr/pgsql-9.2/bin/pg_restore -d dbname --exit-on-error --jobs

Re: [GENERAL] Privileges granted on dblink extension function do not survive database dump and restore

2016-02-25 Thread Joe Conway
On 02/25/2016 03:42 PM, Bryan Ellerbrock wrote: > Hi, I'm first time mailing-list user with a problem. I'm working on a > UTF8 encoded database using psql (9.5.1, server 9.4.6) > > I've implemented a very large materialized view to speed up certain > search queries. I need to give users the abilit

[GENERAL] Privileges granted on dblink extension function do not survive database dump and restore

2016-02-25 Thread Bryan Ellerbrock
Hi, I'm first time mailing-list user with a problem. I'm working on a UTF8 encoded database using psql (9.5.1, server 9.4.6) I've implemented a very large materialized view to speed up certain search queries. I need to give users the ability to start a concurrent refresh on demand, without waiting

[GENERAL] Oracle conversion questions - TYPE's and ARRAY's

2016-02-25 Thread CS DBA
All; We are running an Oracle conversion via ora2pg the TYPE's come out like this: CREATE OR REPLACE TYPE "CUST_ARRAY_TBL" as table of varchar2(4000); or CREATE OR REPLACE TYPE "STRTAB" as table of varchar2(4000 char); The sqlplus code wants to use these types as array's like this: BEGIN

Re: [GENERAL] How Restricting user

2016-02-25 Thread dangal
Joshua thank you very much , my knowledge does not allow me to do what you explained to me !! Something can be interesting for inclusion in future versions -- View this message in context: http://postgresql.nabble.com/How-Restricting-user-tp5889240p5889298.html Sent from the PostgreSQL - genera

Re: [GENERAL] How Restricting user

2016-02-25 Thread Joshua D. Drake
On 02/25/2016 10:09 AM, Daniel Gallo wrote: thanks a lot David It wouldn't be hard to create a limiting system in user space however. It would be a little obnoxious but it can be done. For example connect_time and idle_time are relatively easy to implement with a proper session handler i

Re: [GENERAL] How Restricting user

2016-02-25 Thread Daniel Gallo
thanks a lot David 2016-02-25 15:08 GMT-03:00 David G. Johnston : > On Thu, Feb 25, 2016 at 11:01 AM, dangal > wrote: > >> In Oracle i have something like this: >> >> -- Create profile >> create profile PROFILE_Query limit >> sessions_per_user 25 >> cpu_per_call 3 >> connect_time

Re: [GENERAL] How Restricting user

2016-02-25 Thread David G. Johnston
On Thu, Feb 25, 2016 at 11:01 AM, dangal wrote: > In Oracle i have something like this: > > -- Create profile > create profile PROFILE_Query limit > sessions_per_user 25 > cpu_per_call 3 > connect_time 120 > idle_time 20 > logical_reads_per_session 8 > logical_reads_per_call

Re: [GENERAL] How Restricting user

2016-02-25 Thread dangal
In Oracle i have something like this: -- Create profile create profile PROFILE_Query limit sessions_per_user 25 cpu_per_call 3 connect_time 120 idle_time 20 logical_reads_per_session 8 logical_reads_per_call 25000; -- Add users to profile alter user XXX profile PROFILE_Quer

Re: [GENERAL] How Restricting user

2016-02-25 Thread Adrian Klaver
On 02/25/2016 07:50 AM, David G. Johnston wrote: ​Some yes, some no. Read up on GRANT. Most of the resource stuff cannot be accomplished within PostgreSQL. No clue what you mean by "logical reads". From what I gather a logical read is one that pulls from cache versus off the disk: https:/

Re: [GENERAL] How Restricting user

2016-02-25 Thread David G. Johnston
​Some yes, some no. Read up on GRANT. Most of the resource stuff cannot be accomplished within PostgreSQL. No clue what you mean by "logical reads". Dave ​ On Thu, Feb 25, 2016 at 5:08 AM, Daniel Gallo wrote: > Dear , I would like to make a query , I plan to create a user in my > database ,

Re: [GENERAL] 2x Time difference between first and subsequent run of the same query on fresh established connection (on linux, with perf data included, all query data in the shared buffers) on postgre

2016-02-25 Thread Andres Freund
Hi, On 2016-02-25 13:50:11 +1100, Maxim Boguk wrote: > The first run (something fishy with kernel calls): > 19,60% postgres [kernel.kallsyms] [k] filemap_map_pages > 15,86% postgres postgres [.] hash_search_with_hash_value >8,20% postgres postgres [.] heap_hot_se

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-25 Thread Adrian Klaver
On 02/25/2016 01:58 AM, Karsten Hilbert wrote: On Wed, Feb 24, 2016 at 04:12:22PM -0800, Adrian Klaver wrote: This works fine, the application (GNUmed) ensures INSERTS and UPDATES do the right thing with .is_ongoing and .ts_end. Now the following sequence happens: - insert row with .is_ongoin

Re: [GENERAL] CTE and function

2016-02-25 Thread David G. Johnston
On Thu, Feb 25, 2016 at 3:31 AM, Gerhard Wiesinger wrote: > > > = NOT OK: > > ==

Re: [GENERAL] CTE and function

2016-02-25 Thread Ben Primrose
This is my understanding, hopefully someone will chime in if I'm off. Using EXECUTE, the SQL is executed in a separate context than the current statement. So it's checking for a table with the name you pass, not aliases within the current statement. Giving the function another parameter to allow

Re: [GENERAL] Replaying xlogs from beginning

2016-02-25 Thread otheus uibk
> You're assuming that the only significant aspect of initdb's output that can vary from run to run is the database system ID. I prefer to call it "optimistic prediction". But yes. :) > If you're lucky this technique will work, but it's not reliable and not supported. You really need to take an

[GENERAL] How Restricting user

2016-02-25 Thread Daniel Gallo
Dear , I would like to make a query , I plan to create a user in my database , but only to make inquires , I would also like to have limits such as connection time, idle time , logical reads , is this possible? Thank you very much for your time

Re: [GENERAL] pgDay Asia / talks / lightning talks

2016-02-25 Thread Sameer Kumar
On Tue, Feb 16, 2016 at 7:43 PM Daniel Pocock wrote: > > > Hi, > > Is this the place to ask questions about pgDay Asia[1] or is there > another mailing list for it? The mailing list link on the pgDay Asia > web site just takes me to a marketing list[2]. The seasiapug list[3] > looks very quiet.

[GENERAL] CTE and function

2016-02-25 Thread Gerhard Wiesinger
Hello, I'm trying to convert a select after a CTE into a function for generic use. The CTE is normally a complex query but I want to capsulate then the calculation of the Gini coefficient it into a function: Based on: http://www.heckler.com.br/blog/2010/06/15/gini-coeficient-having-fun-in-both

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-25 Thread Karsten Hilbert
On Wed, Feb 24, 2016 at 05:24:44PM -0700, David G. Johnston wrote: > ​Then you must record the "INSERT/UPDATE time" into the table, as a > constant, and refer to that value instead of having "now()" which happens > to be correct at the time of the insert/update but is not correct at any > future p

Re: [GENERAL] check constraint problem during COPY while pg_upgrade-ing

2016-02-25 Thread Karsten Hilbert
On Wed, Feb 24, 2016 at 04:12:22PM -0800, Adrian Klaver wrote: > >This works fine, the application (GNUmed) ensures INSERTS and > >UPDATES do the right thing with .is_ongoing and .ts_end. > > > >Now the following sequence happens: > > > >- insert row with .is_ongoing=true and .ts_end=tomorrow() >