Skip to content

Commit 42825d7

Browse files
committed
bug fix
1 parent cf88546 commit 42825d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/flypg/admin/admin.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ type ReplicationSlot struct {
131131
}
132132

133133
func GetReplicationSlot(ctx context.Context, pg *pgx.Conn, slotName string) (*ReplicationSlot, error) {
134-
sql := fmt.Sprintf("SELECT slot_name, active, wal_status, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) AS retained_wal FROM pg_replication_slots where slot_name = %s;", slotName)
134+
sql := fmt.Sprintf("SELECT slot_name, active, wal_status, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) AS retained_wal FROM pg_replication_slots where slot_name = '%s';", slotName)
135135
row := pg.QueryRow(ctx, sql)
136136

137137
var slot ReplicationSlot
@@ -179,7 +179,6 @@ func ListReplicationSlots(ctx context.Context, pg *pgx.Conn) ([]ReplicationSlot,
179179

180180
func DropReplicationSlot(ctx context.Context, pg *pgx.Conn, name string) error {
181181
sql := fmt.Sprintf("SELECT pg_drop_replication_slot('%s');", name)
182-
183182
_, err := pg.Exec(ctx, sql)
184183
if err != nil {
185184
return err

0 commit comments

Comments
 (0)