I insert data to db (PostgreSQL) whith DB module
$I->haveInDatabase("pictograms_tags_uk-UA",{"id":289,"tag_url_title":"Hello tag_url_title","description":"Hello description"})
What do you get instead?
have error
[PDOException] SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "pictograms_tags_uk-ua" does not exist
Provide console output if related. Use -vvv mode for more details.
i use print_r in
/var/www/project-name/vendor/codeception/codeception/src/Codeception/Lib/Driver/Db.php:287
and see two query
first query:
[Query] INSERT INTO "pictograms_tags_uk-UA" ("id", "tag_url_title", "description") VALUES (?, ?, ?) [Parameters] [289,"Hello tag_url_title","Hello description"]
after this request comes the next
SELECT a.attname FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = 'pictograms_tags_uk-UA'::regclass AND i.indisprimary
Actual result:
there is an error in the second request "SELECT"
This query use:
WHERE i.indrelid = 'pictograms_tags_uk-UA'::regclass
Expected Result
if table name contain sign "-"
need use double quotes
WHERE i.indrelid = "pictograms_tags_uk-UA"::regclass
The first request for insert was executed correctly, the data appeared in the table, but immediately after the second request an error occurs
Details
Codeception version: 3.1.2 (tried version 4 have same result)
Hello
What are you trying to achieve?
I insert data to db (PostgreSQL) whith DB module
$I->haveInDatabase("pictograms_tags_uk-UA",{"id":289,"tag_url_title":"Hello tag_url_title","description":"Hello description"})
What do you get instead?
have error
[PDOException] SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "pictograms_tags_uk-ua" does not exist
My debag
i use print_r in
/var/www/project-name/vendor/codeception/codeception/src/Codeception/Lib/Driver/Db.php:287
and see two queryfirst query:
[Query] INSERT INTO "pictograms_tags_uk-UA" ("id", "tag_url_title", "description") VALUES (?, ?, ?) [Parameters] [289,"Hello tag_url_title","Hello description"]
after this request comes the next
SELECT a.attname FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = 'pictograms_tags_uk-UA'::regclass AND i.indisprimary
Actual result: there is an error in the second request "SELECT" This query use: WHERE i.indrelid = 'pictograms_tags_uk-UA'::regclass
Expected Result if table name contain sign "-" need use double quotes WHERE i.indrelid = "pictograms_tags_uk-UA"::regclass
The first request for insert was executed correctly, the data appeared in the table, but immediately after the second request an error occurs
Details
composer show
)P.S. Sorry for my English...