Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8337513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:19:35+00:00 2026-06-09T04:19:35+00:00

js and Postgres (using this module) and I would like to view the SQL

  • 0

js and Postgres (using this module) and I would like to view the SQL that has been executed after I have queried the database (as I’m using parameterised statements). Is there an easy way to do this?

For example, I execute code as follows:

var first = client.query("UPDATE settings SET json=$1 WHERE source_name=$2", [JSON.stringify(settings), 'website']);

first.on('end', function(result){
        console.log(result);
        client.end();               
});

Is there a method like result.lastQuery() that I can utilise as I can’t find anything like this in the docs? I’m having trouble getting my query to work and I’d like to debug it further.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:19:36+00:00Added an answer on June 9, 2026 at 4:19 am

    There appears to be no direct way to do this (if Postgres is like most database servers, the query, with parameter markers, is compiled into intermediate code and the actual parameters are bound later on, so there’s never any actual SQL text with the parameter values interpolated into it).

    This blog post might or might not be helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Postgres with Kohana 3's ORM module and would like to run a
I am porting an Oracle function into Postgres PGPLSQL.. I have been using this
I understand that using postgres on osx is a little difficult because it has
EDIT: I have been using Postgres with PostGIS for a few months now, and
I'm trying to do something like this in Progress SQL (THIS IS NOT POSTGRES!)
We are using the django-dbarray module to use arrays in postgres. I've been doing
I'm using the node-postgres module for node.js and I have a problem inserting data.
I have a 32-bit Windows/Qt application using Postgres plugin. Recently, I've been intrigued to
We have a legacy schema file which has the following column names, would like
I'm using Postgres and I'm trying to write a query like this: select count(*)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.