Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread gzh
Thank you for the solution you provided to identify these useless usage of this function,I learned a lot from it. At 2023-07-06 22:42:38, "Pavel Stehule" wrote: čt 6. 7. 2023 v 16:28 odesílatel gzh napsal: Thank you for the solution, it works fine. > I have a

Re: [bug]? insert returning composite type fails

2023-07-06 Thread Adrian Klaver
On 7/6/23 14:52, Lorusso Domenico wrote: Hello guys, In my db (version 15) I've defined a composite type with some domains CREATE DOMAIN my_feat.audit_record_jsonb_domain     AS jsonb     NOT NULL; ALTER DOMAIN my_feat.audit_record_jsonb_domain OWNER TO postgres; CREATE DOMAIN

Re: [bug]? insert returning composite type fails

2023-07-06 Thread David G. Johnston
On Thursday, July 6, 2023, Lorusso Domenico wrote: > > returning bt_info into _bt_info; > > I think it’s “returning (bt_info).* into _bt_info;” David J.

[bug]? insert returning composite type fails

2023-07-06 Thread Lorusso Domenico
Hello guys, In my db (version 15) I've defined a composite type with some domains CREATE DOMAIN my_feat.audit_record_jsonb_domain AS jsonb NOT NULL; ALTER DOMAIN my_feat.audit_record_jsonb_domain OWNER TO postgres; CREATE DOMAIN my_feat.boolean_true_domain AS boolean DEFAULT

Re: Moving data from huge table slow, min() query on indexed column taking 38s

2023-07-06 Thread Lorusso Domenico
Hello, this is a standard problem during bulk copy. here some suggestions; for example disable indexes. The main issue is related to index, lock escalation and log writing. In other dbms you should set log off on the table, but postgresql does

Re: Need help

2023-07-06 Thread Adrian Klaver
On 7/5/23 21:52, aarthi rajagopal wrote: Hi,    I have doubt about how to enable pg_cron in PgAdmin4 version 7, kindly guide me how to do it.. pg_cron: https://github.com/citusdata/pg_cron is an extension that has nothing to do with pgAdmin4. Follow the instructions at the link above to

Need help

2023-07-06 Thread aarthi rajagopal
Hi, I have doubt about how to enable pg_cron in PgAdmin4 version 7, kindly guide me how to do it.. Thanks& Regards Aarthi Rajagopal

Re: Moving data from huge table slow, min() query on indexed column taking 38s

2023-07-06 Thread Dimitrios Apostolou
On Thu, 6 Jul 2023, Dimitrios Apostolou wrote: + First I chose the method to DELETE...INSERT everything. Just to clarify, the query looked more like WITH rows AS ( DELETE FROM tbl_legacy RETURNING * ) INSERT INTO tbl SELECT * FROM rows; I noticed that the postgres process was

Moving data from huge table slow, min() query on indexed column taking 38s

2023-07-06 Thread Dimitrios Apostolou
I have a huge (10G rows) table "tbl_legacy" named test_runs that I want to PARTITION BY RANGE on an indexed integer column. I have created the new partitioned table "tbl" and 1000 partitions in it, so that it can take my existing data and have the partitions ready for the next year (so most of

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
čt 6. 7. 2023 v 16:28 odesílatel gzh napsal: > Thank you for the solution, it works fine. > > > > I have a question. Why do you use the to_char(string) function? Instead > to_char('text') you can write only 'text'. > I'm guessing it's probably a bug made by the original developer, > but I'm not

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread gzh
Thank you for the solution, it works fine. > I have a question. Why do you use the to_char(string) function? Instead > to_char('text') you can write only 'text'. I'm guessing it's probably a bug made by the original developer, but I'm not sure how many bugs there are, because it works fine in

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
čt 6. 7. 2023 v 16:16 odesílatel gzh napsal: > Thank you very much for taking the time to reply to my question. > I added oracle to search_path, but it didn't work. > > postgres=# show search_path; > search_path > - > "$user", public, oracle,

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread gzh
Thank you very much for taking the time to reply to my question. I added oracle to search_path, but it didn't work. postgres=# show search_path; search_path - "$user", public, oracle, pg_catalog At 2023-07-06 19:36:49, "Erik

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Tom Lane
Ron writes: > On 7/6/23 04:19, gzh wrote: >> when I execute the sql below , the to_char function caused the following >> error. >> select TO_CHAR('100'); > Isn't '100' already a character string? Nope; in the mind of the Postgres parser, it's a literal of unknown type, with the actual

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Ron
On 7/6/23 04:19, gzh wrote: Hi, I upgraded the version of PostgreSQL from 12.6 to 12.13, when I execute the sql below , the to_char function caused the following error. ---SQL-- select TO_CHAR('100'); Isn't '100' already a character string? How do

Re: Logical replication restarts

2023-07-06 Thread Mateusz Henicz
Hi, There should be another line in the log for why the logical replication worker has stopped in the first place. Something like Primary Key or Unique Constraint violation, timeout on WAL sender or receiver process, etc. Unless you can provide that information I doubt someone will be able to help

Logical replication restarts

2023-07-06 Thread Paula Berenguel
Hi I am using logical replication to move an on premises database PG11 to a cloud based PG11 and experiencing constant restart of the replication. The replication does it again. The validation_entry started again: 2023-07-06 01:49:46.968 UTC-64a61dba.1ad8LOG: 0: logical replication table

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
čt 6. 7. 2023 v 13:38 odesílatel gzh napsal: > Thank you very much for taking the time to reply to my question. > There are a lot of TO_CHAR in my application, and there is a high cost of > modifying the code, > is there another solution to solve the problem without modifying the code? > There

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread gzh
Thank you very much for taking the time to reply to my question. There are a lot of TO_CHAR in my application, and there is a high cost of modifying the code, is there another solution to solve the problem without modifying the code? At 2023-07-06 19:21:24, "Pavel Stehule" wrote: Hi

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Erik Wienhold
> On 06/07/2023 11:19 CEST gzh wrote: > > I upgraded the version of PostgreSQL from 12.6 to 12.13, > when I execute the sql below , the to_char function caused the following > error. > > ---SQL-- > select TO_CHAR('100'); > > ERROR: function to_char(unknown) is not

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Pavel Stehule
Hi čt 6. 7. 2023 v 11:19 odesílatel gzh napsal: > Hi, > > > I upgraded the version of PostgreSQL from 12.6 to 12.13, > > when I execute the sql below , the to_char function caused the following > error. > > > ---SQL-- > > select TO_CHAR('100'); > > > ERROR:

function to_char(unknown) is not unique at character 8

2023-07-06 Thread gzh
Hi, I upgraded the version of PostgreSQL from 12.6 to 12.13, when I execute the sql below , the to_char function caused the following error. ---SQL-- select TO_CHAR('100'); ERROR: function to_char(unknown) is not unique at character 8 HINT: Could