对事务内 PostgreSQL 模式更改的限制? [英] Limits on PostgreSQL schema changes inside transactions?

查看:22
本文介绍了对事务内 PostgreSQL 模式更改的限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库背景是 Oracle,所以我惊讶地发现 Postgres 在事务中包含架构更改 - 如果您开始更改,创建一个表然后回滚,该表就会消失.它也适用于添加和删除列.显然这是非常好的.

My database background is with Oracle, so I was surprised to discover that Postgres includes schema changes in transactions - if you begin one, create a table and then rollback, the table goes away. It works for adding and removing columns as well. Obviously this is very nice.

我们即将对依赖此功能的架构增量的部署方式进行一些更改.在此之前,我想了解交易保证的延伸范围,但我在文档中找不到任何相关信息.我假设我只是使用了错误的搜索词 - 我的搜索只是转到包含交易"、创建"和表格"等词的大命令列表.

We're about to make some changes to the way we deploy schema deltas that rely on this feature. Before we do, I'd like to find out how far the transactional guarantee extends, but I can't find any information on it in the documentation. I assume I'm just using the wrong search terms - my searches just go to big lists of commands which include the words 'transaction', 'create' and 'table'.

谁能给我一些有关 Postgres 中事务架构更改的文档或讨论的指针?(我们使用的是 8.2.13,虽然我们会在不久的将来升级.)或者只是一些不会包含在交易中的声明的细节?

Can anyone give me some pointers to docs or discussions about transactional schema changes in Postgres? (We're using 8.2.13, although we'll be upgrading in the not too distant future.) Or just some details about statement that won't be included in the transaction?

推荐答案

根据quick grep on docs,这些命令不能在事务中执行:

According to quick grep on docs, these commands cannot be executed in transactions:

  • 集群
  • 提交准备
  • 创建数据库
  • 创建表空间
  • 丢弃
  • 删除数据库
  • 删除表空间
  • 准备回滚
  • 真空

这篇关于对事务内 PostgreSQL 模式更改的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆