Re: [SPAM] Re: Partial table duplication via triggger

2024-02-22 Thread Moreno Andreo
On 22/02/24 17:49, Erik Wienhold wrote: On 2024-02-22 15:14 +0100, Moreno Andreo wrote: suppose I have 2 tables [snip] What am I missing? The parameters you pass in with USING have to be referenced as $1, $2, and so on. For example: DECLARE fieldlist text

Partial table duplication via triggger

2024-02-22 Thread Moreno Andreo
Hi *,     suppose I have 2 tables CREATE TABLE t1(     id uuid,     name text,     surname text,     ...     PRIMARY KEY(id) ) CREATE TABLE t2(     id uuid,     master_id uuid,     op_ts timestamp with time zone,     name text,     surname text,     ...     PRIMARY KEY(id) ) I need to write an

Re: Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Moreno Andreo
Il 03/07/2020 16:51, Adrian Klaver ha scritto: On 7/3/20 1:54 AM, Moreno Andreo wrote: Looks like the cluster was not removed from the pgcommon setup. This would explain why you can't run psql. By default pgcommon looks for the version of psql connected with the most recent version

Re: Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Moreno Andreo
-is-not-installed with no luck, apt-purge simply states that pg12 is not installed. Il 03/07/2020 10:37, Moreno Andreo ha scritto: I have a production server running pg9.5 seamlessly. Yesterday I decided to install libpq to have some crypto functions. Unexpectedly, it installed postgresql 12 and its libpq

Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Moreno Andreo
I have a production server running pg9.5 seamlessly. Yesterday I decided to install libpq to have some crypto functions. Unexpectedly, it installed postgresql 12 and its libpq. I don't need pg 12, so I decided to remove it. It did not went well root@datastore-1:/home/user# apt-get --purge

Re: Should I reinstall over current installation?

2020-02-05 Thread Moreno Andreo
Il 04/02/2020 21:18, Chris Charley ha scritto: Hello Moreno Thanks for the reply! I ran Services and it reported postsql as Disabled. A disabled service will never run nor leave error messages anywhere Right click on the Postgresql service, select properties. In the next window, choose

Re: Should I reinstall over current installation?

2020-02-04 Thread Moreno Andreo
Il 04/02/2020 00:16, Chris Charley ha scritto: I tried items you suggested (1-5), but could find no helpful info. Thanks for your help and going the extra mile! Hope I'm in time to try

Re: [SPAM] Remote Connection Help

2019-11-22 Thread Moreno Andreo
Il 21/11/19 22:40, Peter J. Holzer ha scritto: On 2019-11-21 17:27:04 +0100, Moreno Andreo wrote: Connection refused means somthing has blocked it. If it was all OK and simply Postgres was not listening, you should've received a "connection timed out" (10060) message. Almost exactly

Re: [SPAM] Remote Connection Help

2019-11-21 Thread Moreno Andreo
Il 21/11/19 15:21, Jason L. Amerson ha scritto:   could not connect to server: Connection refused (Ox274D/10061) Is the server running on host " xx.xx.xx.xx" and accepting TCP/IP

Re: CASE(?) to write in a different column based on a string pattern

2019-11-13 Thread Moreno Andreo
Il 13/11/19 17:36, Geoff Winkless ha scritto: Simplest way in plain SQL would be individual case statements for each column, I think. SELECT pattern, CASE WHEN pattern LIKE 'foo%' THEN SUBSTR(pattern, 4) ELSE '' END AS foo CASE WHEN pattern LIKE 'bar%' THEN SUBSTR(pattern, 4) ELSE '' END

Re: CASE(?) to write in a different column based on a string pattern

2019-11-13 Thread Moreno Andreo
Il 13/11/19 17:48, Andrew Kerber ha scritto: So what you are doing is transforming the table format from vertical to horizontal.  I think you will want to use a union to join the table to itself along with the case statement to produce the output you are looking for. Not precisely, the

CASE(?) to write in a different column based on a string pattern

2019-11-13 Thread Moreno Andreo
Hi,     I need to create a CASE (I think) statement to check for a string pattern, and based on its value, write a substring in a different column (alias). I'm trying to create a COPY statement to port a table into antoher database, which has a table with another format (that's why the

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-15 Thread Moreno Andreo
Hi Alvaro,     sorry for late reply, I've been out of office. Il 09/10/19 19:51, Alvaro Herrera ha scritto: On 2019-Oct-07, Moreno Andreo wrote: Unfortunately, it didn't work :( db0=# select * from failing_table where ctid='(3160,31)' for update; ERROR:  MultiXactId 12800 has not been

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-07 Thread Moreno Andreo
Il 04/10/19 21:14, Alvaro Herrera ha scritto: On 2019-Oct-04, Moreno Andreo wrote: Il 04/10/19 18:28, Alvaro Herrera ha scritto: I wonder if it would work to just clear that multixact with SELECT ... WHERE ctid='(3160,31)' FOR UPDATE select ...what? :-) Sorry but it's totally beyond my

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-04 Thread Moreno Andreo
Il 04/10/19 18:28, Alvaro Herrera ha scritto: I wonder if it would work to just clear that multixact with SELECT ... WHERE ctid='(3160,31)' FOR UPDATE select ...what? :-) Sorry but it's totally beyond my knowledge and my control after resolving the issue i'll surely go and search docs to

Re: Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-04 Thread Moreno Andreo
Il 04/10/19 17:30, Alvaro Herrera ha scritto: On 2019-Oct-04, Moreno Andreo wrote: select * from heap_page_items(get_raw_page('tablename',3159)); select * from heap_page_items(get_raw_page('tablename',3160)); and so on for about 5 or 6 pages. Please paste the output of that for pages 3159

Pg11 -- MultiXactId xxxx has not been created yet -- apparent wraparound

2019-10-04 Thread Moreno Andreo
Hi all,     I'm encountering this issue in a Windows 10/Pg11.5 I followed the thread @ https://postgrespro.com/list/thread-id/2380690 but examining heap pages is far beyond my knowledge, so if any of the gurus would spend some time on it, I would be

Re: Rebuild pg_toast from scratch?

2019-09-05 Thread Moreno Andreo
Hi Tom and thanks for your time, Il 05/09/19 15:53, Tom Lane ha scritto: Moreno Andreo writes:     I have an issue with a Windows 10 PC with Postgres 9.1 x86. You realize 9.1 is long out of support ... Absolutely :-) I'm about to migrate it to 11 Now I need to recreate an empty copy

Rebuild pg_toast from scratch?

2019-09-05 Thread Moreno Andreo
Hi,     I have an issue with a Windows 10 PC with Postgres 9.1 x86. Running some SELECTs we got "ERROR: could not open file "base/48121/784576": No such file or directory" I then ran select n.nspname AS tableschema,     c.relname AS tablename from pg_class c inner join pg_namespace n on

How to conditionally change the 2nd part of a full join

2019-08-14 Thread Moreno Andreo
I need to obtain a single record from 2 records in the same table grouping for a key, say id    value    value2 1 2            5 1    2        7 the result would be 1    2    5    7 and that works fine with a full join: SELECT * FROM (SELECT idp, data, i1, i2, m1, m2 from tblwk WHERE

Re: Updating 3-table dataset

2019-08-09 Thread Moreno Andreo
Il 09/08/19 16:50, Luca Ferrari ha scritto: On Fri, Aug 9, 2019 at 2:29 PM Moreno Andreo wrote: Hi all, I don't know if that's the heat burning my brain but I can't find a solution to what seemed a simple operation to me. I have 3 tables create table t_all { id uuid, ref_id uuid (FK

Updating 3-table dataset

2019-08-09 Thread Moreno Andreo
Hi all,     I don't know if that's the heat burning my brain but I can't find a solution to what seemed a simple operation to me. I have 3 tables create table t_all { id uuid, ref_id uuid (FK to t_ana.id) }; create table t_ana { id uuid, code text }; create table t_app { id uuid, code text 

Re: Connection refused (0x0000274D/10061)

2019-06-18 Thread Moreno Andreo
Il 18/06/19 15:57, Adrian Klaver ha scritto: On 6/18/19 1:06 AM, Sourav Majumdar wrote: Hii, I have checked the logged file. I am attaching it with this mail. PFA In future please do not attach a 1.4MB file. Most of it was Unpacking info. The relevant part was at the end: " fixing

Re: [SPAM] Re: Key encryption and relational integrity

2019-04-02 Thread Moreno Andreo
Il 01/04/2019 20:48, Rory Campbell-Lange ha scritto: On 01/04/19, Moreno Andreo (moreno.and...@evolu-s.it) wrote: ... I'm not forced to use pseudonimysation if there's the risk to get things worse in a system. I've got to speak about these"two opposing forces at work" to a privacy exp

Re: Key encryption and relational integrity

2019-04-01 Thread Moreno Andreo
Il 29/03/2019 20:23, Adrian Klaver ha scritto: On 3/29/19 9:01 AM, Moreno Andreo wrote: And I tried to find a solution, and since I did not like that much what I found (and it seems that neither you do :-) ), I came here hoping that someone would share his experience to shed some light

Re: Key encryption and relational integrity

2019-03-29 Thread Moreno Andreo
Il 28/03/2019 23:50, Peter J. Holzer ha scritto: On 2019-03-28 15:29:50 +0100, Moreno Andreo wrote: here I'm trying to find a way so nobody can, without the use of the application, match a patient with their clinical records (i.e. someone breaking into the server -- data breach) I think

Re: Key encryption and relational integrity

2019-03-29 Thread Moreno Andreo
Il 28/03/2019 23:29, Peter J. Holzer ha scritto: On 2019-03-28 18:36:40 +0100, Moreno Andreo wrote: Il 26/03/2019 18:08, Adrian Klaver ha scritto: To me it would seem something like: Table medications id    user_id    med 1    sgkighs98    Medication 2    sghighs98    Ear check Table

Re: Key encryption and relational integrity

2019-03-28 Thread Moreno Andreo
Il 27/03/2019 07:42, Tony Shelver ha scritto: Not in Europe, but have worked a bit with medical records systems in the USA, including sharing across providers. The primary key of the

Re: Key encryption and relational integrity

2019-03-26 Thread Moreno Andreo
Il 26/03/2019 15:24, Adrian Klaver ha scritto: On 3/26/19 7:19 AM, Moreno Andreo wrote: Hello folks :-) Is there any workaround to implement key encryption without breaking relational integrity? This is going to need more information. OK, I'll try to be as clearer as I can For starters

Key encryption and relational integrity

2019-03-26 Thread Moreno Andreo
Hello folks :-) Is there any workaround to implement key encryption without breaking relational integrity? Thanks Moreno.-

Re: Connection pooling for differing databases?

2019-03-08 Thread Moreno Andreo
Moreno Andreo <moreno.and...@evolu-s.it> wrote: Il 07/03/2019 20:27, Arjun Ranade ha scritto: > Hi all, > > I'm wondering if there's a tool like pgpool that can provide a single > origi

Re: Connection pooling for differing databases?

2019-03-07 Thread Moreno Andreo
Il 07/03/2019 20:27, Arjun Ranade ha scritto: Hi all, I'm wondering if there's a tool like pgpool that can provide a single origin point (host/port) that will proxy/direct connections to the specific servers that contain the db needing to be accessed. Yes, I think there are many, but I'm

Re: problem

2019-02-01 Thread Moreno Andreo
Check in your %temp% directory, there should be some bitrock* or bitrock_installer* file, these are setup logs and can point you to the problem. If initdb failed, you can try running something like this initdb -D

Re: REVOKE to an user that doesn't exist

2018-12-17 Thread Moreno Andreo
Il 12/12/2018 16:01, Tom Lane ha scritto: The safest way to clean it up manually would be to set the pg_proc.proacl field for that function to NULL. If there are other grants about the function, you could try removing the bad entry, but it would likely be safer to just re-grant after the

Re: REVOKE to an user that doesn't exist

2018-12-12 Thread Moreno Andreo
Il 12/12/2018 16:01, Tom Lane ha scritto: Moreno Andreo writes: I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR:  role "1067431" does not exi

Re: REVOKE to an user that doesn't exist

2018-12-12 Thread Moreno Andreo
Il 12/12/2018 15:39, Adrian Klaver ha scritto: On 12/12/18 5:11 AM, Moreno Andreo wrote: Hi all, I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR

REVOKE to an user that doesn't exist

2018-12-12 Thread Moreno Andreo
Hi all, I'm trying to pg_upgrade a cluster from 9.1 to 10 (Windows 10, but I don't think it matters). At a certain point an error is thrown while parsing a trigger: could not execute query: ERROR:  role "1067431" does not exist command was: REVOKE ALL ON FUNCTION "x"() FROM PUBLIC; GRANT

Re: Debian : No echo after pg_dump | psql

2018-12-12 Thread Moreno Andreo
Adrian, Andrew, thanks and apologies for the late reply Il 30/11/2018 05:08, Andrew Gierth ha scritto: "Moreno" == Moreno Andreo writes: Moreno> The command I'm using is Moreno> root@x:~# pg_dump -v -C -h -p 6543 -U postgres Moreno> | psql -h localhost

Debian : No echo after pg_dump | psql

2018-11-29 Thread Moreno Andreo
Hi guys,     I'm facing a strange thing on my test server (Google Cloud) On my Debian 9 box I'm running Postgres 9.6.10, and I'm transferring some databases from another server (Debian 8, PG 9.5.15). The command I'm using is root@x:~# pg_dump -v -C -h -p 6543 -U postgres | psql -h

Re: New tablespace: just an advice

2018-10-16 Thread Moreno Andreo
Il 16/10/2018 10:18, Laurenz Albe ha scritto: Moreno Andreo wrote: Now, 2 questions. 1. Is it all or do I need to adjust something else about permissions, indexes, vacuuming, etc...? ALTERing the database namespace means copying its physical files to new directory, but is it applied to all

New tablespace: just an advice

2018-10-15 Thread Moreno Andreo
Hi everyone! My space on my Debian 8 DB server is running a bit low (10% left of a 2TB disk), so, since it's not possible to have a primary MBR disk with size > 2 TB, I decided to create another disk and map it on the server, creating another tablespace on it and moving databases aross disks

Re: Role problem in Windows

2018-07-06 Thread Moreno Andreo
Il 06/07/2018 17:34, Melvin Davidson ha scritto: On Fri, Jul 6, 2018 at 10:01 AM, Moreno Andreo <moreno.and...@evolu-s.it> wrote: Hi, Running 9.1 on Windows 10, upgrading

Re: Not able to update some rows in a table

2018-07-02 Thread Moreno Andreo
Il 02/07/2018 16:51, Marco Fochesato ha scritto: Dear all, I have a table with 21 columns. Primary key is done with 20 of these colums. I have 3.313 records. I don't know why, but I'm not able to update some of these records. I don't understand, it seems that I'm not able to fetch. Could you

Re: pgp_sym_decrypt() - error 39000: wrong key or corrupt data

2018-06-27 Thread Moreno Andreo
Il 22/06/2018 19:56, Adrian Klaver ha scritto: On 06/22/2018 09:50 AM, Moreno Andreo wrote: Il 22/06/2018 15:18, Adrian Klaver ha scritto: Are you sure that the entries where not encrypted with a different key because I can't replicate.(More comments below): (other replies below, inline

Re: pgp_sym_decrypt() - error 39000: wrong key or corrupt data

2018-06-22 Thread Moreno Andreo
Il 22/06/2018 15:18, Adrian Klaver ha scritto: On 06/22/2018 01:46 AM, Moreno Andreo wrote: Il 21/06/2018 23:31, Adrian Klaver ha scritto: On 06/21/2018 08:36 AM, Moreno Andreo wrote: Hi, while playing with pgcrypto I ran into a strange issue (postgresql 9.5.3 x86 on Windows 7) Having

Re: pgp_sym_decrypt() - error 39000: wrong key or corrupt data

2018-06-22 Thread Moreno Andreo
Il 21/06/2018 23:31, Adrian Klaver ha scritto: On 06/21/2018 08:36 AM, Moreno Andreo wrote: Hi, while playing with pgcrypto I ran into a strange issue (postgresql 9.5.3 x86 on Windows 7) Having a table with a field dateofbirth text I made the following sequence of SQL commands update

pgp_sym_decrypt() - error 39000: wrong key or corrupt data

2018-06-21 Thread Moreno Andreo
Hi,     while playing with pgcrypto I ran into a strange issue (postgresql 9.5.3 x86 on Windows 7) Having a table with a field dateofbirth text I made the following sequence of SQL commands update tbl_p set dateofbirth = pgp_sym_encrypt('2018-06-21', 'AES_KEY') where codguid =

catalog is missing n attribute(s) for relid xxxx at character yy

2018-06-14 Thread Moreno Andreo
Hi, PostgreSQL 9.1 x86 on Windows 10 (EOL, but in this case it doesn't apply :-) ) When querying a table, I receive the error reported in subject: catalog is missing 5 attribute(s) for relid 33238 at character 15 So I decided to drop and recreate the table. DROP TABLE tbl; same error. Is

Re: pgdg-keyring (or apt-key) failure on fresh 9.6 install

2018-05-30 Thread Moreno Andreo
Il 30/05/2018 00:25, Tim Cross ha scritto: Personally, I tend to prefer using the packages which come with the particular flavour of Linux your installing as they are often more in-line with the current version of the package management system being used. I only grab packages from the specific

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Moreno Andreo
Il 29/05/2018 13:14, Paul Linehan ha scritto: Hi all, I have a problem that I just can't seem to solve: I want to divide the count of one table by the count of another - seems simple enough! I created simple VIEWs with counts of the tables, but I just can't grasp the logic! If it's not an

Re: pgdg-keyring (or apt-key) failure on fresh 9.6 install

2018-05-29 Thread Moreno Andreo
Hi Tim, Il 29/05/2018 00:06, Tim Cross ha scritto: Moreno Andreo writes: Hi folks, I'm trying to install Postgresql 9.6 on a test machine in Google Cloud Platform After a fresh install with Debian 9 (just after the instance has been created) I follow steps from here https

pgdg-keyring (or apt-key) failure on fresh 9.6 install

2018-05-28 Thread Moreno Andreo
Hi folks, I'm trying to install Postgresql 9.6 on a test machine in Google Cloud Platform After a fresh install with Debian 9 (just after the instance has been created) I follow steps from here https://wiki.postgresql.org/wiki/Apt (instead of pg 10 I install pg 9.6) During the installation

Re: Strange error in Windows 10 Pro

2018-04-24 Thread Moreno Andreo
Il 24/04/2018 04:09, Dale Seaburg ha scritto: Thanks to Moreno and Igor for the Event Viewer suggestions.  Here are a few lines of log file where they differ between a good install and a bad incomplete install.  The good install was

Re: Strange error in Windows 10 Pro

2018-04-23 Thread Moreno Andreo
Il 21/04/2018 22:35, Adrian Klaver ha scritto: On 04/21/2018 01:08 PM, Dale Seaburg wrote: Thanks Adrian for the suggestion of running the installer with Admin rights.  Unfortunately, I get the same results.  It appears that all of the folders within C:\Program Files\PostgreSQL\9.6 path are

Schema-based replication

2018-03-30 Thread Moreno Andreo
Hi folks:-) I'm about to design and develop a cross-platform schema-based replicator as a module for an app scheduled for alpha in the next mid-fall/winter. Before digging into it I need to know if I'm reinventing the wheel or not, but AFAIK pglogical can't give this kind of granularity,

Re: Postgresql 9.3 Server will not start after Ubuntu Upgrade

2018-03-28 Thread Moreno Andreo
Il 28/03/2018 18:28, Adrian Klaver ha scritto: On 03/28/2018 09:24 AM, Moreno Andreo wrote: Il 27/03/2018 22:57, Adrian Klaver ha scritto: On 03/27/2018 01:46 PM, Ken Beck wrote: I am working on two systems, one running in Oracle VirtualBox on my laptop, the other in a DigitalOcean droplet. I

Re: Postgresql 9.3 Server will not start after Ubuntu Upgrade

2018-03-28 Thread Moreno Andreo
Il 27/03/2018 22:57, Adrian Klaver ha scritto: On 03/27/2018 01:46 PM, Ken Beck wrote: I am working on two systems, one running in Oracle VirtualBox on my laptop, the other in a DigitalOcean droplet. I know on one of them I tried to remove the postgres-9.6, and it must have been my laptop, here

Re: Postgresql 9.3 Server will not start after Ubuntu Upgrade

2018-03-27 Thread Moreno Andreo
Il 27/03/2018 20:00, Ken Beck ha scritto: And, looking for log files, I find none. Have you looked in /var/log/postgresql/ ?