solved (was plain stupidity) Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread robert rottermann
thanks a lot. why dos such stupidity not hurt. ? have a nice weekend robert On 24.01.21 08:04, Julien Rouhaud wrote: On Sun, Jan 24, 2021 at 2:58 PM rob...@redo2oo.ch wrote: root@elfero-test:~/scripts# pg_lsclusters Ver Cluster Port Status OwnerData directory Log file 10

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread Hemil Ruparel
One small note. Aside from the fact that your server is running from a different port, psycopg2 does not support authentication without password afaik. It has bit me twice On Sun, Jan 24, 2021 at 12:34 PM Julien Rouhaud wrote: > On Sun, Jan 24, 2021 at 2:58 PM rob...@redo2oo.ch > wrote: > > > >

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread Julien Rouhaud
On Sun, Jan 24, 2021 at 2:58 PM rob...@redo2oo.ch wrote: > > root@elfero-test:~/scripts# pg_lsclusters > Ver Cluster Port Status OwnerData directory Log file > 10 main5433 online postgres /var/lib/postgresql/10/main > /var/log/postgresql/postgresql-10-main.log > [...] > psyc

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread rob...@redo2oo.ch
Thanks Adrian On 23.01.21 21:45, Adrian Klaver wrote: On 1/23/21 12:36 PM, robert rottermann wrote: Hi there I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 with PostgreSQL 10.0 service postgresql status ● postgresql.service - PostgreSQL RDBMS     Loaded: loaded (/li

Re: Question about logically replicating a multi-TB database

2021-01-23 Thread Ron
On 1/23/21 5:37 PM, Avinash Kumar wrote: Hi, On Sat, Jan 23, 2021 at 7:28 PM Ron > wrote: https://www.postgresql.org/docs/12/logical-replication-architecture.html "30.5.1. Initial Snapshot The initial data in existing subscribed tables are snapsho

Re: Question about logically replicating a multi-TB database

2021-01-23 Thread Avinash Kumar
Hi, On Sat, Jan 23, 2021 at 7:28 PM Ron wrote: > > https://www.postgresql.org/docs/12/logical-replication-architecture.html > > "30.5.1. Initial Snapshot > The initial data in existing subscribed tables are snapshotted and copied > in > a parallel instance of a special kind of apply process. Th

Question about logically replicating a multi-TB database

2021-01-23 Thread Ron
https://www.postgresql.org/docs/12/logical-replication-architecture.html "30.5.1. Initial Snapshot The initial data in existing subscribed tables are snapshotted and copied in a parallel instance of a special kind of apply process. This process will create its own temporary replication slot a

Re: Need help with trigger

2021-01-23 Thread Melvin Davidson
Maybe this example will help. >From https://www.postgresql.org/docs/current/sql-insert.html INSERT INTO distributors AS d (did, dname) VALUES (8, 'Anvil Distribution') ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname || ' (formerly ' || d.dname || ')' WHERE d.zipcode <> '21201';

Re: Need help with trigger

2021-01-23 Thread Adrian Klaver
On 1/23/21 12:14 PM, Condor wrote: On 23-01-2021 20:49, Adrian Klaver wrote: On 1/23/21 10:20 AM, Condor wrote: Sorry, I'm sorry, I don't understand something. You mean to do pure INSERT ON CONFLICT DO or to modify the trigger ? No I meant that in the external program you use to fetch th

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread Adrian Klaver
On 1/23/21 12:36 PM, robert rottermann wrote: Hi there I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 with PostgreSQL 10.0 service postgresql status ● postgresql.service - PostgreSQL RDBMS    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor pr

Re: ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread Ron
On 1/23/21 2:36 PM, robert rottermann wrote: Hi there I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 with PostgreSQL 10.0 service postgresql status ● postgresql.service - PostgreSQL RDBMS    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor pres

ubuntu 18: PostgreSQL does not start. how can I totally remove and reinstall it

2021-01-23 Thread robert rottermann
Hi there I made somehow a mess with my PostgreSQL installation an an ubuntu 18.4 with PostgreSQL 10.0 service postgresql status ● postgresql.service - PostgreSQL RDBMS    Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)    Active: active (exited) since

Re: Need help with trigger

2021-01-23 Thread Condor
On 23-01-2021 20:49, Adrian Klaver wrote: On 1/23/21 10:20 AM, Condor wrote: On 23-01-2021 18:31, Adrian Klaver wrote: On 1/23/21 4:57 AM, Condor wrote: So do an UPDATE and the RETURN NULL to cancel the INSERT. Untested example: UPDATE arhive_table SET sendto = 0, uts = date_part('epo

Re: Need help with trigger

2021-01-23 Thread Adrian Klaver
On 1/23/21 10:20 AM, Condor wrote: On 23-01-2021 18:31, Adrian Klaver wrote: On 1/23/21 4:57 AM, Condor wrote: So do an UPDATE and the RETURN NULL to cancel the INSERT. Untested example: UPDATE arhive_table SET sendto = 0, uts = date_part('epoch', CURRENT_TIMESTAMP)::integer WHERE cont

Re: Need help with trigger

2021-01-23 Thread Condor
On 23-01-2021 18:31, Adrian Klaver wrote: On 1/23/21 4:57 AM, Condor wrote: Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What is the table being read fro

Re: Need help with trigger

2021-01-23 Thread Condor
On 23-01-2021 18:17, David G. Johnston wrote: On Saturday, January 23, 2021, Condor wrote: Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What I want is: if da

Re: Copy & Re-copy of DB

2021-01-23 Thread Benedict Holland
Right. Like, you can absolutely do this. If you need single tables, you can technically set pgdump to include or exclude tables. Be warned though that this is extremely dangerous as it will not copy over any linked tables and I don't think it does sequences associated with those tables either. Basi

Re: Need help with trigger

2021-01-23 Thread Adrian Klaver
On 1/23/21 4:57 AM, Condor wrote: Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What is the table being read from and is it in the same database? See more

Re: Need help with trigger

2021-01-23 Thread David G. Johnston
On Saturday, January 23, 2021, Condor wrote: > > > Hello ppl, > > I need help with trigger how to replace insert command with update. > External program read data from one table and in every 30 min I need to > refresh data in arhive table. > What I want is: if data already inserted and end_date i

Re: Copy & Re-copy of DB

2021-01-23 Thread Ron
On 1/23/21 6:52 AM, sivapostg...@yahoo.com wrote: We are an ISV.   I agree the risk involved in sharing the data.  Still few of my customers need that facility and are accustomed to it when using SQL Server.   On switch over to PG, I face this issue as a limitation. Need to find and provide a s

Need help with trigger

2021-01-23 Thread Condor
Hello ppl, I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table. What I want is: if data already inserted and end_date is not changed, only to update lastseen column. If data

Re: Copy & Re-copy of DB

2021-01-23 Thread sivapostg...@yahoo.com
We are an ISV.   I agree the risk involved in sharing the data.  Still few of my customers need that facility and are accustomed to it when using SQL Server.   On switch over to PG, I face this issue as a limitation. Need to find and provide a solution.   For those customers, having good volume

Re: localhost ssl

2021-01-23 Thread Paul Förster
Hi Rob, > On 23. Jan, 2021, at 00:02, Rob Sargent wrote: > > I only wish I could set a default database as well, but IMHO that's a failing > of JDBC as much as postgres. you can't for a role or a user. You'd have to specify the database in the jdbc connection string. It's all here: https://j

Re: localhost ssl

2021-01-23 Thread Paul Förster
Hi Rob, > On 22. Jan, 2021, at 23:48, Rob Sargent wrote: > > Yes, I'm confused. As I said in reply to Jeff, I would rather not need to > remember to set the search_path, which I can avoid if I login as "role". I didn't follow the whole discussion, so sorry, to just jump in here. You don't ne