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

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

Am i the only one that cannot get postgresql to use any brin index, ever?

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

PostgreSQL

can someone help me with Pgbackrest?

im taking a full backup and then insert some more data
then i remove the whole data directory and restore - the issue it that the restore also apply all the WAL's created after the backup.

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

PostgreSQL

I need python developer support.will pay for support
Please dm me

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

PostgreSQL

Data doesn't come automatically though and your statement is invalid at smaller data lengths.

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

PostgreSQL

So it's not automatic but triggered by data size.

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

PostgreSQL

Trick question. No types in PostgreSQL automatically use TOAST.

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

PostgreSQL

https://www.postgresql.org/docs/current/upgrading.html

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

PostgreSQL

In ms sql server we have tool called dma for validating braking changes so like that is there any tools in postgres to understand what are things may chance to break ?

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

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

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

PostgreSQL

Hi Ram, I have sent a dm

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

PostgreSQL

Looking for postgresql trainer anyone there pls ping me

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

PostgreSQL

I want to connect my on prem postgres to adf but i can't use self hosted integration runtime and or any azure services, i have aleady have a vpn (office vpn) also this my main db, so there will be frequent read and write, so i want a prefect solution. Please

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

PostgreSQL

trigger is part of automation isnt ? 😄

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

PostgreSQL

😄 Any VARLENA type (like text, jsonb, or bytea) larger than TOAST_TUPLE_THRESHOLD / ~2 KB will automatically TOASTed. Try it by inserting a text value bigger than 2 KB.

then check toast table:

SELECT
c.relname AS main_table,
t.relname AS toast_table
FROM pg_class c
LEFT JOIN pg_class t ON c.reltoastrelid = t.oid
WHERE c.relname = 'your_sandbox_table';

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

PostgreSQL

Read all release notes for all major releases in between, of course.

Also, make a lot of tests.

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

PostgreSQL

Read every single major changelog between 12 and 17, and see if there are any particular notes about deprecated functions you might be still using or special upgrade steps

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

PostgreSQL

We are planning to upgrade postgres’s 12 to 17 , could you please let us know is there any pre-migration steps need to follows?

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