Re: update count

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Chris Velevitch <chris(dot)velevitch(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: update count
Date: 2005-12-18 13:55:37
Message-ID: 2CA7EDA1-77BE-4AAE-B7A0-636064A527E3@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Dec 18, 2005, at 3:50 AM, Chris Velevitch wrote:

> (for v7.4.5) How do I get the number of rows updated by an update
> command?

In general, the UPDATE command tells you the number of updated rows:

Outputs

On successful completion, an UPDATE command returns a command tag of
the form

UPDATE count
The count is the number of rows updated. If count is 0, no rows
matched the condition (this is not considered an error).

http://www.postgresql.org/docs/8.1/interactive/sql-update.html

The actual details of getting this number depends on what client API
you are using to execute the UPDATE command.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2005-12-18 16:12:28 Re: is this a bug or I am blind?
Previous Message stig erikson 2005-12-18 13:02:49 sequence rollback?