Skip to content

sql: name the transaction settings like PG does#20264

Merged
knz merged 2 commits intocockroachdb:masterfrom
knz:20171126-rename-vars
Nov 27, 2017
Merged

sql: name the transaction settings like PG does#20264
knz merged 2 commits intocockroachdb:masterfrom
knz:20171126-rename-vars

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Nov 26, 2017

Fixes #18506.

In PostgreSQL, the transaction isolation level is reported by the
session variable transaction_isolation (two words separated by an
underscore), not transaction isolation level (three words separated
by spaces). Also the iso level is reported in lowercase.

Clients actually care about this stuff.

This patch makes CockroachDB behave more like PG.

This also aligns transaction_priority and transaction_status
(CockroachDB extension) with transaction_isolation (PG standard
setting), for more consistency in UX.


Release note (sql): the session settings transaction isolation level, transaction priority and transaction status are now called
transaction_isolation, transaction_priority and
transaction_status for better compatibility with PostgreSQL.

@knz knz requested review from a team and benesch November 26, 2017 18:38
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz knz added the docs-todo label Nov 26, 2017
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Nov 26, 2017

Might want to cherry-pick to 1.1, what do you think?

@knz knz force-pushed the 20171126-rename-vars branch from a87ebb0 to ab26323 Compare November 26, 2017 23:56
In PostgreSQL, the transaction isolation level is reported by the
session variable `transaction_isolation` (two words separated by an
underscore), not `transaction isolation level` (three words separated
by spaces). Also the transaction level is reported in lowercase.

Clients actually care about this stuff.

This patch makes CockroachDB behave more like PG.

This also aligns `transaction_priority` and `transaction_status`
(CockroachDB extension) with `transaction_isolation` (PG standard
setting), for more consistency in UX.

Patch series: ["Just because you are unique does not mean you are
useful."](https://duckduckgo.com/?q=just+because+you+are+unique+does+not+mean+you+are+useful&iar=images)

----

Release note (sql): the session settings `transaction isolation
level`, `transaction priority` and `transaction status` are now called
`transaction_isolation`, `transaction_priority` and
`transaction_status` for better compatibility with PostgreSQL.
@knz knz requested a review from jordanlewis November 27, 2017 17:06
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Nov 27, 2017

@jordanlewis please let the first commit here inform your change in #20274.

@jordanlewis
Copy link
Copy Markdown
Member

:lgtm:


Reviewed 1 of 1 files at r1, 11 of 11 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


pkg/sql/vars.go, line 243 at r1 (raw file):

	},

	// CockroachDB extension (inspired from MySQL).

nit that's not worth another round of CI: inspired by, not from


Comments from Reviewable

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Nov 27, 2017

TFYR

@knz knz merged commit 224e860 into cockroachdb:master Nov 27, 2017
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Nov 27, 2017

Perhaps you can fix the grammar in your #20274 patch?

@knz knz deleted the 20171126-rename-vars branch November 27, 2017 17:19
@BrianSullivan1956
Copy link
Copy Markdown

New to the whole github thing.
How do I find the build this is in?

CCL v1.1.3 @ 2017/11/27 13:59:10 (go1.8.3)
o show transaction_isolation
returns
o pq: unknown variable: "transaction_isolation"

@benesch
Copy link
Copy Markdown
Contributor

benesch commented Nov 28, 2017

Afraid it's not in any release yet, but it'll be in the next 1.2 alpha release scheduled for December 4: #20272

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Nov 28, 2017

@jordanlewis do you reckon we should cherry pick this onto 1.1?

@jordanlewis
Copy link
Copy Markdown
Member

@knz yes. There is some danger because the casing of the settings changed, but if anyone was using those we would likely have heard complaints about the PG incompatibility already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants