Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Notices on transactions #2443

Merged
merged 8 commits into from
Jan 18, 2024
Merged

feat: Notices on transactions #2443

merged 8 commits into from
Jan 18, 2024

Conversation

scsmithr
Copy link
Member

@scsmithr scsmithr commented Jan 18, 2024

Emit notices on transaction commands warning about our incomplete transaction support.

psql:

sean@Seans-Air glaredb % psql postgres://localhost:6543
psql (15.4, server 15.1)
Type "help" for help.

sean=> begin;
WARNING:  GlareDB does not support proper transactional semantics. Do not rely on transactions for correctness. Transactions are stubbed out to enable compatability with existing Postgres tools.
BEGIN
sean=> 

CLI (colorful):
Screenshot 2024-01-18 at 2 26 37 PM

Some pg protocol tests added to assert the notices.

@scsmithr scsmithr marked this pull request as ready for review January 18, 2024 20:31
// messages interspersed with the output would be
// annoying.
for notice in self.sess.drain_notices() {
println!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want to write to stderr?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could. Since this is in the interactive portion, I don't know that it matters. But we could also move this to the execute func and eprintln there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

stderr feels right for this kind of thing, (if only because it makes it easier to write scripts.) but this doesn't need to block.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

crates/pgrepr/src/error.rs Show resolved Hide resolved
crates/sqlexec/src/context/local.rs Outdated Show resolved Hide resolved
crates/sqlexec/src/context/local.rs Show resolved Hide resolved
@scsmithr scsmithr enabled auto-merge (squash) January 18, 2024 21:20
@scsmithr scsmithr merged commit 52870e9 into main Jan 18, 2024
19 of 20 checks passed
@scsmithr scsmithr deleted the sean/tx-notice branch January 18, 2024 21:22
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.

None yet

2 participants