Re: install pgcrypto module to existing postgreSQL

2019-09-18 Thread Luca Ferrari
On Tue, Sep 17, 2019 at 11:19 PM Pavan Kumar wrote: > once configure is done, used make and make install to install postgres. cd contrib && make && make install that should work. Luca

Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Marco Ippolito
I installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition using package manager: sudo apt-get install postgresql-11. But now I'm not able to call psql: (base) marco@pc:~$ sudo su -l postgres [sudo] password for marco: No directory, logging in with HOME=/ postgres@pc:/$ psql W

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Matthias Apitz
El día Wednesday, September 18, 2019 a las 11:50:45AM +0200, Marco Ippolito escribió: > I installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition using package > manager: sudo apt-get install postgresql-11. But now I'm not able to call > psql: > > (base) marco@pc:~$ sudo su -l postgres >

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Marco Ippolito
Thanks Matthias. Followed these steps (indicated here: https://www.postgresql.org/docs/11/creating-cluster.html ) root# *chown postgres /usr/local/pgsql* root# *su postgres* postgres$ *initdb -D /usr/local/pgsql/data* postgres@pc:/home/marco$ /usr/lib/postgresql/11/bin/initdb -D /usr/local/pgsq

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Andreas Joseph Krogh
På onsdag 18. september 2019 kl. 12:13:24, skrev Marco Ippolito < ippolito.ma...@gmail.com >: Thanks Matthias. Followed these steps (indicated here: https://www.postgresql.org/docs/11/creating-cluster.html

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Marco Ippolito
Hi Andreas, if I understand correctly, this is what I've done afterwards: postgres@pc:/home/marco$ /usr/lib/postgresql/11/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start waiting for server to start/bin/sh: 1: cannot create logfile: Permission denied stopped waiting pg_ctl: could not star

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Andreas Joseph Krogh
På onsdag 18. september 2019 kl. 12:25:05, skrev Marco Ippolito < ippolito.ma...@gmail.com >: Hi Andreas, if I understand correctly, this is what I've done afterwards: postgres@pc:/home/marco$ /usr/lib/postgresql/11/bin/pg_ctl -D /usr/local/pgsql/data -l logfile

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Marco Ippolito
thanks Andreas. After changing ownership of /usr/lib/postgresql to postgres user, postgres@pc:/home/marco$ /usr/lib/postgresql/11/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/lib/postgresql/11/log/logfile start waiting for server to start done server started postgres@pc:/home/marco$ But now..

Re: pgbackrest restore to new location?

2019-09-18 Thread David Steele
On 9/17/19 10:03 PM, Stephen Frost wrote: > > That said- it brings up a pretty serious issue that should be discussed, > and that's nuking this: > > HINT: If you are not restoring from a backup, try removing the file > ".../backup_label". > > That hint is absolutely wrong these days when many

Re: pgbackrest restore to new location?

2019-09-18 Thread Stephen Frost
Greetings, * David Steele (da...@pgmasters.net) wrote: > On 9/17/19 10:03 PM, Stephen Frost wrote: > > I'll get a patch into the next commitfest to remove it. The exclusive > > method has been deprecated for quite a few releases and we should stop > > giving bad advice on the assumption that peop

pg_basedump compare with pg_export_snapshot()+pg_dump for full backup

2019-09-18 Thread Fan Liu
Hello, I have some question related with create a full backup. PostgreSQL version 10.10. My customer request to create a full backup at the backup start time which is when the backup triggered. We use to use pg_basebackup to create a full backup, but they recommend that to use pg_export_snap

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Matthias Apitz
El día Wednesday, September 18, 2019 a las 12:44:20PM +0200, Marco Ippolito escribió: > thanks Andreas. > > After changing ownership of /usr/lib/postgresql to postgres user, > > postgres@pc:/home/marco$ /usr/lib/postgresql/11/bin/pg_ctl -D > /usr/local/pgsql/data -l /usr/lib/postgresql/11/log/l

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Marco Ippolito
Thanks Matthias, very kind. Hopefully I will get some hints on how to solve my problem. Marco Il giorno mer 18 set 2019 alle ore 15:11 Matthias Apitz ha scritto: > El día Wednesday, September 18, 2019 a las 12:44:20PM +0200, Marco > Ippolito escribió: > > > thanks Andreas. > > > > After changin

Pg_auto_failover

2019-09-18 Thread Sonam Sharma
Can someone please guide me in installing pg_auto_failover.. where can I get the rpm package for this ?

Re: When does Postgres use binary I/O?

2019-09-18 Thread Tom Lane
Paul A Jungwirth writes: > I've read the docs at [1] and also this interesting recent post about > adding binary I/O to the hashtypes extension. I wrote send & recv > functions for my new multirange types, but I'm not sure how to test > them. After running installcheck or installcheck-world, the c

Re: Pg_auto_failover

2019-09-18 Thread Adrian Klaver
On 9/18/19 7:19 AM, Sonam Sharma wrote: Can someone please guide me in installing pg_auto_failover.. where can I get the rpm package for this ? OS and version? Postgres version? -- Adrian Klaver adrian.kla...@aklaver.com

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Adrian Klaver
On 9/18/19 6:13 AM, Marco Ippolito wrote: Thanks Matthias, very kind. Hopefully I will get some hints on how to solve my problem. You should probably take a look at: https://help.ubuntu.com/lts/serverguide/postgresql.html FYI, you should set the permission son /usr/lib/postgresql back to root

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Marco Ippolito
Hi Adrian, after purging from Ubuntu 18.04.02 everything related to postgresql-11, I re-installed it and made it working, yes...finally working... with this useful and good guidelines: https://pgdash.io/blog/postgres-11-getting-started.html. Marco Il giorno mer 18 set 2019 alle ore 16:41 Adrian

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Matthias Apitz
El día miércoles, septiembre 18, 2019 a las 07:41:41a. m. -0700, Adrian Klaver escribió: > On 9/18/19 6:13 AM, Marco Ippolito wrote: > > Thanks Matthias, > > very kind. Hopefully I will get some hints on how to solve my problem. > > You should probably take a look at: > > https://help.ubuntu.co

Re: Pg_auto_failover

2019-09-18 Thread Sonam Sharma
Adrian, Postgres version : 10.7 Os version : Linux Redhat 7.4 On Wed, Sep 18, 2019, 8:01 PM Adrian Klaver wrote: > On 9/18/19 7:19 AM, Sonam Sharma wrote: > > Can someone please guide me in installing pg_auto_failover.. where can I > > get the rpm package for this ? > > > OS and version? > > Po

Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target

2019-09-18 Thread Adrian Klaver
On 9/18/19 7:49 AM, Matthias Apitz wrote: El día miércoles, septiembre 18, 2019 a las 07:41:41a. m. -0700, Adrian Klaver escribió: On 9/18/19 6:13 AM, Marco Ippolito wrote: Thanks Matthias, very kind. Hopefully I will get some hints on how to solve my problem. You should probably take a loo

Re: Pg_auto_failover

2019-09-18 Thread Adrian Klaver
On 9/18/19 7:56 AM, Sonam Sharma wrote: Adrian, Postgres version : 10.7 Os version : Linux Redhat 7.4 If you are installing from the PGDG repos then the package is there: https://yum.postgresql.org/10/redhat/rhel-7-x86_64/repoview/pg_auto_failover_10.html You can also go here: https://gith

Re: PostgreSQL License

2019-09-18 Thread Ashkar Dev
Hi all thanks, I meant maybe I create a web app with PostgreSQL that work locally for example for a pharmacy that stores data by barcode while the DB was created by PostgreSQL how I can sell the Database for him, how to deliver the product to him can I sell the package that contains web app files w

Re: PostgreSQL License

2019-09-18 Thread Rob Sargent
On 9/18/19 11:50 AM, Ashkar Dev wrote: Hi all thanks, I meant maybe I create a web app with PostgreSQL that work locally for example for a pharmacy that stores data by barcode while the DB was created by PostgreSQL how I can sell the Database for him, how to deliver the product to him can I

Re: PostgreSQL License

2019-09-18 Thread Adrian Klaver
On 9/18/19 11:06 AM, Rob Sargent wrote: On 9/18/19 11:50 AM, Ashkar Dev wrote: Hi all thanks, I meant maybe I create a web app with PostgreSQL that work locally for example for a pharmacy that stores data by barcode while the DB was created by PostgreSQL how I can sell the Database for him, h

Re: PostgreSQL License

2019-09-18 Thread Rob Sargent
> On Sep 18, 2019, at 12:17 PM, Adrian Klaver wrote: > > On 9/18/19 11:06 AM, Rob Sargent wrote: >> On 9/18/19 11:50 AM, Ashkar Dev wrote: >>> Hi all thanks, >>> I meant maybe I create a web app with PostgreSQL that work locally for >>> example for a pharmacy that stores data by barcode while

Backup PostgreSQL from RDS straight to S3

2019-09-18 Thread Anthony DeBarros
Hi, folks -- I'm a longtime PostgreSQL user but a bit of a noob when it comes to maintenance. Question: I'm running PostgreSQL 11 on Amazon RDS. Also have an EC2 box running Ubuntu that runs some Python scripts that collect data into PostgreSQL. We're doing the standard RDS backups. However, I'd

Re: Backup PostgreSQL from RDS straight to S3

2019-09-18 Thread Adrian Klaver
On 9/18/19 11:32 AM, Anthony DeBarros wrote: Hi, folks -- I'm a longtime PostgreSQL user but a bit of a noob when it comes to maintenance. Question: I'm running PostgreSQL 11 on Amazon RDS. Also have an EC2 box running Ubuntu that runs some Python scripts that collect data into PostgreSQL. W

Re: PostgreSQL License

2019-09-18 Thread Adrian Klaver
On 9/18/19 11:23 AM, Rob Sargent wrote: On Sep 18, 2019, at 12:17 PM, Adrian Klaver wrote: On 9/18/19 11:06 AM, Rob Sargent wrote: On 9/18/19 11:50 AM, Ashkar Dev wrote: Hi all thanks, I meant maybe I create a web app with PostgreSQL that work locally for example for a pharmacy that store

Re: Backup PostgreSQL from RDS straight to S3

2019-09-18 Thread Anthony DeBarros
Great, thanks. The question I have, which at first glance isn't covered there, is whether those instructions will at any point bring the dump file onto the EC2 box, either in memory or temp file storage, on its way to S3? I don't know enough about how Linux handles data piped from one command to th

Re: Backup PostgreSQL from RDS straight to S3

2019-09-18 Thread Adrian Klaver
On 9/18/19 12:04 PM, Anthony DeBarros wrote: Great, thanks. The question I have, which at first glance isn't covered there, is whether those instructions will at any point bring the dump file onto the EC2 box, either in memory or temp file storage, on its way to S3? I don't know enough about ho

Re: When does Postgres use binary I/O?

2019-09-18 Thread Paul Jungwirth
On 9/18/19 7:26 AM, Tom Lane wrote: The core regression tests don't systematically exercise binary I/O, and they certainly wouldn't magically cover a new type they didn't use to. You'd need to add test case(s). Thanks! I thought psql might use binary IO internally when available, or at least

postgres 9.6: insert into select finishes only in pgadmin not psql

2019-09-18 Thread Corey Taylor
If this is a common question or an article exists, please let me know. I couldn't find anything specific about it in stack overflow questions or postgres/psql documentation. This is in PostgreSQL 9.6. I am trying to figure out how to debug an issue where a function 'import_wss' called through pg

Re: postgres 9.6: insert into select finishes only in pgadmin not psql

2019-09-18 Thread Tom Lane
Corey Taylor writes: > I am trying to figure out how to debug an issue where a function > 'import_wss' called through pgadmin4 will complete but not through psql. First thing I'd look at is whether it's the same execution environment in both cases, eg same search_path. You could try doing EXPLAI

Re: When does Postgres use binary I/O?

2019-09-18 Thread Tom Lane
Paul Jungwirth writes: > On 9/18/19 7:26 AM, Tom Lane wrote: >> Likely it'd be good to have some more consistent approach to >> testing that ... right now it's not even very obvious where >> is a good place to add such tests. I do see a small test in >> src/test/regress/input/misc.source (COPY BI

Re: PostgreSQL License

2019-09-18 Thread Ashkar Dev
Thanks, but is it legal to charge for installing PostgreSQL? as you said: > You cannot (legitimately) charge the pharmacist for any part PostgresQL should I in the contract write that the price does not include installing PostgreSQL, preparing it or PostgreSQL itself? or just from my side while

Re: PostgreSQL License

2019-09-18 Thread Adrian Klaver
On 9/18/19 3:11 PM, Ashkar Dev wrote: Thanks, but is it legal to charge for installing PostgreSQL? Yes, otherwise these folks: https://www.postgresql.org/support/professional_support/ would a good deal less business. as you said: You cannot (legitimately) charge the pharmacist for any

Re: PostgreSQL License

2019-09-18 Thread Ron
Charging for *installing* PostgreSQL is not the same as charging for PostgreSQL. Bottom line: you charge for *services**you provide* not for software that other people provide. On 9/18/19 5:11 PM, Ashkar Dev wrote: Thanks, but is it legal to charge for installing PostgreSQL? as you said:

pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread Ron
Hi, (Thanks, Stephen, for helping with my earlier problem.) Scenario: there's data corruption on production server, so we need to do a PITR restore from "a few days ago" of the cluster holding the prod databases to a second cluster on that same VM in order to try and find the missing data and

Re: PostgreSQL License

2019-09-18 Thread Ken Tanzer
On Wed, Sep 18, 2019 at 3:20 PM Ron wrote: > Charging for *installing* PostgreSQL is not the same as charging for > PostgreSQL. > > Bottom line: you charge for *services** you provide* not for software > that other people provide. > > That's just really not true. There is nothing that prohibits

Re: PostgreSQL License

2019-09-18 Thread Ron
On 9/18/19 6:03 PM, Ken Tanzer wrote: On Wed, Sep 18, 2019 at 3:20 PM Ron > wrote: Charging for *installing* PostgreSQL is not the same as charging for PostgreSQL. Bottom line: you charge for *services**you provide* not for software that other

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread Jerry Sievers
Ron writes: > Hi, > > (Thanks, Stephen, for helping with my earlier problem.) > > Scenario: there's data corruption on production server, so we need to > do a PITR restore from "a few days ago" of the cluster holding the > prod databases to a second cluster on that same VM in order to try and > f

Re: PostgreSQL License

2019-09-18 Thread Ken Tanzer
On Wed, Sep 18, 2019 at 5:55 PM Ron wrote: > On 9/18/19 6:03 PM, Ken Tanzer wrote: > > > > On Wed, Sep 18, 2019 at 3:20 PM Ron wrote: > >> Charging for *installing* PostgreSQL is not the same as charging for >> PostgreSQL. >> >> Bottom line: you charge for *services** you provide* not for softwa

Re: PostgreSQL License

2019-09-18 Thread Rob Sargent
> On Sep 18, 2019, at 6:55 PM, Ron wrote: > >> On 9/18/19 6:03 PM, Ken Tanzer wrote: >> >> >>> On Wed, Sep 18, 2019 at 3:20 PM Ron wrote: >>> Charging for installing PostgreSQL is not the same as charging for >>> PostgreSQL. >>> >>> Bottom line: you charge for services you provide not for

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread David Steele
On 9/18/19 6:59 PM, Ron wrote: > > Scenario: there's data corruption on production server, so we need to do > a PITR restore from "a few days ago" of the cluster holding the prod > databases to a second cluster on that same VM in order to try and find > the missing data and load it back into the p

Re: PostgreSQL License

2019-09-18 Thread Ron
On 9/18/19 8:26 PM, Ken Tanzer wrote: On Wed, Sep 18, 2019 at 5:55 PM Ron > wrote: On 9/18/19 6:03 PM, Ken Tanzer wrote: On Wed, Sep 18, 2019 at 3:20 PM Ron mailto:ronljohnso...@gmail.com>> wrote: Charging for *installing* PostgreSQL is not the

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread Ron
On 9/18/19 8:31 PM, David Steele wrote: On 9/18/19 6:59 PM, Ron wrote: Scenario: there's data corruption on production server, so we need to do a PITR restore from "a few days ago" of the cluster holding the prod databases to a second cluster on that same VM in order to try and find the missing

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread David Steele
On 9/18/19 9:40 PM, Ron wrote: > > I'm concerned with one pgbackrest process stepping over another one and > the restore (or the "pg_ctl start" recovery phase) accidentally > corrupting the production database by writing WAL files to the original > cluster. This is not an issue unless you serious

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread Ron
On 9/18/19 8:58 PM, David Steele wrote: On 9/18/19 9:40 PM, Ron wrote: I'm concerned with one pgbackrest process stepping over another one and the restore (or the "pg_ctl start" recovery phase) accidentally corrupting the production database by writing WAL files to the original cluster. This is

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread Jerry Sievers
David Steele writes: > On 9/18/19 9:40 PM, Ron wrote: > >> >> I'm concerned with one pgbackrest process stepping over another one and >> the restore (or the "pg_ctl start" recovery phase) accidentally >> corrupting the production database by writing WAL files to the original >> cluster. > > This

Re: pgbackrest - question about restoring cluster to a new cluster on same server

2019-09-18 Thread David Steele
On 9/18/19 10:18 PM, Jerry Sievers wrote: > David Steele writes: > >> This is not an issue unless you seriously game the system. When a > > And/or your recovery system is running archive_mode=always :-) > > I don't know how popular that setting value is but that plus an > identical archive_com

Re: PostgreSQL License

2019-09-18 Thread Ken Tanzer
On Wed, Sep 18, 2019 at 6:35 PM Ron wrote: > On 9/18/19 8:26 PM, Ken Tanzer wrote: > > On Wed, Sep 18, 2019 at 5:55 PM Ron wrote: > >> On 9/18/19 6:03 PM, Ken Tanzer wrote: >> >> >> >> On Wed, Sep 18, 2019 at 3:20 PM Ron wrote: >> >>> Charging for *installing* PostgreSQL is not the same as char

Automatically parsing in-line composite types

2019-09-18 Thread Mitar
Hi! I am trying to understand how could I automatically parse an in-line composite type. By in-line composite type I mean a type corresponding to ROW. For example, in the following query: SELECT _id, body, (SELECT array_agg(ROW(comments._id, comments.body)) FROM comments WHERE comments.post_id=po

Re: PostgreSQL License

2019-09-18 Thread Ron
On 9/18/19 11:43 PM, Ken Tanzer wrote: On Wed, Sep 18, 2019 at 6:35 PM Ron > wrote: On 9/18/19 8:26 PM, Ken Tanzer wrote: On Wed, Sep 18, 2019 at 5:55 PM Ron mailto:ronljohnso...@gmail.com>> wrote: On 9/18/19 6:03 PM, Ken Tanzer wrote:

Re: Backup PostgreSQL from RDS straight to S3

2019-09-18 Thread Steven Lembark
s3fs available on linux allows mounting S3 directly as a local filesystem. At that point something like: pg_dump ... | gzip -9 -c > /mnt/s3-mount-point/$basename.pg_dump.gz; will do the deed nicely. If your S3 volume is something like your_name_here.com/pg_dump then you could parallize it by