Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g1AbM-00045a-Ur for pgsql-general@arkaria.postgresql.org; Sat, 15 Sep 2018 13:27:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g1AbI-00075r-NU for pgsql-general@arkaria.postgresql.org; Sat, 15 Sep 2018 13:27:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g1AbI-00075k-DF for pgsql-general@lists.postgresql.org; Sat, 15 Sep 2018 13:27:04 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g1AbF-0002qa-Co for pgsql-general@postgresql.org; Sat, 15 Sep 2018 13:27:03 +0000 Received: by mail-lf1-x12a.google.com with SMTP id z11-v6so10051329lff.9 for ; Sat, 15 Sep 2018 06:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VUohlUg+xYEDcBAWkML7BHN7Mr8jHg8U1s3ikrLHpjo=; b=ZnHmw8p/ulG95Xtbwb9pd+oVbaGPM35nOixGSlg5jBQ3WUQGSR3iOs2D5nmkdZz05X zrc9pHANM+ts6qSBpzDQ9T4AtGcFJIvHQtBP6egQexSfkdPtixS/vOGJ7xs4QqC9taix INN8dijsS8ubvVk8YWEUM52h1/lNdnHgz7+lTQuLF+XLb2VpwZSMAa8pDa+emZrWjFF8 KEw2BOeQJhSiYZYItsIYndg9ld3VvaZR5PA4uKYkVO/UJ09Y5bust0euNRTKCRGAPsx/ XKs8BVxXOBZPn0HkOKKN81c2ZVjgfOEAnDpTbQKDru3pZLmXx0IJk8o+tR4WUk0mm4l7 g0fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VUohlUg+xYEDcBAWkML7BHN7Mr8jHg8U1s3ikrLHpjo=; b=V7QbPMbjn8PitpwnorggWSoy8wkflu2sT942zVq8/KEQ3vZM+KF4UQnrTDatcWnh9U 0RSS+tuaYlg2eneKW/QWLeLczv+jAmMEKxjmOg2tx7oytLZOycC5ROVeSW8eOFaezUaf eD+7AOz3nIjpoYughsuk5pHG+9T8Skbn1frkMOnF6J9dyk5ZbZkq9UyUnxn/aYAwnlsH 5LGpIOuY7L/3RhaBeLUDj87hRw8HjHobca8NF6Xf7LjzScJxjIfam2+GuFKy/7/iHEyl WPz5BbvcM9ENtMgkEBYfr0rSMM3EMx6FmXURIUkybMz55jrN5na5KcXDPoPV8VVSJHnW /oRQ== X-Gm-Message-State: APzg51Cd5gF/tQEOdp2baN+wiWTVxDvJzAlsbWu48wN7r5kko3ApmNBh MPfV+XIPOuHyULdnZfZHDT1mGF02G1jwgvWysqedXw== X-Google-Smtp-Source: ANB0VdZrC6kGMCo2y8mN6Q/3ucBnxkLChY6cGq0H2WqPv2QUweZarYVGhyaHJu+3m0zHoum/praM5PRO0HLcU3dnMWM= X-Received: by 2002:a19:1444:: with SMTP id k65-v6mr2072758lfi.70.1537018020029; Sat, 15 Sep 2018 06:27:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: ik Date: Sat, 15 Sep 2018 16:26:23 +0300 Message-ID: Subject: Re: Query act different when doing by hand and by using a driver in app To: Adrian Klaver Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="00000000000018eb570575e8e5eb" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000018eb570575e8e5eb Content-Type: text/plain; charset="UTF-8" Hi Thank you for the answer, after a longer tracing, (go based and printing pg queries to log, I realize that it happens on a different place that I thought it does. Ido On Sat, Sep 15, 2018 at 12:13 AM Adrian Klaver wrote: > On 9/14/18 12:11 PM, ik wrote: > > Hello, > > > > Not sure that this is the right mailing list, so sorry from advance. > > > > I have a program that when it does a query I have one raw returns, but > > when I execute the same query with the same conditions, I get the right > > number of rows back. > > The above is going to need more information to work out: > > 1) The query that returns one row is running in a Go program using the > Go driver below, correct? > > 2) The other query that returns correctly is being run where and how? > > 3) What is the actual query? > > 4) How is the query setup in the program? > > 5) Are you sure the incorrect and correct queries are running against > the same database? > > > > > I'm using gonlang and https://github.com/jackc/pgx . > > The query inside is inside an already open cursor of another "select" > > query that I iterate over. > > > > Is there a way to debug just that inside pg-logs without having all > > possible queries logged in? > > If it is a SELECT query then no. > > > > > Thank you > > Ido > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > --00000000000018eb570575e8e5eb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

Thank you for the answer,= after a longer tracing, (go based and printing pg queries to log, I realiz= e that it happens on a different place that I thought it does.
Ido

On Sat, Sep 15, 2018 at 12:13 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 9/14/18 12:11 PM, ik wrote:
> Hello,
>
> Not sure that this is the right mailing list, so sorry from advance. >
> I have a program that when it does a query I have one raw returns, but=
> when I execute the same query with the same conditions, I get the righ= t
> number of rows back.

The above is going to need more information to work out:

1) The query that returns one row is running in a Go program using the
Go driver below, correct?

2) The other query that returns correctly is being run where and how?

3) What is the actual query?

4) How is the query setup in the program?

5) Are you sure the incorrect and correct queries are running against
the same database?

>
> I'm using gonlang and https://github.com/jackc/pgx .
> The query inside is inside an already open cursor of another "sel= ect"
> query that I iterate over.
>
> Is there a way to debug just that inside pg-logs without having all > possible queries logged in?

If it is a SELECT query then no.

>
> Thank you
> Ido


--
Adrian Klaver
adrian.klave= r@aklaver.com
--00000000000018eb570575e8e5eb--