mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-27 02:36:29 +00:00
copy support
This commit is contained in:
16
README.md
16
README.md
@@ -13,16 +13,24 @@ Meow. PgBouncer rewritten in Rust, with sharding, load balancing and failover su
|
|||||||
|
|
||||||
1. Session mode.
|
1. Session mode.
|
||||||
2. Transaction mode (basic).
|
2. Transaction mode (basic).
|
||||||
|
3. `COPY` protocol support.
|
||||||
|
|
||||||
## Missing
|
## Missing
|
||||||
|
|
||||||
1. `COPY` support.
|
1. Query cancellation support.
|
||||||
2. Query cancellation support.
|
2. All the features I promised above. Will make them soon, promise :-).
|
||||||
3. All the features I promised above. Will make them soon, promise :-).
|
3. Authentication, ehem, this proxy is letting anyone in at the moment.
|
||||||
4. Authentication, ehem, this proxy is letting anyone in at the moment.
|
|
||||||
|
|
||||||
## Benchmarks
|
## Benchmarks
|
||||||
|
|
||||||
|
You can setup PgBench locally through PgCat:
|
||||||
|
|
||||||
|
```
|
||||||
|
pgbench -h 127.0.0.1 -p 5433 -i
|
||||||
|
```
|
||||||
|
|
||||||
|
Coincidenly, this uses `COPY` so you can test if that works.
|
||||||
|
|
||||||
### PgBouncer
|
### PgBouncer
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -182,6 +182,26 @@ impl Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CopyData
|
||||||
|
'd' => {
|
||||||
|
// Forward the data to the server,
|
||||||
|
// don't buffer it since it can be rather large.
|
||||||
|
server.send(original).await?;
|
||||||
|
}
|
||||||
|
|
||||||
|
'c' | 'f' => {
|
||||||
|
// Copy is done.
|
||||||
|
server.send(original).await?;
|
||||||
|
let response = server.recv().await?;
|
||||||
|
match write_all_half(&mut self.write, response).await {
|
||||||
|
Ok(_) => (),
|
||||||
|
Err(err) => {
|
||||||
|
server.mark_bad();
|
||||||
|
return Err(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
println!(">>> Unexpected code: {}", code);
|
println!(">>> Unexpected code: {}", code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ impl Server {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CopyInResponse: copy is starting from client to server
|
||||||
|
'G' => break,
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
// Keep buffering,
|
// Keep buffering,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user