pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gianni Ceccarelli <dakkar@thenautilus.net>
To: pgsql-general@lists.postgresql.org
Cc: Matthias Apitz <guru@unixarea.de>
Subject: Re: DBI && INSERT
Date: Mon, 17 Feb 2020 16:15:40 +0000
Message-ID: <20200217161540.1a8d02e5@exelion> (raw)
In-Reply-To: <20200217154927.GA2720@c720-r342378>
References: <20200217154927.GA2720@c720-r342378>

On Mon, 17 Feb 2020 16:49:27 +0100
Matthias Apitz <guru@unixarea.de> wrote:
> I spend today some hours to nail down and insert problem into our
> database with DBI like:
> 
>    my $rc = $my_dbh->do($my_sqlstatement);
> 
> which returns 1 in $rc (which the following flow in our script took
> as an error).

The DBI docs say::

  $rows = $dbh->do($statement) or die $dbh->errstr;

so when ``do`` returns 1, it means it worked, not that it failed.

In particular:

    Returns the number of rows affected or "undef" on error. A return
    value of "-1" means the number of rows is not known, not
    applicable, or not available.

-- 
	Dakkar - <Mobilis in mobile>
	GPG public key fingerprint = A071 E618 DD2C 5901 9574
	                             6FE2 40EA 9883 7519 3F88
	                    key id = 0x75193F88






view thread (2+ messages)

Message-ID: <20200217161540.1a8d02e5@exelion>
Permalink:  ../20200217161540.1a8d02e5@exelion/
Also on:    postgresql.org/message-id/20200217161540.1a8d02e5@exelion

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: dakkar@thenautilus.net, guru@unixarea.de
  Subject: Re: DBI && INSERT
  In-Reply-To: <20200217161540.1a8d02e5@exelion>
  References: <20200217154927.GA2720@c720-r342378> <20200217161540.1a8d02e5@exelion>

* 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