0

I am getting error like "pgbench: fatal: could not count number of branches: ERROR: relation "pgbench_branches" does not exist" when i ran the commmand "pgbench -c 20 -t 1000 -C -f d:\test_postgres\script.sql -p 5432 -U postgres -S Shiftlog" in windows command prompt.

-c is number of current clients
-t number of transactions per clients
-C Close the connection afer every transaction
-f run/execute the specified file
-p Port number of postgre instance
-S Database name in the postgre instance

I haven't stored the pgbench tables in my db(i.e. Shiftlog). Because i don't know the process to get these tables in windows postgres environment. Even though i specified the script file why pgbench is using the TPC-B file for the excurtion?.

D:\test_postgres>pgbench -c 20 -t 1000 -C -f d:\test_postgres\script.sql -p 5432 -U postgres -S Shiftlog
Password:
pgbench (14.5)
pgbench: fatal: could not count number of branches: ERROR:  relation "pgbench_branches" does not exist
LINE 1: select count(*) from pgbench_branches
                             ^
pgbench: Perhaps you need to do initialization ("pgbench -i") in database "Shiftlog"

D:\test_postgres>

Could you please help me to resolve this problem. Thank you so much for your support. Please check below image for the commands of sql script file.

enter image description here

Progman
  • 16,827
  • 6
  • 33
  • 48
  • "-S Database name in the postgre instance" That is not what `-S` does. – jjanes Nov 20 '22 at 14:42
  • Thank you for reply @jjanes. What you said is corrrect. -S behaviour is as following. -S select-only. Run built-in select-only script. Once i change query as like below I could be able to run the following command in cmd. **pgbench -c 20 -t 10 -C -f d:\test_postgres\script.sql -p 5432 -U postgres Shiftlog** I am getting following warrings in command prompt. If you have any idea please let me know how can i avoide the followng warrnings. pgbench (14.5) starting vacuum...pgbench: error: ERROR: relation "pgbench_branches" does not exist pgbench: (ignoring this error and – Pavuluri Satishbabu Nov 20 '22 at 17:34
  • If you specify `-n`, then it won't try to vacuum the default tables, and so won't generate the warning. – jjanes Nov 20 '22 at 19:15
  • Thank you @jjanes. After your suggestions. I am not getting the warrnings. It helped. – Pavuluri Satishbabu Nov 21 '22 at 11:22

0 Answers0