Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbZMI-002feX-0W for pgsql-novice@arkaria.postgresql.org; Mon, 22 Jun 2026 07:46:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbZMG-004v1V-2k for pgsql-novice@arkaria.postgresql.org; Mon, 22 Jun 2026 07:46:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbZMG-004v1M-1Y for pgsql-novice@lists.postgresql.org; Mon, 22 Jun 2026 07:46:16 +0000 Received: from mx1.alte-leipziger.de ([91.217.145.231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wbZME-00000001ilQ-0DPM for pgsql-novice@lists.postgresql.org; Mon, 22 Jun 2026 07:46:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alte-leipziger.de; i=@alte-leipziger.de; q=dns/txt; s=alteleipziger; t=1782114374; x=1813650374; h=from:to:subject:date:message-id:mime-version; bh=y0X7Pcz9wRcnrAdkLVup8IQRY1bqP/mBrA+CJcBXwJA=; b=G+Vi7SJrvqSTPXiNcW9x6HIg+vUuGjF3NtQYQJw2Mot1sTMOEMmg4KAl iBJ9ZJ0ll5Io9C//dsES0t44CLhGYe1KW2xOI3qt9bVlDrsGv6LAgDQTJ M1bRg345ZXYOxBSQpfaVXiyR7JGAkS1e8UmVRZkD/aJE1UDTm2MUVQz68 L9vPSL7bNIQbBm65ah7wnrvR4SydwP2PUTlzNjFgfmlsuwZS/opTYZXxx MGVpKzDJEMzKj755Mr62/YHw8ZpZrmJiHswyCajDbsuMUkab0prZKiyUj HBOSjUkFAOhtDl0Ez29AVojfJGIhz2cfkSvt3yfI04C/3O9w7TYOIgQGj g==; X-CSE-ConnectionGUID: wbQ29YkaR6yE0wU4E7nSnw== X-CSE-MsgGUID: YKJ6LbieTniCtlDkD29AAw== From: "Subramanian,Ramachandran" To: "pgsql-novice@lists.postgresql.org" Subject: How to surround a selected value with double quotes? Thread-Topic: How to surround a selected value with double quotes? Thread-Index: Ad0CGjLZc68UgeuQTxS/vjhaBUNfBA== Date: Mon, 22 Jun 2026 07:46:09 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmase-matchedrid: J3bBwanRu+HsHKZ3sUaiXLAdecdWQCzFvZc1RlmploAPm15xyht8lVel aAlLiT0Jv3pb8/UKTEkoyCbI4zNuHOedd2tCwrmUVc6oxg15iGa2FEUBwKd8yl4yPTk3oXKqiCN refKlWsqi1mfLEHZcM2G9ENAfF/dKrt+kTj/51lk= x-tm-as-user-approved-sender: No x-tm-as-user-blocked-sender: No x-tmase-result: 10--5.726600-8.000000 x-tm-snts-smtp: 2800DEFA3A306F9396168B87E50D7852B878966108108AB0811F385038F778712000:8 x-alsentwithgood: false Content-Type: multipart/alternative; boundary="_000_b91203df511b42c6850ec55c84ab6525alteleipzigerde_" MIME-Version: 1.0 X-GBS-PROC: 4CJLfqUnsgHWfeqPKbZTdcI7gRPXNYJZUco5D9hzCGB9WNaw+TqYZ53ERxIc6YI/ X-GBS-PROCJOB: =?utf-8?Q?iuc9L886qAMgjpEq+9zD66UyjEaRuEpXgXxix2KljOFOolv/jTPdjv/crX6K?= =?utf-8?Q?rZc/4uBl0VP4pVZJTqPmtNFdny4si2I3BUW6rM2fKvAIpdIeu7HyLhuKI2NW?= =?utf-8?Q?YOUbvR3EcVHk2DHCzb1qWzi33ZGGKDNJrs2kQupciou0oA/0qEg=3D?= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_b91203df511b42c6850ec55c84ab6525alteleipzigerde_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I wrote a script to analyze and run vacuum on tables that need it. Sadly at the time I wrote the script, I never expected a schema name to b= e pure numbers. So my Script does not work now. I want to add double quote marks to each schema name and table name selec= t. I tried using the CONCAT function, but it does not work as I expected = it to. I would be grateful if someone can help me understand the mistake I am ma= king with the CONCAT. Regards Ram The table 7464128.locale_7464128 in database data listening on port 5432 = with size 303104 must be vacuumed . It has a XID gap of 5616 Use the command psql -p 5432 -d data -c =22 vacuum freeze 7464128.locale_= 7464128=22 ERROR: trailing junk after numeric literal at or near =227464128.locale_= 7464128=22 LINE 1: vacuum freeze analyze 7464128.locale_7464128 ^ data=3D# =5Cdt *.locale_7464128 List of relations Schema | Name | Type | Owner ---------+----------------+-------+---------- 7464128 | locale_7464128 | table | postgres (1 row) data=3D# vacuum freeze analyze 7464128.locale_7464128 ; ERROR: trailing junk after numeric literal at or near =227464128.locale_= 7464128=22 LINE 1: vacuum freeze analyze 7464128.locale_7464128 ; ^ data=3D# vacuum freeze analyze =227464128=22.=22locale_7464128=22 ; VACUUM data=3D# =5Cq #Build the SQL needed to get the list of tables that are approaching the = SAFE_XID_GAP LIST_OLDEST_UNFROZEN_XID_SQL=3D=22 SELECT =5C cast (age(PGCL.relfrozenxid) as integer) as GAP, =5C INTB.table_catalog as DB_NAME, =5C =22$PORT_NO=22 , =5C CONCAT(=27=22=27,INTB.table_schema,=27=22=27) || =27.=27 || =5C CONCAT(=27=22=27,PGCL.relname,=27=22=27) as TABLE_NAME, =5C pg_table_size(PGCL.oid) as TABLE_SIZE =5C FROM =5C pg_class PGCL, =5C information_schema.tables INTB =5C WHERE =5C PGCL.relname=3DINTB.table_name =5C AND =5C PGCL.relkind=3D=27r=27 =5C AND =5C age(PGCL.relfrozenxid) > =22$SAFE_XID_GAP=22 =5C ORDER BY =5C 1 DESC ;=22 Freundliche Gr=FC=DFe i. A. Ramachandran Subramanian Zentralbereich Informationstechnologie Alte Leipziger Lebensversicherung a.G. Hallesche Krankenversicherung a.G. Alte Leipziger Lebensversicherung a.G., Alte Leipziger-Platz 1, 61440 Obe= rursel Vors. des Aufsichtsrats: Dr. Walter Botermann =B7 Vorstand: Christoph Boh= n (Vors.), Dr. J=FCrgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Joche= n Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcs= ek Sitz Oberursel (Taunus) =B7 Rechtsform VVaG =B7 Amtsgericht Bad Homburg v= . d. H. HRB 1583 =B7 USt.-IdNr. DE 114106814 =20 Hallesche Krankenversicherung a.G., L=F6ffelstra=DFe 34-38, 70597 Stuttg= art Vors. des Aufsichtsrats: Dr. Walter Botermann =B7 Vorstand: Christoph Boh= n (Vors.), Dr. J=FCrgen Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Joche= n Kriegmeier, Alexander Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek Sitz Stuttgart =B7 Rechtsform VVaG =B7 Amtsgericht Stuttgart HRB 2686 = =B7 USt.-IdNr. DE 147802285 Beitr=E4ge zu privaten Kranken- und Pflegekrankenversicherungen unterlieg= en nicht der Versicherungsteuer (=A7 4 Nr. 5 VersStG) =B7 Versicherungsle= istungen sowie Ums=E4tze aus Versicherungsvertreter-/Maklert=E4tigkeiten = sind umsatzsteuerfrei =20 =20 Die Pflichtangaben der ALH Gruppe gem=E4=DF =A7 35a GmbHG bzw. =A7 80 Akt= G finden Sie hier: https://www.alte-leipziger.de/impressum=20 ______________________ ALH Gruppe Alte Leipziger-Platz 1, 61440 Oberursel Tel.: +49 (6171) 66-4882 Fax: +49 (6171) 66-800-4882 E-Mail: ramachandran.subramanian@alte-leipziger.de www.alte-leipziger.de www.hallesche.de --_000_b91203df511b42c6850ec55c84ab6525alteleipzigerde_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hello,

 

  I wrote a script to analyze and run vac= uum on tables that need it. 

 

Sadly at the time I wrote the script, I never = expected a schema name to be pure numbers. 

 

So my Script does not work now.

 

I want to add double quote marks to each schem= a name and table name select. I tried using the CONCAT function, but it d= oes not work as I expected it to.

 

I would be grateful if someone can help me und= erstand the mistake I am making with the CONCAT.

 

Regards

 

Ram

 

 

The table 7464128.locale_7464128 in database d= ata listening on port 5432 with size 303104 must be vacuumed . It has a X= ID gap of 5616

Use the command psql -p 5432 -d data -c "= vacuum freeze 7464128.locale_7464128"

ERROR:  trailing junk after numeric liter= al at or near "7464128.locale_7464128"

LINE 1:  vacuum freeze analyze 7464128.lo= cale_7464128

 

 

       &nbs= p;            = ;          ^

data=3D# =5Cdt *.locale_7464128

       &nbs= p;      List of relations

Schema  |      N= ame      | Type  |  Owner

---------+----------------+-------+= ;----------

7464128 | locale_7464128 | table | postgres

(1 row)

 

data=3D# vacuum freeze analyze 7464128.locale_= 7464128 ;

ERROR:  trailing junk after numeric liter= al at or near "7464128.locale_7464128"

LINE 1: vacuum freeze analyze 7464128.locale_7= 464128 ;

       &nbs= p;            = ;          ^

data=3D# vacuum freeze analyze "7464128&q= uot;."locale_7464128" ;

VACUUM

data=3D# =5Cq

 

 

#Build the SQL needed to get the list of table= s that are approaching the SAFE_XID_GAP

LIST_OLDEST_UNFROZEN_XID_SQL=3D" SELECT&n= bsp;  =5C

       cast (age= (PGCL.relfrozenxid) as integer) as GAP, =5C

       INTB.tabl= e_catalog as DB_NAME,   =5C

       "$PO= RT_NO" , =5C

       CONCAT(=27&quo= t;=27,INTB.table_schema,=27"=27) || =27.=27 ||  =5C<= /span>

 &= nbsp;     CONCAT(=27"=27,PGCL.relname,=27"= =27) as TABLE_NAME,      =5C=

       pg_table_= size(PGCL.oid) as TABLE_SIZE =5C

FROM       =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p; =5C

      pg_class PGCL,&= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;    =5C

      information_sch= ema.tables INTB         &nbs= p;            = ;   =5C

WHERE       = ;            =             &= nbsp;           &n= bsp;            = =5C

     PGCL.relname=3DINTB.t= able_name          &nbs= p;            = ;     =5C

AND       &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;  =5C

     PGCL.relkind=3D=27r= =27           &nbs= p;            = ;            =    =5C

AND       &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;  =5C

     age(PGCL.relfrozenxid= )  > "$SAFE_XID_GAP" =5C

ORDER BY      &n= bsp;           &nb= sp;           &nbs= p;            = ;         =5C

        1 D= ESC ;"


Freundliche Gr=FC=DFe


i. A. Ramachandran Subrama= nian =20

Zentralbereich Informationst= echnologie

=20

Alte Leipziger Lebensversicherung a. G.<= /SPAN>

Hallesche Krankenversicherung a. G.

=20

______________________

ALH Gruppe
Alte Leipziger-Platz 1, 614= 40 Oberursel
Tel: +49 (6171) 66-4882
Fax: +49 (6171) 66-800-4882E-Mail: ramachandran.subramanian@alte-leipziger.de
www.alte-leipziger.de
www.hallesche.de

Alte Leipziger Lebensversich= erung a. G., Alte Leipziger-Platz 1, 61440 Oberursel

Vors. des Aufsichtsra= ts: Dr. Walter Botermann =B7 Vorstand: Christoph Bohn (Vors.), Dr. J=FCrg= en Bierbaum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexand= er Mayer, Christian Pape, Wiltrud Pekarek, Udo Wilcsek

Sitz Oberursel (Taunus) =B7 = Rechtsform VVaG =B7 Amtsgericht Bad Homburg v. d. H. HRB 1583 =B7 USt.-Id= Nr. DE 114106814


Hallesche Krankenversicherun= g a. G., L=F6ffelstra=DFe 34-38, 70597 Stuttgart

Vors. des Aufsichtsrats: Dr.= Walter Botermann =B7 Vorstand: Christoph Bohn (Vors.), Dr. J=FCrgen Bier= baum (stv. Vors.), Frank Kettnaker, Dr. Jochen Kriegmeier, Alexander Maye= r, Christian Pape, Wiltrud Pekarek, Udo Wilcsek

Sitz Stuttgart =B7 Rechtsfor= m VVaG =B7 Amtsgericht Stuttgart HRB 2686 =B7 USt.-IdNr. DE 147802285

Beitr=E4ge zu privaten Krank= en- und Pflegekrankenversicherungen unterliegen nicht der Versicherungste= uer (=A7 4 (1) Nr. 5 b VersStG) =B7 Versicherungsleistungen sowie Ums=E4t= ze aus Versicherungsvertreter-/Maklert=E4tigkeiten sind umsatzsteuerfrei<= /SPAN>


= Pflichtangaben der A= LH Gruppe gem=E4=DF =A7 35a GmbHG bzw. =A7 80 AktG --_000_b91203df511b42c6850ec55c84ab6525alteleipzigerde_--