microsoft / vscode-postgresql

PostgreSQL extension for VSCODE
Other
422 stars 53 forks source link

Cursor Fetch Default Size - Would be useful to adjust #91

Open orzom411 opened 3 years ago

orzom411 commented 3 years ago

Steps to Reproduce: Setup AWS Redshift Single Node

  1. Connect to single node RedShift instance.
  2. Try running any simple select statement (example provided with the plugin demonstrates the issue).

Connection to AWS RedShift single node to test this plug in. Was able to connect BUT can't run any query without wrapping it in a cursor (e.g. the example doesn’t even run) as the cursor limit for single node RedShift is 1k and this plugin appears to set it to 2k.

First, should note, issue with a simple select is it needs to be wrapped in a transaction, e.g. the error message one will get is:

cursors can only be used within the transaction that created them.

Instead:

begin transaction; select * from pg_user; rollback transaction;

Excerpt from the resulting message:

Fetch size 2000 exceeds the limit of 1000 for a single node configuration. Reduce the client fetch/cache size or upgrade to a multi node installation.