public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alvaro Herrera <[email protected]>
To: Michael Paquier <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Use more CppAsString2() in pg_amcheck.c
Date: Fri, 18 Oct 2024 15:18:26 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 2024-Oct-18, Michael Paquier wrote:

> pg_amcheck.c is one of these places where relkind and relpersistence
> values are hardcoded in queries based on the contents of pg_class_d.h.
> Similarly to other places in src/bin/, let's sprinkle some
> CppAsString2() and feed to the binary the values from the header.  The
> patch attached does that.

Hmm, aren't you losing the single quotes?  I think you would need to do

> @@ -857,7 +858,7 @@ prepare_heap_command(PQExpBuffer sql, RelationInfo *rel, PGconn *conn)
>  
>  	appendPQExpBuffer(sql,
>  					  "\n) v WHERE c.oid = %u "
> -					  "AND c.relpersistence != 't'",
> +					  "AND c.relpersistence != '%s'",
>  					  rel->reloid, CppAsString2(RELPERSISTENCE_TEMP));

in order for this to work properly, no?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"La vida es para el que se aventura"






view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Use more CppAsString2() in pg_amcheck.c
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox