tty1
  5   ˆl–äY>” ”¾R( 	ÅýÀ‚à„¦-ÿ�þB gãq°HÞwùÃƒh¹ÂÁÀ      4:0
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ä557_‘I|¥‰ÓMdœv ©ƒ†ü+=ÄÃ -    ‹      Å•]oÚ0…ïû+<_ì.y“@W•:™:‚44
ˆ2MÓ´b5‰#Û�Ò_?C@d¬Të¶›ø#'ösŽ_9äM<êN¿Ž{èãôn€ÆŸ?ú]„€/­.@<�ëm×ózCŒpjLÙ¨ªÊ­Z®T˜N 5yÖm”HŒËÃÑÙÌEˆ¤œ2Û"b„ÉxÔ/DrŽ@.�Œû0™kÐ¼`s‘q—ñ\º©v)K»“‰v´Îöj»ÝZã+HRª Ý¹¼½œÙIÃs(MþØ³n{jË;(2“l½aõÿ+—Ý~�mñ6]“¢ÍÄ¢±‘%ŽˆÈH«$Ä Yh˜e´xpbŽÍLˆ¿õ»£ïV&Ý|ŠRÅç!~ß‡7£0ÆÑ�æœ =®¹³š[¨6(—LÌg'Å÷µø^<�^0®51×‰¥²8HÁZlZMd¦Kj½^Z©jªj	{.šüÆøvÒNãþ¤Ž„m–8ÐýËSÆÑ˜*^Å#ÕzCÍô¶˜éòf?D;“J,Rƒ#„tTù‚d–ÅC!«¢Žþh,ÖŽì£	øQàï?p¼ ^Ço!tBh/�OŠ>—ãªI~ê@KYqe£®ÛóøýëNpšÿ5¢?Ÿ¿Y.‡þ³>|§å!ÿªÓ¾ú«>^PBK¾²µŽ£º}¿/¤3ïØÝ®¶w>�úÿôzÉ•	    7   	ˆl–Ãa¾”*i?u8 Y¸î41hß�þDô¡YÇ 'št’ºÈüÿÇ„x?ÆÅÄ (ñ    	#!/usr/bin/perl
# Call a PostgreSQL client program with the version, cluster and default
# database specified in ~/.postgresqlrc or
# /etc/postgresql-common/user_clusters.
#
# (C) 2005-2009 Martin Pitt <mpitt@debian.org>
# (C) 2013-2022 Christoph Berg <myon@debian.org>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

use warnings;
use strict;
use POSIX;
use PgCommon;

my ($version, $cluster);
my $explicit_host = exists $ENV{PGHOST};
my $explicit_port = $ENV{PGPORT};
my $explicit_service = exists $ENV{PGSERVICE};

# Evaluate PGCLUSTER (unless PGHOST is set as well)
if (exists $ENV{'PGCLUSTER'} and not $explicit_host) {
    ($version, $cluster) = split ('/', $ENV{'PGCLUSTER'}, 2);
    error "Invalid version $version specified in PGCLUSTER" unless version_exists $version;
    error 'No cluster specified with $PGCLUSTER' unless $cluster;
}

# Check for --cluster argument and filter it out
for (my $i = 0; $i <= $#ARGV; ++$i) {
    last if $ARGV[$i] eq '--';

    if ($ARGV[$i] eq '--cluster') {
        error '--cluster option needs an argument (<version>/<cluster>)' if ($i >= $#ARGV);

        ($version, $cluster) = split ('/', $ARGV[$i+1], 2);
        error "Invalid version $version specified with --cluster" unless version_exists $version;
        error 'No cluster specified with --cluster' unless $cluster;

        splice @ARGV, $i, 2;
        last;
    } elsif ($ARGV[$i] =~ /^--cluster=(\d+\.?\d)\/(.+)/) {
        ($version, $cluster) = ($1, $2);
        error "Invalid version $version specified with --cluster" unless version_exists $version;
        error 'No cluster specified with --cluster' unless $cluster;

        splice @ARGV, $i, 1;
        last;
    }
    # --host or -h on command line, drop info from PGCLUSTER
    if ($ARGV[$i] =~ /^--host\b/ || $ARGV[$i] =~ /^-\w*h\w*$/) {
        ($version, $cluster) = (undef, undef);
        $explicit_host = 1;
        delete $ENV{PGCLUSTER};
    }
    # --port or -p on command line
    if ($ARGV[$i] =~ /^--port\b(?:=(\d+))?/ || $ARGV[$i] =~ /^-\w*p(\d+)?$/) {
        if (defined $1) {
            $explicit_port = $1;
        } elsif ($i < $#ARGV) {
            $explicit_port = $ARGV[$i+1];
        }
    }
    # "service=" in connection string
    if ($ARGV[$i] =~ /\bservice=/) {
        $explicit_service = 1;
    }
}

# if only a port is specified, look for local cluster on specified port
if ($explicit_port and not $version and not $cluster and not $explicit_host and not $explicit_service) {
    LOOP: foreach my $v (reverse get_versions()) {
        foreach my $c (get_version_clusters $v) {
            my $p = get_cluster_port $v, $c;
            if ($p eq $explicit_port) {
                $version = $v;
                # set PGCLUSTER variable for information
                $ENV{PGCLUSTER} = "$version/$c";
                last LOOP;
            }
        }
    }
}

# if 