pg_sql | Unsorted

Telegram-канал pg_sql - PostgreSQL

2830

English speaking PostgreSQL public chat. This group is for discussions on PostgreSQL-related topics and strives to provide best-effort support as well.

Subscribe to a channel

PostgreSQL

Now should I only go with ora2pg or should o use golden gate cdc services

Читать полностью…

PostgreSQL

That vastly depends on your data structure, your downtime requirements and your budget...

Читать полностью…

PostgreSQL

No, most software that could handle this is incomparably better than pgadmin. So no software like it.

Читать полностью…

PostgreSQL

But I tend to use an union all or create additional query windows

Читать полностью…

PostgreSQL

Do you recommend any software like pgadmin to handle this type of queries like 2 and 3 results at a time?

Читать полностью…

PostgreSQL

Because the cursor is only one, and the data in the cursor at the end of multiple query is the data from the last query

Читать полностью…

PostgreSQL

The first PostgreSQL Edinburgh meetup is taking place on December 11th, and we are super happy to have Chris Ellis as our first guest speaker! 👉 https://luma.com/b9kv5fds

Читать полностью…

PostgreSQL

So i still have to track when a user avandoned the group

Читать полностью…

PostgreSQL

Then, you can query using the <@ operator

Читать полностью…

PostgreSQL

How would u design a chat app?
Like i made something like user(id, name, etc…)
Chat(id, name)
Message( chat_id, user_id, etc..)
But i don’t know how to implement like group permissions (owner, admin…)
Or showing the messages of a group for a user before leaving the group

Читать полностью…

PostgreSQL

random_page_cost = 4

Читать полностью…

PostgreSQL

You could probably determine the "point of indifference" quite easily now...

Читать полностью…

PostgreSQL

I assume it thinks it's gonna return many rows so better do a seq scan anyway

Читать полностью…

PostgreSQL

Index scan backwards?
Planner realizes that the PK and the timestamp are strongly correlated and assumes it will match your searched timestamp quicker that reading one or two block ranges of 128 pages each, I guess.

Читать полностью…

PostgreSQL

Did you try with >= and < instead? Maybe the planner just doesn't realize it can use the BRIN index for BETWEEN?

Читать полностью…

PostgreSQL

I have oracle golden gate license . I can take downtime for two days

Читать полностью…

PostgreSQL

Hello geeks , I have to migrate oracle golden gate database to postgresql . The database size is nearly 1tb . The existing database is running on windows 11 and now I want to move it to redhat10 postgresql . Plz tell me which tool I should use . Is ora2pg sufficient or should I use golden gate services for cdc Change and low downtime .

Читать полностью…

PostgreSQL

You could also try DBeaver which I think it supports multiple resulsets

Читать полностью…

PostgreSQL

Pgadmin4 is working for more than one year in that functionality https://github.com/pgadmin-org/pgadmin4/issues/6776

Читать полностью…

PostgreSQL

Is there any way to get the both queries result?

Читать полностью…

PostgreSQL

I have one doubt
I am new for Postgres, I recently installed pg admin 4 in my windows machine, when I try to query the 2 queries in the same session i am getting one result instead of 2 until unless I use union both the queries. Is this expected?
why these are not showing 2 results at a time , please help me how to get the 2 outputs.

Читать полностью…

PostgreSQL

WHen a user abandons the group, you set the upper bound of the range

Читать полностью…

PostgreSQL

SELECT sent_at, user_id, message FROM messages
JOIN userjoin ON userjoin.chat_id = messages.chat_id AND message.sent_at <@ userjoin.joined_at_range
WHERE userjoin.user_id = [your user id]


or something like that

Читать полностью…

PostgreSQL

Have a table "joins" that tracks visibility, with chat_id, user_id, and the "timestamptz" between join and leave (which might not have a upper bound if the user is still inside). https://www.postgresql.org/docs/current/rangetypes.html

Читать полностью…

PostgreSQL

Ah nvm i confused it with seq_page_cost, which is currently 1.0

Читать полностью…

PostgreSQL

Try set enable_seqscan off and compare the costs.

Читать полностью…

PostgreSQL

Seems reasonable. Index access + reading 128 blocks per range is a lot of random IO.

Читать полностью…

PostgreSQL

Using created_at > '2024-11-13', i get a seq scan, even though i have

29577096 rows created before that date
8652158 rows created after

Читать полностью…

PostgreSQL

Ah, it's using the pkey now

Читать полностью…

PostgreSQL

I have a TABLE containing logs that looks something like this:

CREATE TABLE IF NOT EXISTS lm.log
(
id bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
created_at timestamp with time zone NOT NULL,
content text COLLATE pg_catalog."default" NOT NULL,
file_position bigint NOT NULL,
file_id bigint NOT NULL,
CONSTRAINT log_pkey1 PRIMARY KEY (created_at, file_position, file_id),
CONSTRAINT log_file_id_fkey FOREIGN KEY (file_id)
REFERENCES lm.file (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
NOT VALID
)


I have a brin index on "created_at", and insertion order is pretty much (but not guaranteed) to be ordered by date so i would expect the brin to be able to limit quite easily when i do queries with WHERE created_at BETWEEN x AND y, but even with a very small time range that i know will hit only one page it just refuses to use it

Читать полностью…
Subscribe to a channel