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 8748743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:34:44+00:00 2026-06-13T12:34:44+00:00

I can’t get information of that simple question over the PostgreSQL documentation, over the

  • 0

I can’t get information of that simple question over the PostgreSQL documentation, over the Web or even here on StackOverflow… I must not understand something essential here.

I am making a simple SELECT/UPDATE transaction in PostgreSQL:

START TRANSACTION;
SELECT "column" FROM "table" WHERE "criterion" = 'value' AND "activated" = true;
UPDATE "table" SET "activated" = false WHERE "criterion" = 'value';
COMMIT

Basically, I need to get the value of a column when its activated state is true and then deactivate it.
PostgreSQL tells me that there was a 1 row result that has been cancelled

The same happens if I do the following (basically the same transaction without the UPDATE statement):

START TRANSACTION;
SELECT "column" FROM "table" WHERE "criterion" = 'value' AND "activated" = true;
COMMIT

What don’t I understand about transactions? Can’t any SELECT output get out of a transaction block?

  • 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-13T12:34:45+00:00Added an answer on June 13, 2026 at 12:34 pm

    This will return all “column”‘s values from the updated rows:

    UPDATE "table" SET "activated" = false WHERE "criterion" = 'value' AND "activated" = true
    returning "column";
    

    There is no relation to the transaction.

    returning will return the values as if a select was issued:

    insert into foo (ticket, row, archived) values (3,7,true) returning *;
     ticket | row | archived 
    --------+-----+----------
          3 |   7 | t
    

    update foo
    set archived = true
    where not archived
    returning *;
     ticket | row | archived 
    --------+-----+----------
          2 |   5 | t
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I change the field public virtual ClassOne ClassOne { get; set; } to
Can any one tell, how to get the result of LINQ query contains group
Can we change the default action of the edit selected row button? Here is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Can't find information about JavaScript usage with Compass, in configuration i found an javascript_dir
Can we change the color of the divider? Apple documentations says, that we can
Can't seem to figure out what's wrong with the simple getJSON call below. It's
Can any one tell me clearly why ? Reading is simple in ArrayList,( we
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Can anybody shed some light on getDay() in Javascript please. Here datepicker is textbox

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.