Skip to content

Commit

Permalink
Quote randomNumber column in PostgreSQL schema
Browse files Browse the repository at this point in the history
The [test specs][] say that the `World` table has an `id` column and
`randomNumber` column (note the camelCasing).  Indeed, the
[PostgreSQL schema][] uses `randomNumber` in its `CREATE TABLE`
statement.  However, the `CREATE TABLE` statement does not quote the
column name, so PostgreSQL treats the name as if it were lowercase.

Also note that the PostgreSQL schema has `CREATE TABLE World` _and_
`CREATE TABLE "World"` statements.  Presumably, this is because the
former actually creates a `world` table because it too is not quoted.
(Whereas the latter actually creates a `World` table.)

This commit modifies the `CREATE TABLE "World"` statement to quote the
`randomNumber` column so that its camel case is preserved.

[test specs]: https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview
[PostgreSQL schema]: https://github.com/TechEmpower/FrameworkBenchmarks/blob/ddd09520c10926c0e2c73a005b1f79f5a68142a8/toolset/databases/postgres/create-postgres.sql
  • Loading branch information
jonathanhefner committed Jan 8, 2025
1 parent ddd0952 commit a8b7a0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toolset/databases/postgres/create-postgres.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ INSERT INTO Fortune (id, message) VALUES (12, 'フレームワークのベンチ

CREATE TABLE "World" (
id integer NOT NULL,
randomNumber integer NOT NULL default 0,
"randomNumber" integer NOT NULL default 0,
PRIMARY KEY (id)
);
GRANT ALL PRIVILEGES ON "World" to benchmarkdbuser;

INSERT INTO "World" (id, randomnumber)
INSERT INTO "World" (id, "randomNumber")
SELECT x.id, least(floor(random() * 10000 + 1), 10000) FROM generate_series(1,10000) as x(id);

CREATE TABLE "Fortune" (
Expand Down

0 comments on commit a8b7a0b

Please sign in to comment.