pg_sql | Unsorted

Telegram-канал pg_sql - PostgreSQL

2806

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

It depends what you mean by "trust." The results will not be completely insane, and are a reasonable starting point. But you should never trust any tool, no matter how sophisticated, to do a complete job of parameter setting.

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

PostgreSQL

use it as base line that helps you to start tuning things rather then a single source of truth

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

PostgreSQL

Can we still trust this tool ?

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

PostgreSQL

http://pgtune.leopard.in.ua

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

PostgreSQL

what is website for tuning db parameter references ?

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

PostgreSQL

Simply put, max_wal_size tells the system how much changelog it may accumulate until a CHECKPOINT is forced, while wal_keep_size tells the system to keep WALs around even after the CHECKPOINT (although they're no longer needed then!), in case e.g. a replica goes down briefly and requests older WAL segments.

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

PostgreSQL

can someone explain wal_keep_size vs max_wal_size? im getting confused

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

PostgreSQL

Could you send me that link

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

PostgreSQL

my index.js file inside models folder

const Sequelize = require("sequelize");
const sequelize = new Sequelize("gul", "postgres", "123", {
host: "localhost",
port: 5432,
dialect: "postgres"
});

async () => {
await console.log("I am here");
};

sequelize
.sync({ force: true })
.then(() => console.log("Database synced successfully"))
.catch((err) => {
console.error("Database sync error:", err);
process.exit(1); // Exit the process if syncing fails
});

sequelize
.authenticate()
.then(() => {
console.log("Connection has been established successfully.");
})
.catch((err) => {
console.error("Unable to connect to the database:", err);
});

const db = {};
db.sequelize = sequelize;
db.Sequelize = Sequelize;

db.product = require("./product_models")(sequelize, Sequelize);
db.comment = require("./comment_moduls")(sequelize, Sequelize);
db.admin = require("./admin_models")(sequelize, Sequelize);
db.order = require("./order_models")(sequelize, Sequelize);

db.order.hasMany(db.product, {
foreignKey: "orderId",
as: "products",
});

db.product.belongsTo(db.order, {
foreignKey: "orderId",
as: "order",
});

module.exports = db;

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

PostgreSQL

I am using nodejs and I guess I can connect via psql.
What you mean by more info, I need to share my some code?

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

PostgreSQL

Hello guys, I am learning postgresql and when i run my program it throws error like this
Unable to connect to the database: ConnectionError [SequelizeConnectionError]: ������������ "postgres" �� ������ �������� ����������� (�� ������)
at Client._connectionCallback (C:\Users\user\Desktop\Gul\node_modules\sequelize\lib\dialects\postgres\connection-manager.js:145:24)
at Client._handleErrorWhileConnecting (C:\Users\user\Desktop\Gul\node_modules\pg\lib\client.js:326:19)
at Client._handleErrorMessage (C:\Users\user\Desktop\Gul\node_modules\pg\lib\client.js:346:19)
at Connection.emit (node:events:519:28)
at C:\Users\user\Desktop\Gul\node_modules\pg\lib\connection.js:116:12
at Parser.parse (C:\Users\user\Desktop\Gul\node_modules\pg-protocol\dist\parser.js:36:17)
at Socket.<anonymous> (C:\Users\user\Desktop\Gul\node_modules\pg-protocol\dist\index.js:11:42)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) {
parent: error: ������������ "postgres" �� ������ �������� ����������� (�� ������)
at Parser.parseErrorMessage (C:\Users\user\Desktop\Gul\node_modules\pg-protocol\dist\parser.js:283:98)
at Parser.handlePacket (C:\Users\user\Desktop\Gul\node_modules\pg-protocol\dist\parser.js:122:29)
at Parser.parse (C:\Users\user\Desktop\Gul\node_modules\pg-protocol\dist\parser.js:35:38)
at Socket.<anonymous> (C:\Users\user\Desktop\Gul\node_modules\pg-protocol\dist\index.js:11:42)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:191:23) {

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

PostgreSQL

With a "where" query with only 0.1% match, queries are two times as fast and CPU usage is pretty much none

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

PostgreSQL

I don't know. But I'm sure it's marketing gimmick. 🤷‍♂️

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

PostgreSQL

Hello and welcome to this chat. Here we discuss PostgreSQL and provide best-effort voluntary support on Postgresql issues.
If you have any question, try asking kindly, including log files, error descriptions and perhaps what you're trying to do.

- 🚫 photos and screenshots
- 🚫 spam and offtopic
- ✅ questions with log files and clear explanation of what's gone wrong

⬇️ Press the button down here ⬇️

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

PostgreSQL

Hello friends, you know we cannot use pg_lsclusters when patroni enabled. Whats is the best alternative command to get information same as pg_lsclusters? I mean that does cluster online or down, data path, log path, port number and version info together?

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

PostgreSQL

No.
You can't trust any such tools (for any DB that allows much tuning — including e.g. Oracle).
Always recheck results with tests.

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

PostgreSQL

Not sure how much very high memory number

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

PostgreSQL

# WARNING
# this tool not being optimal
# for very high memory systems

# DB Version: 17
# OS Type: linux
# DB Type: web
# Total Memory (RAM): 128 GB
# Data Storage: hdd

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

PostgreSQL

or tunning manually ?

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

PostgreSQL

Привет!
Не получается рассчитать общий вес pacages из таблицы cdek_package. В одном заказе может быть несколько package с разным весом. Мне необходимо посчитать этот общий вес коробок в заказе. Сейчас мой запрос выглядит вот так, но он почемуто умножает вес на 2

    query = """
SELECT co.id AS cart_order_id,
co.status AS cart_order_status,
COUNT(DISTINCT p.id) AS package_count,
SUM(p.weight) AS package_weight, -- здесь мой вес
coe.id AS cdek_order_id,
coe.phones,
coe.cdek_number,
coe.address,
coe.name,
coe.total_sum,
coe.date_time,
MIN(cs.name) AS status_name_last,
fo.address AS free_order_address,
fo.phone AS free_order_phone,
fo.buyer AS free_order_buyer,
osh.data AS order_status_data
FROM cart_order AS co
LEFT JOIN cdek_order AS coe ON co.id = coe.external_order_id
LEFT JOIN cdek_package AS p ON coe.id = p.order_id -- таблица с коробками
LEFT JOIN cdek_statuses AS cs ON coe.id = cs.order_id
LEFT JOIN free_order AS fo ON co.id = fo.external_order_id
LEFT JOIN order_status_history AS osh ON fo.external_order_id = osh.order_id AND osh.status = 9
WHERE co.status = 6
GROUP BY co.id, co.status, coe.id, coe.phones, coe.cdek_number, coe.address, coe.name, coe.total_sum,
coe.date_time, fo.address, fo.phone, fo.buyer, osh.data
ORDER BY co.id DESC
"""

Не понимаю почему запрос возвразает умноженный вес.

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

PostgreSQL

Just use COPY on the main table.

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

PostgreSQL

how to dump table 10 partition in one table in postgres? Pls help me.

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

PostgreSQL

According to sequelize doc, here is an example of how to declare the connection url:
const sequelize = new Sequelize('postgres://user:pass@example.com:5432/dbname') // Example for postgres

It differs from yours, it think you should fix yours and confirm if your connection properties are valid for your postgres environment

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

PostgreSQL

Yea, a minimal reproducible code should help

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

PostgreSQL

We need more info. What is the program you are trying to run?

Are you able to connect via psql?

Your error seems like some encoding issue..

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

PostgreSQL

Wow it's really something. 👍
I change my mind.

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

PostgreSQL

https://pages.cs.wisc.edu/~jignesh/publ/SmartSSD.pdf

Looks like they took those SSDs and reimplemented the WHERE processing part of tuples inthe SSD itself

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

PostgreSQL

Apparently, Samsung made some SSDs with "PostgreDB" hardware acceleration, does somebody know what they hell they are on about?

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

PostgreSQL

Patronictl and status of patroni service

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

PostgreSQL

Yes correct you can fetch them from restore command

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