Skip to content

Commit 6ceb243

Browse files
fix: Quotes LISTEN queries
1 parent 5b75171 commit 6ceb243

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PostgresNIO/New/PostgresChannelHandler.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
594594
private func makeStartListeningQuery(channel: String, context: ChannelHandlerContext) -> PSQLTask {
595595
let promise = context.eventLoop.makePromise(of: PSQLRowStream.self)
596596
let query = ExtendedQueryContext(
597-
query: PostgresQuery(unsafeSQL: "LISTEN \(channel);"),
597+
query: PostgresQuery(unsafeSQL: "LISTEN \"\(channel)\";"),
598598
logger: self.logger,
599599
promise: promise
600600
)
@@ -642,7 +642,7 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
642642
private func makeUnlistenQuery(channel: String, context: ChannelHandlerContext) -> PSQLTask {
643643
let promise = context.eventLoop.makePromise(of: PSQLRowStream.self)
644644
let query = ExtendedQueryContext(
645-
query: PostgresQuery(unsafeSQL: "UNLISTEN \(channel);"),
645+
query: PostgresQuery(unsafeSQL: "UNLISTEN \"\(channel)\";"),
646646
logger: self.logger,
647647
promise: promise
648648
)

0 commit comments

Comments
 (0)