create-postgres.sql 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. BEGIN;
  2. CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
  3. CREATE TABLE World (
  4. id integer NOT NULL,
  5. randomNumber integer NOT NULL default 0,
  6. PRIMARY KEY (id)
  7. );
  8. GRANT ALL PRIVILEGES ON World to benchmarkdbuser;
  9. INSERT INTO World (id, randomnumber)
  10. SELECT x.id, least(floor(random() * 10000 + 1), 10000) FROM generate_series(1,10000) as x(id);
  11. CREATE TABLE Fortune (
  12. id integer NOT NULL,
  13. message varchar(2048) NOT NULL,
  14. PRIMARY KEY (id)
  15. );
  16. GRANT ALL PRIVILEGES ON Fortune to benchmarkdbuser;
  17. INSERT INTO Fortune (id, message) VALUES (1, 'fortune: No such file or directory');
  18. INSERT INTO Fortune (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');
  19. INSERT INTO Fortune (id, message) VALUES (3, 'After enough decimal places, nobody gives a damn.');
  20. INSERT INTO Fortune (id, message) VALUES (4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
  21. INSERT INTO Fortune (id, message) VALUES (5, 'A computer program does what you tell it to do, not what you want it to do.');
  22. INSERT INTO Fortune (id, message) VALUES (6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
  23. INSERT INTO Fortune (id, message) VALUES (7, 'Any program that runs right is obsolete.');
  24. INSERT INTO Fortune (id, message) VALUES (8, 'A list is only as strong as its weakest link. — Donald Knuth');
  25. INSERT INTO Fortune (id, message) VALUES (9, 'Feature: A bug with seniority.');
  26. INSERT INTO Fortune (id, message) VALUES (10, 'Computers make very fast, very accurate mistakes.');
  27. INSERT INTO Fortune (id, message) VALUES (11, '<script>alert("This should not be displayed in a browser alert box.");</script>');
  28. INSERT INTO Fortune (id, message) VALUES (12, 'フレームワークのベンチマーク');
  29. CREATE TABLE "World" (
  30. id integer NOT NULL,
  31. randomNumber integer NOT NULL default 0,
  32. PRIMARY KEY (id)
  33. );
  34. GRANT ALL PRIVILEGES ON "World" to benchmarkdbuser;
  35. INSERT INTO "World" (id, randomnumber)
  36. SELECT x.id, least(floor(random() * 10000 + 1), 10000) FROM generate_series(1,10000) as x(id);
  37. CREATE TABLE "Fortune" (
  38. id integer NOT NULL,
  39. message varchar(2048) NOT NULL,
  40. PRIMARY KEY (id)
  41. );
  42. GRANT ALL PRIVILEGES ON "Fortune" to benchmarkdbuser;
  43. INSERT INTO "Fortune" (id, message) VALUES (1, 'fortune: No such file or directory');
  44. INSERT INTO "Fortune" (id, message) VALUES (2, 'A computer scientist is someone who fixes things that aren''t broken.');
  45. INSERT INTO "Fortune" (id, message) VALUES (3, 'After enough decimal places, nobody gives a damn.');
  46. INSERT INTO "Fortune" (id, message) VALUES (4, 'A bad random number generator: 1, 1, 1, 1, 1, 4.33e+67, 1, 1, 1');
  47. INSERT INTO "Fortune" (id, message) VALUES (5, 'A computer program does what you tell it to do, not what you want it to do.');
  48. INSERT INTO "Fortune" (id, message) VALUES (6, 'Emacs is a nice operating system, but I prefer UNIX. — Tom Christaensen');
  49. INSERT INTO "Fortune" (id, message) VALUES (7, 'Any program that runs right is obsolete.');
  50. INSERT INTO "Fortune" (id, message) VALUES (8, 'A list is only as strong as its weakest link. — Donald Knuth');
  51. INSERT INTO "Fortune" (id, message) VALUES (9, 'Feature: A bug with seniority.');
  52. INSERT INTO "Fortune" (id, message) VALUES (10, 'Computers make very fast, very accurate mistakes.');
  53. INSERT INTO "Fortune" (id, message) VALUES (11, '<script>alert("This should not be displayed in a browser alert box.");</script>');
  54. INSERT INTO "Fortune" (id, message) VALUES (12, 'フレームワークのベンチマーク');
  55. COMMIT;