duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index" while performing full vacuum on the database

2018-05-09 Thread Raghavendra Rao J S V
Hi, While performing vacuum full, I have received the below highlighted error. Please guide me how to resolve this issue. ​/opt/postgres/9.2/bin/psql -p 5433 --username=cmuser cpcm -c "*VACUUM FULL ANALYZE*;" ERROR: *duplicate key value violates unique constraint "pg_statistic_relid_att_in

Enhancement to psql command, feedback.

2018-05-09 Thread John McKown
I just wanted to throw this out to the users before I made a complete fool of myself by formally requesting it. But I would like what I hope would be a minor change (enhancement) to the psql command. If you look on this page, https://wiki.postgresql.org/wiki/Shared_Database_Hosting , you will see a

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Pavel Stehule
2018-05-09 9:59 GMT+02:00 John McKown : > I just wanted to throw this out to the users before I made a complete fool > of myself by formally requesting it. But I would like what I hope would be > a minor change (enhancement) to the psql command. If you look on this page, > https://wiki.postgresql.

partition table query allocate much memory

2018-05-09 Thread tao tony
hi guys, I'm not sure it was a bug,but a query on partition table allocate nearly 100GB memory is not normal.pid :119775 as below [cid:part1.2A42CFAD.715BF014@outlook.com] SQL: SELECT DISTINCT etl_source,gid FROM zh_erp.buy2 WHERE gid NOT IN (SELECT gid FROM zh_erp.goodsh); I had modified th

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Matt Zagrabelny
On Wed, May 9, 2018 at 3:05 AM, Pavel Stehule wrote: > > > 2018-05-09 9:59 GMT+02:00 John McKown : > >> I just wanted to throw this out to the users before I made a complete >> fool of myself by formally requesting it. But I would like what I hope >> would be a minor change (enhancement) to the p

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Ron
On 05/09/2018 02:59 AM, John McKown wrote: I just wanted to throw this out to the users before I made a complete fool of myself by formally requesting it. But I would like what I hope would be a minor change (enhancement) to the psql command. If you look on this page, https://wiki.postgresql.or

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Adrian Klaver
On 05/08/2018 06:12 PM, chandru.ar...@yahoo.com wrote: I installed PostgreSQL using PostgreSQL-9.5.12-1-win64-bigsql on a Windows 10 system.  I installed as a local admin.  The installation completed fine, although it failed earlier when I tried to install it as non-admin of the laptop. When

Re: Enhancement to psql command, feedback.

2018-05-09 Thread John McKown
On Wed, May 9, 2018 at 3:05 AM, Pavel Stehule wrote: > > > 2018-05-09 9:59 GMT+02:00 John McKown : > >> I just wanted to throw this out to the users before I made a complete >> fool of myself by formally requesting it. But I would like what I hope >> would be a minor change (enhancement) to the p

Re: issues when installing postgres

2018-05-09 Thread Adrian Klaver
On 05/08/2018 05:54 PM, Antonio Silva wrote: Hello! Comments inline. I bought a new computer and I installed Ubuntu 18.04 and after PostgreSQL. sudo apt install postgresql postgresql-contrib pgadmin3 Are you using the Ubuntu or Postgres repos? Nevertheless I had some issues with configu

Re: Enhancement to psql command, feedback.

2018-05-09 Thread John McKown
On Wed, May 9, 2018 at 8:17 AM, Ron wrote: > On 05/09/2018 02:59 AM, John McKown wrote: > > I just wanted to throw this out to the users before I made a complete fool > of myself by formally requesting it. But I would like what I hope would be > a minor change (enhancement) to the psql command. I

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Stephen Frost
Greetings, * John McKown (john.archie.mck...@gmail.com) wrote: > Again, this is just a discussion point. And I'm quite willing to admit > defeat if most people don't think that it is worth the effort. For my 2c, at least, I do think it'd be kind of neat to have, but we'd need a fool-proof way to

Re: Enhancement to psql command, feedback.

2018-05-09 Thread David G. Johnston
On Wed, May 9, 2018 at 6:44 AM, John McKown wrote: > Again, this is just a discussion point. And I'm quite willing to admit > defeat if most people don't think that it is worth the effort. > ​-1, at least per the example. I would not want "-U postgres" inside the file. I tend to rely on servic

Re: Enhancement to psql command, feedback.

2018-05-09 Thread John McKown
On Wed, May 9, 2018 at 8:56 AM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, May 9, 2018 at 6:44 AM, John McKown > wrote: > >> Again, this is just a discussion point. And I'm quite willing to admit >> defeat if most people don't think that it is worth the effort. >> > > ​-1, a

Re: Enhancement to psql command, feedback.

2018-05-09 Thread John McKown
On Wed, May 9, 2018 at 8:52 AM, Stephen Frost wrote: > Greetings, > > * John McKown (john.archie.mck...@gmail.com) wrote: > > Again, this is just a discussion point. And I'm quite willing to admit > > defeat if most people don't think that it is worth the effort. > > For my 2c, at least, I do thi

Re: Enhancement to psql command, feedback.

2018-05-09 Thread David G. Johnston
On Wed, May 9, 2018 at 7:17 AM, John McKown wrote: > > However, in the second case, the "magic" first line causes psql, at > present, to report an error and abort. This is why I'd like to modify how > the file referenced via the -f argument is processed. That is, the first > line of any file refe

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Tom Lane
Stephen Frost writes: > Greetings, > * John McKown (john.archie.mck...@gmail.com) wrote: >> Again, this is just a discussion point. And I'm quite willing to admit >> defeat if most people don't think that it is worth the effort. > For my 2c, at least, I do think it'd be kind of neat to have, but

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Christopher Browne
On Wed, 9 May 2018 at 04:00, John McKown wrote: > To me this looks similar to a UNIX shell script. Now, going sideways for a second, if someone wanted to create a "self contained" awk script. It would look something like: > #!/bin/awk -f > ... awk code ... I have found it convenient when Lisp im

RE: Error creating plpython3u extension

2018-05-09 Thread Bruce Harold
Thank you Adrian and Jeff. I made some progress and can extend databases with plpython3u. Re. the edb doc, "C:\edb\LanguagePack-10\x64\Python-3.4\bin" does not exist, stripping 'bin' off the path is required. Setting PYTHONHOME for the system is unfriendly to the rest of my python dependencies

RE: Error creating plpython3u extension

2018-05-09 Thread Bruce Harold
It seems my cheap hack doesn't work, the server connection breaks on CREATE FUNCTION unless PYTHONHOME is set for the system. -Original Message- From: Bruce Harold Sent: Wednesday, May 9, 2018 9:46 AM To: 'Adrian Klaver' ; pgsql-general@lists.postgresql.org Subject: RE: Error creating p

Re: Enhancement to psql command, feedback.

2018-05-09 Thread David G. Johnston
On Wed, May 9, 2018 at 9:04 AM, Christopher Browne wrote: > On Wed, 9 May 2018 at 04:00, John McKown > wrote: > > To me this looks similar to a UNIX shell script. Now, going sideways for > a second, if someone wanted to create a "self contained" awk script. It > would look something like: > > >

Why is my Postgre server went in recovery mode all in sudden

2018-05-09 Thread nikhil raj
Hi Team, I dont have any idea why did my Postgres server crash and it says timestamp=2018-05-07 00:34:11.209 EDT,user=,db=,app=,client=, transaction-ID=0,session_start_timestamp=2018-04-26 10:08:19 EDT,SQL_state=0LOG: worker process: parallel worker for PID 2864 (PID 4476) exited with exit c

Re: Enhancement to psql command, feedback.

2018-05-09 Thread Jan Claeys
On Wed, 2018-05-09 at 08:36 -0500, John McKown wrote: > On Wed, May 9, 2018 at 3:05 AM, Pavel Stehule > wrote: > > These languages has defined # as line comment. It is not true for > > SQL. > > Thanks, that looks like a "NO" vote to me. > Not necessarily. There are other languages which don'

Re: duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index" while performing full vacuum on the database

2018-05-09 Thread Laurenz Albe
Raghavendra Rao J S V wrote: > While performing vacuum full, I have received the below highlighted error. > Please guide me how to resolve this issue. > > > /opt/postgres/9.2/bin/psql -p 5433 --username=cmuser cpcm -c "VACUUM FULL > ANALYZE;" > > > ERROR: duplicate key value violates uniqu

Re: issues when installing postgres

2018-05-09 Thread Antonio Silva
Hello Adrian Are you using the Ubuntu or Postgres repos? > I'm using the Ubuntu repos Can you connect to Postgres using psql? > No I cannot Thanks Antonio 2018-05-09 10:36 GMT-03:00 Adrian Klaver : > On 05/08/2018 05:54 PM, Antonio Silva wrote: > >> Hello! >> >> > Comments inline. > > I boug

Re: pg_stat_statements : how to catch non successfully finished statements ?

2018-05-09 Thread legrand legrand
Hello, Here is a patch that : - adds a new guc: pg_stat_statements.track_errors boolean (default to true), - capture of DML, DDL, PL/PGSQL commands in error into pgss. There is always a risk that new code used in PG_CATCH (mainly pgss_store) gives an error. I'm not able to tell when it could occ

Re: Error creating plpython3u extension

2018-05-09 Thread Adrian Klaver
On 05/09/2018 10:38 AM, Bruce Harold wrote: It seems my cheap hack doesn't work, the server connection breaks on CREATE FUNCTION unless PYTHONHOME is set for the system. Yeah, pretty sure the server is not looking at the environment that pgAdmin4 is running in as that is not part of the core.

Re: Why is my Postgre server went in recovery mode all in sudden

2018-05-09 Thread Adrian Klaver
On 05/09/2018 11:31 AM, nikhil raj wrote: Hi Team, I dont have any idea why did my Postgres server crash and it says timestamp=2018-05-07 00:34:11.209 EDT,user=,db=,app=,client=,transaction-ID=0,session_start_timestamp=2018-04-26 10:08:19 EDT,SQL_state=0LOG:  worker process: parallel work

Re: issues when installing postgres

2018-05-09 Thread Adrian Klaver
On 05/09/2018 02:47 PM, Antonio Silva wrote: Hello Adrian Are you using the Ubuntu or Postgres repos? > I'm using the Ubuntu repos Can you connect to Postgres using psql? > No I cannot What does ps ax | grep post show? My guess is you are going to have to reinstall Postgres. Thanks Ant

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Adrian Klaver
On 05/09/2018 06:56 AM, Chandru Aroor wrote: Please reply to list also. Ccing list. I am used to seeing an instance of the PostgreSQL database once I finish installing.  I then restore a copy of the database I need to work with into this instance. Inline image I am setting up a dev environme

Re: issues when installing postgres

2018-05-09 Thread Tim Cross
On 10 May 2018 at 09:45, Adrian Klaver wrote: > On 05/09/2018 02:47 PM, Antonio Silva wrote: > >> Hello Adrian >> >> Are you using the Ubuntu or Postgres repos? >> > I'm using the Ubuntu repos >> >> Can you connect to Postgres using psql? >> > No I cannot >> > > What does ps ax | grep post show

ON CONFLICT DO UPDATE

2018-05-09 Thread tango ward
Hi, Sorry for asking question again. I would like to know if there's a workaround for this. I need to insert Student Balance data into a table. The source data have duplicate values for student_id, school_id and campus_name. My StudentBalance model in Djano have Class Meta of: class Meta:

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Chandru Aroor
I don't even have a server to connect to and that is my problem. On Wednesday, May 9, 2018, 6:48:40 PM CDT, Adrian Klaver wrote: On 05/09/2018 06:56 AM, Chandru Aroor wrote: Please reply to list also. Ccing list. > I am used to seeing an instance of the PostgreSQL database once I f

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Adrian Klaver
On 05/09/2018 07:12 PM, Chandru Aroor wrote: I don't even have a server to connect to and that is my problem. I thought you said earlier that the Postgres service was running. Is it running? On Wednesday, May 9, 2018, 6:48:40 PM CDT, Adrian Klaver wrote: On 05/09/2018 06:56 AM, Chand

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Chandru Aroor
Yes, the service shows as running. But I don't have a Server to connect to! On Wednesday, May 9, 2018, 9:43:02 PM CDT, Adrian Klaver wrote: On 05/09/2018 07:12 PM, Chandru Aroor wrote: > I don't even have a server to connect to and that is my problem. I thought you said earlier that

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread David G. Johnston
On Wed, May 9, 2018 at 8:05 PM, Chandru Aroor wrote: > Yes, the service shows as running. But I don't have a Server to connect > to! > ​I have to imagine you can add a server to pgAdmin...try host: localhost and port: 5432 David J.

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Chandru Aroor
That did it! Thanks much! > On May 9, 2018, at 10:31 PM, David G. Johnston > wrote: > >> On Wed, May 9, 2018 at 8:05 PM, Chandru Aroor wrote: > >> Yes, the service shows as running. But I don't have a Server to connect to! > > ​I have to imagine you can add a server to pgAdmin...try host: l

Re: ON CONFLICT DO UPDATE

2018-05-09 Thread Adrian Klaver
On 05/09/2018 07:04 PM, tango ward wrote: Hi, Sorry for asking question again. I would like to know if there's a workaround for this. I need to insert Student Balance data into a table. The source data have duplicate values for student_id, school_id and campus_name. My StudentBalance model i

Re: ON CONFLICT DO UPDATE

2018-05-09 Thread tango ward
Sorry, I modified the school_system_id in CONFLICT CLAUSE. On Thu, May 10, 2018 at 12:07 PM, Adrian Klaver wrote: > On 05/09/2018 07:04 PM, tango ward wrote: > >> >> Hi, >> >> Sorry for asking question again. >> >> I would like to know if there's a workaround for this. I need to insert >> Studen

Re: ON CONFLICT DO UPDATE

2018-05-09 Thread tango ward
Sorry Sir Adrian, updating the code. for row in cur_tdc: print row['studentnumber'], row['firstname'], row['lastname'], row['currentbalance'] cur_phil.execute(""" INSERT INTO recipients_studentbalance( created, modifi

Re: ON CONFLICT DO UPDATE

2018-05-09 Thread tango ward
Okay, I think I manage to solve it by adding balance = excluded.balance inside the parenthesis of ON CONFLICT clause. On Thu, May 10, 2018 at 1:13 PM, tango ward wrote: > Sorry Sir Adrian, updating the code. > > for row in cur_tdc: > print row['studentnumber'], row['firstname'], row['las