pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Randall Perry <rgp@systame.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: how to use $result->ruseltStatus
Date: Mon, 07 May 2001 22:56:59 -0400
Message-ID: <26908.989290619@sss.pgh.pa.us> (raw)
In-Reply-To: <B71CCE41.B1D3%rgp@systame.com>
References: <B71CCE41.B1D3%rgp@systame.com>

Randall Perry <rgp@systame.com> writes:
> I want to make sure queries returned aren't empty.

Check the number of rows returned (after checking for OK
resultStatus).

> But it returns '2' (not sure which constant it is, but it's not
> PGRES_EMPTY_QUERY) on empty queries.

PGRES_EMPTY_QUERY means you sent an empty string as the query, eg
	$conn->exec("");
This is pretty useless, and is distinguished only for historical
reasons...

			regards, tom lane



view thread (2+ messages)

Message-ID: <26908.989290619@sss.pgh.pa.us>
Permalink:  ../26908.989290619@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26908.989290619@sss.pgh.pa.us

 · 

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: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rgp@systame.com
  Subject: Re: how to use $result->ruseltStatus
  In-Reply-To: <26908.989290619@sss.pgh.pa.us>

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

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