Pgoutput not capturing the generated columns

2023-07-18 Thread Rajendra Kumar Dangwal
Hi PG Users. We are using Debezium to capture the CDC events into Kafka. With decoderbufs and wal2json plugins the connector is able to capture the generated columns in the table but not with pgoutput plugin. We tested with the following example: CREATE TABLE employees ( id SERIAL PRIMARY

Re: fsync data directory after DB crash

2023-07-18 Thread Thomas Munro
On Wed, Jul 19, 2023 at 12:41 PM Michael Paquier wrote: > On Tue, Jul 18, 2023 at 04:50:25PM +0800, Pandora wrote: > > I found that starting from version 9.5, PostgreSQL will do fsync on > > the entire data directory after DB crash. Here's a question: if I > > have FPW = on, why is this step still

Re: fsync data directory after DB crash

2023-07-18 Thread Michael Paquier
On Tue, Jul 18, 2023 at 04:50:25PM +0800, Pandora wrote: > I found that starting from version 9.5, PostgreSQL will do fsync on > the entire data directory after DB crash. Here's a question: if I > have FPW = on, why is this step still necessary? Yes, see around the call of SyncDataDirectory() in x

Re: Effects of dropping a large table

2023-07-18 Thread Rob Sargent
On 7/18/23 11:58, Devin Ivy wrote: Hi all, I'm hoping to ensure I understand the implications of dropping a large table and the space being reclaimed by the database and/or OS.  We're using pg v14. This table is quite large with a primary key and one additional index—all together these are o

Effects of dropping a large table

2023-07-18 Thread Devin Ivy
Hi all, I'm hoping to ensure I understand the implications of dropping a large table and the space being reclaimed by the database and/or OS. We're using pg v14. This table is quite large with a primary key and one additional index—all together these are on the order of 1TB. The primary key and

Re: Upgrade Failure

2023-07-18 Thread Ron
pg_ctl is not pg_controldata. (I bet you ran "pg_ctl stop --mode=immediate".  That's not a clean shutdown.) On 7/18/23 05:26, Johnathan Tiamoh wrote: I used pg_ctl to stop the cluster. When I used the same pg_ctl to check status, it says no server is running On Tue, Jul 18, 2023 at 6:14 AM Da

Re: Query take a long time and use no index

2023-07-18 Thread David Rowley
On Mon, 17 Jul 2023 at 21:13, basti wrote: > volkszaehler=# explain analyze SELECT COUNT(DISTINCT DATE_TRUNC('day', > TIMESTAMP 'epoch' + timestamp * INTERVAL '1 millisecond')) FROM data > WHERE channel_id = 5 AND timestamp >= 0; Alternatively, you could express this as: SELECT COUNT(*) FROM (SE

Re: Query take a long time and use no index

2023-07-18 Thread David Rowley
On Tue, 18 Jul 2023 at 06:19, basti wrote: > > Thanks a lot tomas, i will try it. > > I have find out that there is a 'aggregation' function in the frontend. > But this is MySQL specific and I have no idea the transform it to postgres. > > It looks like: > 'REPLACE INTO aggregate (channel_id, type

Re: Upgrade Failure

2023-07-18 Thread Daniel Gustafsson
> On 18 Jul 2023, at 12:26, Johnathan Tiamoh wrote: > > I used pg_ctl to stop the cluster. > > When I used the same pg_ctl to check status, it says no server is running Right, but what does "pg_controldata" say for the cluster? -- Daniel Gustafsson

Re: Upgrade Failure

2023-07-18 Thread Johnathan Tiamoh
I used pg_ctl to stop the cluster. When I used the same pg_ctl to check status, it says no server is running On Tue, Jul 18, 2023 at 6:14 AM Daniel Gustafsson wrote: > > On 18 Jul 2023, at 12:02, Johnathan Tiamoh > wrote: > > > The source cluster was not shut down cleanly. > > Failure, exiting

Re: Upgrade Failure

2023-07-18 Thread Daniel Gustafsson
> On 18 Jul 2023, at 12:02, Johnathan Tiamoh wrote: > The source cluster was not shut down cleanly. > Failure, exiting > > Please how do you resolve this pg_upgrade runs bin/pg_controldata on the source cluster data directory and ensures that the "Database cluster state" says "shut down". If y

Re: Upgrade Failure

2023-07-18 Thread Johnathan Tiamoh
Thank You Laurenz. On Tue, Jul 18, 2023 at 6:12 AM Laurenz Albe wrote: > On Tue, 2023-07-18 at 06:02 -0400, Johnathan Tiamoh wrote: > > I was running an upgrade from 9.5 to 14.8 and encountered the below > error. > > > > Running in verbose mode > > Performing Consistency Checks > >

Re: Upgrade Failure

2023-07-18 Thread Laurenz Albe
On Tue, 2023-07-18 at 06:02 -0400, Johnathan Tiamoh wrote: > I was running an upgrade from 9.5 to 14.8 and encountered the below error. > > Running in verbose mode > Performing Consistency Checks > - > Checking cluster versions   ok >   >

Upgrade Failure

2023-07-18 Thread Johnathan Tiamoh
Hello, I was running an upgrade from 9.5 to 14.8 and encountered the below error. Running in verbose mode Performing Consistency Checks - Checking cluster versions ok The source cluster was not shut down cleanly. Failure, exiting Ple

fsync data directory after DB crash

2023-07-18 Thread Pandora
I found that starting from version 9.5, PostgreSQL will do fsync on the entire data directory after DB crash. Here's a question: if I have FPW = on, why is this step still necessary?

RE: suggestion about time based partitioning and hibernate

2023-07-18 Thread n.kobzarev
От: Ron Отправлено: 18 июля 2023 г. 9:48 Кому: pgsql-general@lists.postgresql.org Тема: Re: suggestion about time based partitioning and hibernate On 7/18/23 01:18, Luca Ferrari wrote: Dear all, I'm looking for ideas here, and it could be someone already stepped into declarative part