标签

 postgresql 

相关的文章:

这是一个关于 PostgreSQL 的文章合集,包括如何在 Github Actions 中添加 PostgreSQL 用于测试、理解 PostgreSQL 的 Planner、使用 pgAdmin4 连接 PostgreSQL 集群、备份配置文件、数据校验、索引扫描等内容。

Percona Database Performance Blog

Percona Database Performance Blog -

Trying out the PostgreSQL pg_tde Tech Preview Release

The tech preview version of the pg_tde extension for PostgreSQL 16 was released on March 28th, with many improvements compared to our previous MVP release. In addition to lots of bug fixes, the new release supports multi-tenancy and key rotation with a simplified configuration mechanism. Note that the Tech Preview release is not recommended for […]

PostgreSQL 16发布了pg_tde扩展的技术预览版本,支持多租户和密钥轮换,配置更简化。不建议在生产环境中使用,可用于开发环境。

相关推荐 去reddit讨论
Planet PostgreSQL

Planet PostgreSQL -

Umair Shahid: 7 considerations for PCI DSS compliance in PostgreSQL

Learn how to ensure PCI DSS compliance in your PostgreSQL database with these 7 crucial considerations. The post 7 considerations for PCI DSS compliance in PostgreSQL appeared first on Stormatics.

本文介绍了确保PostgreSQL数据库符合PCI DSS要求的七个关键因素,包括数据加密、访问控制、身份验证、PAN掩码、审计追踪、定期测试和数据保留与销毁。通过实施这些措施,可以保护支付数据并维持合规性。文章还提到使用PostgreSQL内置的安全功能和遵循最佳实践可以帮助满足合规要求并保护持卡人数据。

相关推荐 去reddit讨论
Planet PostgreSQL

Planet PostgreSQL -

Ashutosh Bapat: PostgreSQL's memory allocations

There's a thread on hackers about recovering memory consumed by paths. A reference count is maintained in each path. Once paths are created for all the upper level relations that a given relation participates in, any unused paths, for which reference count is 0, are freed. This adds extra code and CPU cycles to traverse the paths, maintain reference counts and free the paths. Yet, the patch did not show any performance degradation. I was curious to know why. I ran a small experiment. Experiment I wrote an extension palloc_test which adds two SQL-callable functions palloc_pfree() and mem_context_free() written in C. Function definitions can be found here. The first function palloc's some memory and then pfree's it immediately. Other function just palloc's but never pfrees, assuming that the memory will be freed when the per-tuple memory context is freed. Both functions take the number of iterations and size of memory allocated in each iteration respectively as inputs. These functions return amount of time taken to execute the loop allocating memory. It appears that the first function spends CPU cycles to free memory and the second one doesn't. So the first one should be slower than the second one. Results The table below shows the amount of time reported by the respective functions to execute the loop as many times as the value in the first column, each iteration allocating 100 bytes. The figure shows the same as a plot. The time taken to finish the loop increases linearly for both the function indicating that the palloc logic is O(n) in terms of number of allocations. But the lines cross each other around 300K allocations.   count palloc_pfree memory context reset 100 0.0029 0.007124 100100 2.5646 5.079862 200100 [...]

相关推荐 去reddit讨论
Planet PostgreSQL

Planet PostgreSQL -

Avi Vallarapu: Announcing PGDSAT to satisfy CIS benchmarks for PostgreSQL

In an era where data breaches are both costly and damaging to reputations, implementing best practices and robust security measures is crucial. PostgreSQL has emerged as one of the most successful and highly adopted open-source databases, competing with the enterprise standards of Oracle and SQL Server. Its increasing popularity is evident from DBEngine rankings, Stackoverflow […] The post Announcing PGDSAT to satisfy CIS benchmarks for PostgreSQL appeared first on HexaCluster.

HexaCluster推出了PGDSAT,一款用于增强PostgreSQL集群安全性的数据库安全评估工具。PGDSAT涵盖了大约80个安全控制,包括CIS合规基准推荐的控制。该工具帮助组织确保其PostgreSQL数据库配置符合行业最高安全标准。它可在GitHub上供贡献者添加想法、补丁、评论和问题。该工具还提供安全检查报告,允许用户分析和修复任何失败的检查。在未来的版本中,HexaCluster计划改进PGDSAT提供的安全控制,并支持对DBaaS平台上的数据库运行该工具。

相关推荐 去reddit讨论
程序师

程序师 -

【外评】PostgreSQL 社区讨论 ALTER SYSTEM 命令

有时,最小的补丁也会引起最大的讨论。PostgreSQL 社区(通常不是一个容易产生冗长、措辞激烈的大型讨论的群体)解决是否合并一个添加了新配置参数的简短补丁的问题,就是一个很好的例子。

PostgreSQL社区讨论了一个补丁,目的是禁用ALTER SYSTEM命令以提高在Kubernetes/云原生环境中的安全性。讨论中出现分歧,但最终合并了一个新的补丁来限制ALTER SYSTEM命令的功能。这项工作的成功证明了少数开发人员的坚持不懈。

相关推荐 去reddit讨论
解道jdon.com

解道jdon.com -

PostgreSQL中如何高效使用UUID主键?

UUID通常用作数据库表主键。它们易于生成,易于在分布式系统之间共享并保证唯一性。考虑到 UUID 的大小,这是否是一个正确的选择值得怀疑,但通常这不是由我们决定的。本文的重点不是“ UUID 是否是键的正确格式”,而是如何有效地使用UUID作为PostgreSQL的主键。用于 UUID 的 Postgres 数据类型UUID 可以看作是一个字符串,因此很容易将其存储为字符串。Postgres 有一种用于存储字符串的灵活数据类型:文本,它经常被用作存储 UUID 值的主键。这是一种正确的数据类型吗?肯定不是。Postgres 有一种专门用于 UUID 的数据类型:uuid。UUID 是 128

本文介绍了在PostgreSQL中高效使用UUID作为主键的方法,包括使用uuid数据类型存储UUID、UUID v7的概念和插入速度、以及使用TSID作为主键类型的建议。

相关推荐 去reddit讨论
Percona Database Performance Blog

Percona Database Performance Blog -

PostgreSQL Database Security Best Practices

When data is everything, the sophistication of cybersecurity threats casts a shadow over the world of data security, including for those using PostgreSQL as their database of choice. Although renowned for its reliability, flexibility, and strong feature set, in the face of relentless cyber-attacks, even users of PostgreSQL can find themselves in a situation where […]

保护PostgreSQL数据库免受威胁的最佳实践包括更新软件、加固服务器设置、加强认证安全、最小权限原则、数据加密、保护网络、审计日志和监控、备份和灾难恢复计划。Percona提供数据库安全评估服务。

相关推荐 去reddit讨论
Planet PostgreSQL

Planet PostgreSQL -

Ryan Booz: Recursive CTEs: Transforming and Analyzing Data in PostgreSQL, Part 3

The first two articles in this series demonstrated how PostgreSQL is a capable tool for ELT – taking raw input and transforming it into usable data for querying and analyzing. We used sample data from the Advent of Code 2023 to demonstrate some of the ELT techniques in PostgreSQL. In the first article, we discussed functions and features of SQL in PostgreSQL that can be used together to transform and analyze data. In the second article, we introduced Common Table Expressions (CTE) as a method to build a transformation query one step at a time to improve readability and debugging. In this final article, I’ll tackle one last feature of SQL that allows us to process data in a loop, referencing previous iterations to perform complex calculations: Recursive CTE’s. SQL is Set-based SQL is primarily a set-based, declarative language. Using standard ANSII SQL and platform-specific functions, a SQL developer declares the desired outcome of a query, not the process by which the database should retrieve and process the data. The query planner typically uses statistics about the distribution of data to determine the best plan to get the desired result and return the full set of rows. While CTE’s and LATERAL joins make it feel like we can use the output of one query to impact another, those are always a one-shot opportunity. As a set-based language, it’s impossible to do algorithmic calculations, the ability to use the output of a query as input and control to another in a loop. Stated another way, early versions of the SQL standard did not have procedural capabilities. To do that, most database platforms use their own superset of SQL that provides procedural capabilities. By default, this is T-SQL in SQL Server and pl/pgsql in PostgreSQL. That changed with the SQL:1999 standard. With this new feature, implemented by all major databases, SQL became a Turing-complete language that can solve complex calculations in a single query. Recursive Common Table Expressions (aka. Hierarchical Queries) [...]

本文介绍了PostgreSQL作为ELT工具的能力,以及如何使用递归CTE进行数据处理。递归CTE允许查询在循环中引用前一次迭代的输出,以执行复杂的计算。文章还通过示例演示了如何使用递归CTE来计算从1到10的数字序列和文件系统的层次结构。最后,文章总结了使用SQL和PostgreSQL进行数据处理的优势和建议。

相关推荐 去reddit讨论
Planet PostgreSQL

Planet PostgreSQL -

Robins Tharakan: Unlock PostgreSQL Superpowers with pg_tle

pg_tle - A Must-Know for DevelopersPostgreSQL is a fantastic database, packed with features. But sometimes, you need to add a little something extra – a custom function, a specialized data type, or maybe a procedure written in your favorite programming language. That's traditionally where PostgreSQL extensions come in. But for developers working with managed databases (like Amazon RDS),

搬到海得拉巴后,我将我的汽车从德里带到海得拉巴进行日常使用。

相关推荐 去reddit讨论
Planet PostgreSQL

Planet PostgreSQL -

cary huang: A Deeper Look Inside PostgreSQL Visibility Check Mechanism

What is Visibility? Simply put, the visibility refers to whether a row of data (Heap Tuple by default) should be displayed to the user in certain states, backend processes, or transactions. For example, A user changes a data record from ‘A’ to ‘B’ via UPDATE PostgreSQL handles this by INSERTing a new record call ‘B’ while marking record ‘A’ as ‘invisible’ Both records exist in the system, but ‘B’ is visible, while ‘A’ is not. A deleted or invisible record is also referred as a ‘dead’ tuple One of the responsibilities of VACUUM process is to clear these ‘dead’ tuples to free up space. MVCC (Multi-Version Concurrency Control) is a method in which each write operation creates a “new version” of the data while retaining the “old version”. This allows concurrent read and write operations without blocking each other. PostgreSQL uses a variant of MVCC, also called Snapshot Isolation to isolate concurrent transactions. So, it is possible that a single piece of data could have multiple “versions” of it, and it is PostgreSQL’s responsibility to determine which ‘version’ shall be presented to the user based on multiple factors. This act is also known as the “visibility check” or “visibility control” In this blog, we will dive into PostgreSQL’s visibility check mechanism to understand how it works. Visibility Indicators To my knowledge today, PostgreSQL determines a data’s visibility based on the following indicators: Transaction ID xmin xmax cid transaction snapshot CLOG (Commit Log) hintbit what exactly are these? Let’s find out. transaction ID This should be self-explanatory. All transactions in PostgreSQL are associated with a ID number called transaction ID. This is mainly used to check if a data in question is inserted or deleted in the current transaction. We will explore more on this in the later part of the blog. xmin, xmax, cid and hintbit These indicators are categorized together because they are all [...]

可见性是指在某些状态、后端进程或事务中是否应该向用户显示一行数据。PostgreSQL使用MVCC的变体来隔离并发事务。事务快照存储在共享内存中,用于隔离并发事务。了解事务和可见性的基本原理有助于解决数据一致性问题。

相关推荐 去reddit讨论

热榜 Top10

观测云
观测云
LigaAI
LigaAI
Dify.AI
Dify.AI
eolink
eolink

推荐或自荐