@@ -456,10 +456,10 @@ public function prepare(string $sql): PostgresStatement
456456 public function notify (string $ channel , string $ payload = "" ): PostgresResult
457457 {
458458 if ($ payload === "" ) {
459- return $ this ->query (\sprintf ("NOTIFY %s " , $ this ->quoteName ($ channel )));
459+ return $ this ->query (\sprintf ("NOTIFY %s " , $ this ->quoteIdentifier ($ channel )));
460460 }
461461
462- return $ this ->query (\sprintf ("NOTIFY %s, %s " , $ this ->quoteName ($ channel ), $ this ->quoteString ($ payload )));
462+ return $ this ->query (\sprintf ("NOTIFY %s, %s " , $ this ->quoteIdentifier ($ channel ), $ this ->quoteLiteral ($ payload )));
463463 }
464464
465465 public function listen (string $ channel ): PostgresListener
@@ -471,7 +471,7 @@ public function listen(string $channel): PostgresListener
471471 $ this ->listeners [$ channel ] = $ source = new Queue ();
472472
473473 try {
474- $ this ->query (\sprintf ("LISTEN %s " , $ this ->quoteName ($ channel )));
474+ $ this ->query (\sprintf ("LISTEN %s " , $ this ->quoteIdentifier ($ channel )));
475475 } catch (\Throwable $ exception ) {
476476 unset($ this ->listeners [$ channel ]);
477477 throw $ exception ;
@@ -499,14 +499,14 @@ private function unlisten(string $channel): void
499499 }
500500
501501 try {
502- $ this ->query (\sprintf ("UNLISTEN %s " , $ this ->quoteName ($ channel )));
502+ $ this ->query (\sprintf ("UNLISTEN %s " , $ this ->quoteIdentifier ($ channel )));
503503 $ source ->complete ();
504504 } catch (\Throwable $ exception ) {
505505 $ source ->error ($ exception );
506506 }
507507 }
508508
509- public function quoteString (string $ data ): string
509+ public function quoteLiteral (string $ data ): string
510510 {
511511 if ($ this ->handle === null ) {
512512 throw new \Error ("The connection to the database has been closed " );
@@ -515,7 +515,7 @@ public function quoteString(string $data): string
515515 return \pg_escape_literal ($ this ->handle , $ data );
516516 }
517517
518- public function quoteName (string $ name ): string
518+ public function quoteIdentifier (string $ name ): string
519519 {
520520 if ($ this ->handle === null ) {
521521 throw new \Error ("The connection to the database has been closed " );
0 commit comments