Re: Using pg Admin to create backups and restore them

2018-07-04 Thread Łukasz Jarych
Thank you Adrian , Best, Jacek wt., 3 lip 2018 o 15:23 Adrian Klaver napisał(a): > On 07/03/2018 04:44 AM, Łukasz Jarych wrote: > > Hi Guys, > > > > it is possible to use pgadmin 4 to run pgdump from query tool? > > pg_dump is a client program in pgAdmin4 you can run it from here: > >

Re: Return select statement with sql case statement

2018-07-04 Thread David G. Johnston
On Wednesday, July 4, 2018, Ron wrote: > > Ah, didn't notice that. Then... dynamic sql constructed by the > programming language executing the query? > That, the UNION idea, or pull the common stuff into the from clause and write two left joins then coalesce whichever one provided the row. In

Re: Cloning schemas

2018-07-04 Thread Melvin Davidson
On Wed, Jul 4, 2018 at 2:48 PM, DiasCosta wrote: > Hi Melvin, > > I'm new to clone_schema. > Can I use it on PostgreSQL 9.6? > > TIA > DCostaployment by invitation only! > > Can I use it on PostgreSQL 9.6? Yes, but because the developer(s) once again monkeyed with the system catalogs, there are

Re: Cloning schemas

2018-07-04 Thread Adrian Klaver
On 07/04/2018 03:53 PM, Melvin Davidson wrote: The problem is, AFAICS, none of the changes induced were really necessary or increased performance. The folks that wanted transactional ALTER SEQUENCE might disagree:): https://www.postgresql.org/docs/10/static/release-10.html "Move

Re: Return select statement with sql case statement

2018-07-04 Thread Ron
On 07/04/2018 10:32 AM, hmidi slim wrote: Actually, I need the use of case because based on the numberOfPremiumDays there are different type of treatment: select numberOfPremiumDays             case  when numberOfPremiumDays = date_part('day', ('2018-11-05'::timestamp) -

Re: Cloning schemas

2018-07-04 Thread Melvin Davidson
On Wed, Jul 4, 2018 at 6:48 PM, Adrian Klaver wrote: > On 07/04/2018 03:38 PM, Melvin Davidson wrote: > >> >> >> On Wed, Jul 4, 2018 at 2:48 PM, DiasCosta > > wrote: >> >> Hi Melvin, >> >> I'm new to clone_schema. >> Can I use it on PostgreSQL 9.6? >>

Re: Cloning schemas

2018-07-04 Thread Łukasz Jarych
>From link function is not working. czw., 5 lip 2018 o 07:49 Łukasz Jarych napisał(a): > Hi Melvin. > > folks wrote only that it is old version and didnt care :) > > Tahnk you very much, > Best, > Jacek > > czw., 5 lip 2018 o 01:09 Melvin Davidson > napisał(a): > >> >> >The folks that wanted

Re: Cloning schemas

2018-07-04 Thread Łukasz Jarych
Hi Melvin. folks wrote only that it is old version and didnt care :) Tahnk you very much, Best, Jacek czw., 5 lip 2018 o 01:09 Melvin Davidson napisał(a): > > >The folks that wanted transactional ALTER SEQUENCE might disagree:): > Ah, so you mean the previous version was not working or

Re: Return select statement with sql case statement

2018-07-04 Thread Adrian Klaver
On 07/04/2018 03:03 PM, Ron wrote: On 07/04/2018 10:32 AM, hmidi slim wrote: Actually, I need the use of case because based on the numberOfPremiumDays there are different type of treatment: select numberOfPremiumDays             case  when numberOfPremiumDays = date_part('day',

Re: Return select statement with sql case statement

2018-07-04 Thread Ron
On 07/04/2018 05:08 PM, Adrian Klaver wrote: On 07/04/2018 03:03 PM, Ron wrote: On 07/04/2018 10:32 AM, hmidi slim wrote: Actually, I need the use of case because based on the numberOfPremiumDays there are different type of treatment: select numberOfPremiumDays             case  when

Re: Cloning schemas

2018-07-04 Thread Adrian Klaver
On 07/04/2018 03:38 PM, Melvin Davidson wrote: On Wed, Jul 4, 2018 at 2:48 PM, DiasCosta > wrote: Hi Melvin, I'm new to clone_schema. Can I use it on PostgreSQL 9.6? TIA DCostaployment by invitation only! > Can I use it on PostgreSQL

Re: Cloning schemas

2018-07-04 Thread Melvin Davidson
>The folks that wanted transactional ALTER SEQUENCE might disagree:): Ah, so you mean the previous version was not working or sufficient? https://www.postgresql.org/docs/9.6/static/sql-altersequence.html -- *Melvin Davidson* *Maj. Database & Exploration Specialist* *Universe Exploration Command

Re: Parallel Aware

2018-07-04 Thread jbrant
You're not alone - I have the same issue on PostgreSQL 10.3, even with "force_parallel_mode" enabled and a query plan that includes bitmap heap scans (which should be parallelizable). -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Return select statement with sql case statement

2018-07-04 Thread hmidi slim
Hi, I need to use conditional expression in my query, So I want to make a query like this: select numberOfPremiumDays case when numberOfPremiumDays = date_part('day', ('2018-11-05'::timestamp) - ('2018-11-01'::timestamp)) then select product_id, price

Re: Postgres sometimes stalling on 'percentile_cont'

2018-07-04 Thread Tom Lane
Tom van Tilburg writes: > I have a set of relatively complex queries producing tables (including > postgis and pgpointcloud functions) that I run consecutively, and sometimes > (depending on the base-data) my 5th query stalls (CPU 100%, runs forever) > seemingly on the percentile_cont function.

Re: Unable to Connect to DB Instance

2018-07-04 Thread Tom Lane
Boblitz John writes: > 2. Users reported messages similar to "could not open file > "global/11801": No such file or directory" I'd try "select relname from pg_class where pg_relation_filenode(oid) = 11801" to see if you can identify the problematic relation that way. If you're lucky,

Re: Unable to Connect to DB Instance

2018-07-04 Thread Adrian Klaver
On 07/04/2018 04:08 AM, Boblitz John wrote: Good Morning, Beginning yesterday morning, users have been unable to fully connect to our DB Instance. 1.At the time of the initial report – I was connected to the DB via pgAdmin and could perform queries without problem.

Re: pg_dump out of memory

2018-07-04 Thread Andy Colson
On 07/04/2018 12:31 AM, David Rowley wrote: On 4 July 2018 at 14:43, Andy Colson wrote: I moved a physical box to a VM, and set its memory to 1Gig. Everything runs fine except one backup: /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep g_dump: Dumping the contents of

Postgres sometimes stalling on 'percentile_cont'

2018-07-04 Thread Tom van Tilburg
Hi, I have a set of relatively complex queries producing tables (including postgis and pgpointcloud functions) that I run consecutively, and sometimes (depending on the base-data) my 5th query stalls (CPU 100%, runs forever) seemingly on the percentile_cont function. *When I replace

Re: Return select statement with sql case statement

2018-07-04 Thread Ron
On 07/04/2018 07:48 AM, hmidi slim wrote: Hi, I need to use conditional expression in my query, So I want to make a query like this: select numberOfPremiumDays             case  when numberOfPremiumDays = date_part('day', ('2018-11-05'::timestamp) - ('2018-11-01'::timestamp)) then            

Re: Cloning schemas

2018-07-04 Thread Łukasz Jarych
Hi Melvin, thank you very much. Awesome!!! Best, Jacek wt., 3 lip 2018 o 15:34 Melvin Davidson napisał(a): > > > >> ERROR: BŁĄD: you cannot add to column "TopoToVersion_ID" DETAIL: Column >> "TopoToVersion_ID" is an identity column defined as GENERATED ALWAYS. HINT: >> Use OVERRIDING SYSTEM

Re: Cloning schemas

2018-07-04 Thread Melvin Davidson
On Wed, Jul 4, 2018 at 2:27 PM, Łukasz Jarych wrote: > Hi Melvin, > > > > Best, > Jacek > > > wt., 3 lip 2018 o 15:34 Melvin Davidson napisał(a): > >> >> >> >>> ERROR: BŁĄD: you cannot add to column "TopoToVersion_ID" DETAIL: Column >>> "TopoToVersion_ID" is an identity column defined as

Re: Cloning schemas

2018-07-04 Thread DiasCosta
Hi Melvin, I'm new to clone_schema. Can I use it on PostgreSQL 9.6? TIA DCosta On 03-07-2018 14:34, Melvin Davidson wrote: ERROR: BŁĄD: you cannot add to column "TopoToVersion_ID" DETAIL: Column "TopoToVersion_ID" is an identity column defined as GENERATED ALWAYS. HINT: Use

Re: Unable to Connect to DB Instance

2018-07-04 Thread Tom Lane
Boblitz John writes: > Thanks - I get "pg_db_role_setting" as a response. Hm ... not its index? If the table itself is gone, it's surprising that you can get through session startup. > I have already attempted to reindex system but get: I had in mind just reindexing the specific table you're

RE: Unable to Connect to DB Instance

2018-07-04 Thread Boblitz John
Hello Tom, Thanks - I get "pg_db_role_setting" as a response. I have already attempted to reindex system but get: NOTICE: table "pg_catalog.pg_class" was reindexed NOTICE: table "pg_catalog.pg_statistic" was reindexed NOTICE: table "pg_catalog.pg_type" was reindexed NOTICE: table

Re: Return select statement with sql case statement

2018-07-04 Thread legrand legrand
Hello, sorry your description is not clear ... why do you use a GROUP BY on product without aggregation function min, max, sum ? where is defined numberOfPremiumDays ? may be using UNION can solve your problem: select numberOfPremiumDays,

Re: Unable to Connect to DB Instance

2018-07-04 Thread Adrian Klaver
On 07/04/2018 12:36 PM, Tom Lane wrote: Boblitz John writes: Thanks - I get "pg_db_role_setting" as a response. Hm ... not its index? If the table itself is gone, it's surprising that you can get through session startup. I have already attempted to reindex system but get: I had in mind