create-postgres.sql 3.4 KB

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