Skip to content

Conversation

@ericharmeling
Copy link
Contributor

Fixes #8338.

@ericharmeling ericharmeling requested a review from otan October 15, 2020 16:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@cockroach-teamcity
Copy link
Member

`READ` | Set the transaction access mode to `READ ONLY` or `READ WRITE`. The current transaction access mode is also exposed as the [session variable](show-vars.html) `transaction_read_only`.<br><br>**Default**: `READ WRITE`
`AS OF SYSTEM TIME` | Execute the transaction using the database contents "as of" a specified time in the past.<br/><br/> The `AS OF SYSTEM TIME` clause can be used only when the transaction is read-only. If the transaction contains any writes, or if the `READ WRITE` mode is specified, an error will be returned.<br/><br/>For more information, see [AS OF SYSTEM TIME](as-of-system-time.html).<br/><br/>
`AS OF SYSTEM TIME` | Execute the transaction using the database contents "as of" a specified time in the past.<br/><br/> The `AS OF SYSTEM TIME` clause can be used only when the transaction is read-only. If the transaction contains any writes, or if the `READ WRITE` mode is specified, an error will be returned.<br/><br/>For more information, see [AS OF SYSTEM TIME](as-of-system-time.html).
`NOT DEFERRABLE`<br>`DEFERRABLE` | <span class="version-tag">New in v20.2:</span> This clause is a no-op, supported for compatibility with PostgreSQL.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think DEFERRABLE errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right you are! Fixed.

@ericharmeling ericharmeling force-pushed the deferrable-transaction branch from 139bef8 to 50dcadb Compare October 15, 2020 17:33
`READ` | Set the transaction access mode to `READ ONLY` or `READ WRITE`. The current transaction access mode is also exposed as the [session variable](show-vars.html) `transaction_read_only`.<br><br>**Default**: `READ WRITE`
`AS OF SYSTEM TIME` | Execute the transaction using the database contents "as of" a specified time in the past.<br/><br/> The `AS OF SYSTEM TIME` clause can be used only when the transaction is read-only. If the transaction contains any writes, or if the `READ WRITE` mode is specified, an error will be returned.<br/><br/>For more information, see [AS OF SYSTEM TIME](as-of-system-time.html).<br/><br/>
`AS OF SYSTEM TIME` | Execute the transaction using the database contents "as of" a specified time in the past.<br/><br/> The `AS OF SYSTEM TIME` clause can be used only when the transaction is read-only. If the transaction contains any writes, or if the `READ WRITE` mode is specified, an error will be returned.<br/><br/>For more information, see [AS OF SYSTEM TIME](as-of-system-time.html).
`NOT DEFERRABLE`<br>`DEFERRABLE` | <span class="version-tag">New in v20.2:</span> This clause is a no-op, supported for compatibility with PostgreSQL. `NOT DEFERRABLE` is the default behavior. `DEFERRABLE` returns an `unimplemented` error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returning an error isn't classified as a no-op i think. NOT DEFERABLE no-ops and is the default behaviour.`

otherwise LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Updated again. Thanks for iterating on this!

@cockroach-teamcity
Copy link
Member

@ericharmeling ericharmeling force-pushed the deferrable-transaction branch from 50dcadb to dcdaedf Compare October 15, 2020 17:49
@cockroach-teamcity
Copy link
Member

Copy link
Contributor

@lnhsingh lnhsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @lnhsingh and @otan)

@ericharmeling ericharmeling merged commit 5d28cb4 into master Oct 15, 2020
@ericharmeling ericharmeling deleted the deferrable-transaction branch October 15, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql: recognize the [NOT] DEFERRABLE SET TRANSACTION arguments

4 participants