Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to see what is query id value, but in pgAdmin shows only $1.
Photo shows how it looks.
Capture.PNG | Failiem.lv.[^]

Code looks like:
C#
// Savienojums ar datu bāzi.
        readonly string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

        public void ProcessRequest(HttpContext context)
        {
            NpgsqlConnection con = new NpgsqlConnection(CS);
            if (!string.IsNullOrWhiteSpace(context.Request.QueryString["image_id"]))
            {
                string img_id = context.Request.QueryString["image_id"].ToString();
                con.Open();
                string sTSQL = "select image from images where image_id=@image_id";
                NpgsqlCommand cmd = new NpgsqlCommand(sTSQL, con);
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.AddWithValue("@image_id", img_id.ToString());
                object data = cmd.ExecuteScalar();
                con.Close();
                cmd.Dispose();
                context.Response.BinaryWrite((byte[])data);
            }


What I have tried:

I havent find answer how to make postgreslq pgadmin show the value..
Posted
Updated 21-Mar-22 6:26am
v2
Comments
Richard MacCutchan 21-Mar-22 6:29am    
Please use the Improve question link above, and add the original code that you are trying to run.
[no name] 21-Mar-22 6:36am    
Thank You i writed text!
Maciej Los 21-Mar-22 8:12am    
Sorry, but above code is not related to the question.
Do you want to see what value of parameter ($1) was passed to the query, am i right?
[no name] 21-Mar-22 8:26am    
Yes, i see in pgAdmin huge of clientRead but many of them dont show values only $1 and i dont know what data reads.
Maciej Los 21-Mar-22 8:32am    
Why do need to see it?

1 solution

Maybe you can use the log_statement config setting, see: PostgreSQL: Documentation: 14: 20.8. Error Reporting and Logging[^]

If you are not afraid of Perl (I am :) you might try pgBadger :: PostgreSQL log analyzer[^]

And here is an overview of other monitoring tools: Monitoring - PostgreSQL wiki[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900