Re: invalid value for parameter "default_text_search_config": "public.pg"

2023-07-20 Thread Les
Version: PostgreSQL 15.3 (Debian 15.3-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit Extensions installed: oid |extname |extowner|extnamespace|extrelocatable|extversion|extconfig|extcondition|

Re: invalid value for parameter "default_text_search_config": "public.pg"

2023-07-20 Thread David G. Johnston
On Thursday, July 20, 2023, Les wrote: > I try to execute this on a very simple table, in a production database: > Please provide version information and any extensions you may have installed. David J.

invalid value for parameter "default_text_search_config": "public.pg"

2023-07-20 Thread Les
I try to execute this on a very simple table, in a production database: alter table product.product add proc_order int8; create index idx_product_proc_order_status on product.product(proc_order nulls last, product_status_id /* this has type uuid */ ); and I get this error: SQL Error [22023]:

Server unable to UP after restore

2023-07-20 Thread Ram Pratap Maurya
Hi Team, I am facing error during restore of PG_BASEBACKUP , server is not going UP after restoring . We follow below process . 1. First we take backup by command : pg_basebackup -h127.0.01 -U postgres -D /mnt/backup 2. Maintain restore_command = 'cp

Re:How to improve the performance of my SQL query?

2023-07-20 Thread gzh
>select (38700325 - 11833442) /38700325.0; >is 0.69 approx. >So I think it says around 69% of rows satisfy the query condition.Thank you >for your reply. I have learned a lot from it. At 2023-07-20 23:20:16, "jian he" wrote: >On Thu, Jul 20, 2023 at 7:36 PM gzh wrote: >> >> >> Thank

Re: How to improve the performance of my SQL query?

2023-07-20 Thread gzh
The definitions of the columns used in SQL are as follows. TBL_SHA ms_cd character(6) NOT NULL -- PRIMARY KEY et_cd character(8) etrys character(8) TBL_INF ms_cd character(6) NOT NULL -- PRIMARY KEY ry_cd character(8) NOT NULL -- PRIMARY KEY I made some

Re: fsync data directory after DB crash

2023-07-20 Thread Thomas Munro
On Wed, Jul 19, 2023 at 2:09 PM Pandora wrote: > Yes, I saw the usage of syncfs in PG14, but it is recommended to use it on > Linux 5.8 or higher. If my OS version is lower than 5.8, can I still enable > it? Nothing stops you from enabling it, it's fairly ancient and should work. It just

pg_upgradecluster fails if pg_hba.conf contains "@file" entries

2023-07-20 Thread Albrecht Dreß
Hi all, I run a PostgreSQL 14 database cluster on a Debian Bullseye (oldstable) box using the deb's from apt.postgresql.org. The configuration contains “indirect” entries in /etc/postgresql/14/main/pg_hba.conf, looking like e.g. hostssl @dblist.txt all 172.16.96.0/24

Re: suggestion about time based partitioning and hibernate

2023-07-20 Thread Ron
On 7/20/23 10:31, Luca Ferrari wrote: On Wed, Jul 19, 2023 at 6:45 PM Alvaro Herrera wrote: Therefore I suggest to avoid doing that. Either look at some other partitioning scheme that doesn't involve adding columns to the primary key, or disregard partitioning for this table entirely. What

Re: My 1st JDBC and PostgreSQL

2023-07-20 Thread Chuck Davis
You get the value you're willing to work for as a general rule. It takes more effort to admin a real SQL server than an easy embedded DB. Your interpretation is spot on. On Thu, Jul 20, 2023 at 8:18 AM Adrian Klaver wrote: > On 7/19/23 18:11, Chuck Davis wrote: > > Postgresql is a

Re: TSQL To Postgres - Unpivot/Union All

2023-07-20 Thread Anthony Apollis
CREATE TEMP TABLE temp_FieldFlowsFact ( Account varchar(20), "Calendar day" DATE, "Financial year" varchar(5), Period varchar(8), "Period type" varchar(10), Metric varchar(50), "Metric Value" float ) It was created as a temp table in SQLServer, but it does not have to

Re: suggestion about time based partitioning and hibernate

2023-07-20 Thread Luca Ferrari
On Wed, Jul 19, 2023 at 6:45 PM Alvaro Herrera wrote: > > Therefore I suggest to avoid doing > that. Either look at some other partitioning scheme that doesn't > involve adding columns to the primary key, or disregard partitioning for > this table entirely. What do you mean by "other

Re: My 1st JDBC and PostgreSQL

2023-07-20 Thread Adrian Klaver
On 7/19/23 17:37, Amn Ojee Uw wrote: Following the example in : https://www.tutorialspoint.com/postgresql/postgresql_java.htm Avoid the site above it will lead you down many false paths. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Re: How to improve the performance of my SQL query?

2023-07-20 Thread jian he
On Thu, Jul 20, 2023 at 7:36 PM gzh wrote: > > > Thank you very much for taking the time to reply to my question. > > > Sorry, I provided incorrect information. > > The index also does not work in the following query statement. > > > > select COUNT(ET_CD) > > > from TBL_SHA > > > WHERE MS_CD =

Re: My 1st JDBC and PostgreSQL

2023-07-20 Thread Adrian Klaver
On 7/19/23 18:11, Chuck Davis wrote: Postgresql is a sophisticated database server.  You can do what you're attempting with something like Derby at the connection.  But with Postgresql "you get what you pay for". Not sure what "you get what you pay for" means in this context? My take is you

Re: Fwd: TSQL To Postgres - Unpivot/Union All

2023-07-20 Thread Thomas Kellerer
Anthony Apollis schrieb am 20.07.2023 um 14:17: Does not give me outputs for columns: Metric and Pricing Channel: image.png What am i doing wrong? Please assist? UNPIVOT can be done using a LATERAL sub-query with a VALUES clause: https://blog.sql-workbench.eu/post/unpivot-with-postgres/

Re: TSQL To Postgres - Unpivot/Union All

2023-07-20 Thread Geoff Winkless
On Thu, 20 Jul 2023 at 15:28, Anthony Apollis wrote: > I am attaching my TSQL and Postgres SQL: You're still missing some CREATEs, for example for temp_FieldFlowsFact. Even assuming your columns list is correct, I would still (and as a matter of habit) include the target column list in your

Re: How to improve the performance of my SQL query?

2023-07-20 Thread Laurenz Albe
On Thu, 2023-07-20 at 22:14 +0800, gzh wrote: > The information I provided is incorrect, please see my previous reply. My question remains: I would like to see the table definitions. Also, did you ANALYZE the tables? Yours, Laurenz Albe

Re: Nu-B here

2023-07-20 Thread Adrian Klaver
On 7/19/23 23:32, Alban Hertroys wrote: On 20 Jul 2023, at 02:36, Amn Ojee Uw wrote: After this command 'sudo -u postgres psql' I get this message : could not change directory to "/home/my_account": Permission denied What’s the reason that you’re using the OS user postgres? Because the

Fwd: TSQL To Postgres - Unpivot/Union All

2023-07-20 Thread Anthony Apollis
-- Forwarded message - From: Anthony Apollis Date: Thu, 20 Jul 2023 at 16:07 Subject: Re: TSQL To Postgres - Unpivot/Union All To: Geoff Winkless , David G. Johnston < david.g.johns...@gmail.com> I am attaching my TSQL and Postgres SQL: On Thu, 20 Jul 2023 at 15:58, Geoff

Re: How to improve the performance of my SQL query?

2023-07-20 Thread gzh
Thank you for your reply. The information I provided is incorrect, please see my previous reply. >What I cannot see is if the columns are defined as "character" or whether you >bind >the parameters as "character". Can you show us the table definition of >"TBL_SHA" >and "TBL_INF"? For

Re: TSQL To Postgres - Unpivot/Union All

2023-07-20 Thread Geoff Winkless
On Thu, 20 Jul 2023 at 13:17, Anthony Apollis wrote: > The Postgres i used: INSERT INTO temp_FieldFlowsFact > SELECT "Account", "Calendar day", "Financial year", "Period", > > [snip] At the very least, include a column list in your INSERT statement. We have no way of checking where any of your

Re: TSQL To Postgres - Unpivot/Union All

2023-07-20 Thread David G. Johnston
On Thursday, July 20, 2023, Anthony Apollis wrote: > > > I am trying to convert this TSQL: > This doesn’t really seem relevant all that relevant at this point. Given some input data either the query produces the expected result or it doesn’t. > > What am i doing wrong? Please assist? > You

Re: How to improve the performance of my SQL query?

2023-07-20 Thread Laurenz Albe
On Thu, 2023-07-20 at 15:09 +0800, gzh wrote: > I'm running into some performance issues with my SQL query. > The following SQL query is taking a long time to execute. > > explain analyze > select COUNT(ET_CD) > from TBL_SHA > WHERE TBL_SHA.MS_CD = '009' > and TBL_SHA.ETRYS in >    (select

Re:Re: How to improve the performance of my SQL query?

2023-07-20 Thread gzh
Thank you very much for taking the time to reply to my question. Sorry, I provided incorrect information. The index also does not work in the following query statement. > select COUNT(ET_CD) > from TBL_SHA > WHERE MS_CD = '009' > AND ETRYS = '01' QUERY PLAN Limit

Re: How to improve the performance of my SQL query?

2023-07-20 Thread Peter J. Holzer
On 2023-07-20 15:09:22 +0800, gzh wrote: > Hi everyone, > > > I'm running into some performance issues with my SQL query. > > The following SQL query is taking a long time to execute. > > > explain analyze > select COUNT(ET_CD) > from TBL_SHA > WHERE TBL_SHA.MS_CD = '009' > and TBL_SHA.ETRYS

Re: How to improve the performance of my SQL query?

2023-07-20 Thread Erik Wienhold
> On 20/07/2023 09:09 CEST gzh wrote: > > I'm running into some performance issues with my SQL query. > The following SQL query is taking a long time to execute. > > explain analyze > select COUNT(ET_CD) > from TBL_SHA > WHERE TBL_SHA.MS_CD = '009' > and TBL_SHA.ETRYS in > (select TBL_INF.RY_CD >

Re: Postgres SQL

2023-07-20 Thread Maciek Sakrejda
On Wed, Jul 19, 2023, 22:40 Anthony Apollis wrote: > Hi > > What list can i post sql related errors etc? > This is a good place to start, but you may want to review https://wiki.postgresql.org/wiki/Guide_to_reporting_problems to make it easier to get help if you're not already familiar with it.

Re: Postgrsql blocked for more than 120 s

2023-07-20 Thread Bogdan Siara
Hi, Problem was on disk io starvation, storage migration to more iops resolve the problem. Regards BS pon., 17 lip 2023 o 07:40 Bogdan Siara napisał(a): > Hi, I have a problem with my slave postgresql instance. During normal > operations databaseis locked and in syslog I see stacktrace: > > Jul

How to improve the performance of my SQL query?

2023-07-20 Thread gzh
Hi everyone, I'm running into some performance issues with my SQL query. The following SQL query is taking a long time to execute. explain analyze select COUNT(ET_CD) from TBL_SHA WHERE TBL_SHA.MS_CD = '009' and TBL_SHA.ETRYS in (select TBL_INF.RY_CD from TBL_INF WHERE

Re: Nu-B here

2023-07-20 Thread Alban Hertroys
> On 20 Jul 2023, at 02:36, Amn Ojee Uw wrote: > > After this command 'sudo -u postgres psql' > I get this message : > could not change directory to "/home/my_account": Permission denied What’s the reason that you’re using the OS user postgres? If you’re simply trying to connect to the