Pg: Set appropriate quote_identifier for $conn->Q()

This commit is contained in:
Yorhel 2025-05-22 09:53:41 +02:00
parent 81a3d3c608
commit 2083ab2a6f
3 changed files with 27 additions and 2 deletions

View file

@ -127,6 +127,14 @@ subtest 'custom types', sub {
};
subtest 'identifier quoting', sub {
my $txn = $conn->txn;
$txn->exec('CREATE TEMPORARY TABLE fupg_test_tbl ("desc" int, ok int, "hello world" int)');
ok $txn->Q('INSERT INTO fupg_test_tbl', VALUES {desc => 5, ok => 10, 'hello world', 15})->exec;
is $txn->Q('SELECT', IDENT 'hello world', 'FROM fupg_test_tbl')->val, 15;
};
subtest 'vndbid', sub {
plan skip_all => 'type not loaded in the database' if !$conn->q("SELECT 1 FROM pg_type WHERE typname = 'vndbtag'")->val;