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

I think that a good DBA is a programmer.
At least, have to program some DBs professionally.
Also, SQL shouldn't be the first programming language, therefore shouldn't be the only one.


Also, while a skilled DB chef could use dark magick of SELECT/WHERE delimiters to loop and filter over data — generally everyone who knows how to write fizzbuzz should be able to handle that somehow.

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

PostgreSQL

i heard you can use water to cool off some very spicy silicons and it will spit out stuff at you

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

PostgreSQL

Or DBAs, I don't think typical devs would do this efficiently. Usually they end up messing something simple as this one, all he needs to do is fit condition in loop and avoid running unnecessary dml.

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

PostgreSQL

https://www.postgresql.org/docs/current/backup-dump.html#BACKUP-DUMP-ALL

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

PostgreSQL

Is this always happening when you insert data into a table? If so perhaps a trigger would be suitable? https://www.postgresql.org/docs/current/plpgsql-trigger.html

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

PostgreSQL

I had to write a bunch of file classifiers do carve files out of the filesystem, create a mock database with the same schema to have a reference of the catalog files, run postgresql with strace enabled to see what file would make it panic and then manually compare files from the mock db with ones with the real one so that i could move the files in the correct folders with the correct OIDs

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

PostgreSQL

How to take entire dump in postgres and move into other lap

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

PostgreSQL

If you do lack valid catalogs it may struggle to make sense of any data though.

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

PostgreSQL

I need to insert same identity value of source into target

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

PostgreSQL

I have generated first ddl schemas and run into target db

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

PostgreSQL

I wish there was a way to tell postgresql "please disable checkpoints, open everything read only, just do sequential scans over the relations i tell you"

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

PostgreSQL

I've been writing tooling that "guesses" using a reference schema® and heuristics what the files that are all over lost+found refer to

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

PostgreSQL

2025-07-03 20:26:31.772 UTC [1180] FATAL:  database "template1" has disappeared from pg_database
2025-07-03 20:26:31.772 UTC [1180] DETAIL: Database OID 1 now seems to belong to "template0".
2025-07-03 20:27:01.769 UTC [1181] FATAL: database 18996 does not exist
2025-07-03 20:27:31.971 UTC [1182] WARNING: some databases have not been vacuumed in over 2 billion transactions
2025-07-03 20:27:31.971 UTC [1182] DETAIL: You might have already suffered transaction-wraparound data los

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

PostgreSQL

Can we use nolock in postgresql query like sql server?

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

PostgreSQL

Experts,

PostgreS, which developer tool IDE will give best support for Procedure Debugging. (Paid version also OK)

Pl suggest. Thanks in advance

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

PostgreSQL

sometimes it even compiles!

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

PostgreSQL

Yes. Considering their salaries — probably only lawers worse on average...

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

PostgreSQL

I wanted to suggest commands for this, but this is better 👍

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

PostgreSQL

Probably, you'd need a computer programmer. They do such tasks.

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

PostgreSQL

Hi

I need to process some data in the loop based on the condition if data is ok i need to insert

If condition falis only rollback for the iteration in the loop

Remaining iteration i have commit.

Kind of a situation where i need partial commit and partial rollback

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

PostgreSQL

backend> SELECT count(*) FROM foxo_users;
1: count (typeid = 20, len = 8, typmod = -1, byval = t)
----
1: count = "898461" (typeid = 20, len = 8, typmod = -1, byval = t)
----

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

PostgreSQL

So far, i've also found https://www.postgresql.org/docs/17/runtime-config-developer.html

ignore_system_indexes
ignore_invalid_pages

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

PostgreSQL

Stuff like enable_xxx (set false) and ignore_system_indexes might be useful. Or there is a bit in the catalog that you can set for specific indexes. I had to do that when updating a system library (libc?) led to index corruption due to changing sort order.

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

PostgreSQL

But when I'm exporting for data identity column is not coming in the insert statement

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

PostgreSQL

I need to copy some tables from db1 to db2

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

PostgreSQL

The only thing i miss now is doing the same in global, most OIDs are there but not the ones that make it go "corrupted index xyz"

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

PostgreSQL

Client: "Is that bad?"

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

PostgreSQL

You can skip locks and not wait for locks when you do SELECT FOR UPDATE, see the locking clause section of: https://www.postgresql.org/docs/current/sql-select.html

But I think PostgreSQL and SQL Server have quite different locking models in places, from my limited knowledge of SQL Sever.

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

PostgreSQL

So i suggest me to scrape the database xD

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

PostgreSQL

yeah, i checked in production mssql, there is one table called property_corpus, overall size shows 60gb, but the actual usage shows 4.7 gb and rest is all some index etc.

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