Re: [GENERAL] libpq confusion

2017-09-22 Thread Thomas Delrue
On Wednesday, September 20, 2017 1:47:05 PM EDT Igor Korot wrote: >Thx. >So it is referring to the command not a "command returning no data". ;-) assuming create table t (c int); select c from t; - PQresultStatus(result) == PGRES_TUPLES_OK - PQntuples(result) == number or

Re: [GENERAL] libpq confusion

2017-09-20 Thread Igor Korot
Thx. So it is referring to the command not a "command returning no data". ;-) On Wed, Sep 20, 2017 at 1:42 PM, John R Pierce wrote: > On 9/20/2017 10:34 AM, Igor Korot wrote: > > >From the documentation: > https://www.postgresql.org/docs/9.1/static/libpq-exec.html > > [quote] > PGRES_COMMAND_OK >

Re: [GENERAL] libpq confusion

2017-09-20 Thread John R Pierce
On 9/20/2017 10:34 AM, Igor Korot wrote: >From the documentation: https://www.postgresql.org/docs/9.1/static/libpq-exec.html [quote] PGRES_COMMAND_OK Successful completion of a command returning no data. [/quote] No data = no rows, right? from that same page, a bit farther down, clarifying t

Re: [GENERAL] libpq confusion

2017-09-20 Thread Igor Korot
Hi, John, On Wed, Sep 20, 2017 at 12:02 PM, John R Pierce wrote: > On 9/20/2017 6:30 AM, Igor Korot wrote: > > Hi, guys, > > On Wed, Sep 20, 2017 at 12:20 AM, Allan Harvey > wrote: > > How do I properly check if the record exists from libpq? > > Igor, > I use PQntuples() to check the number of .

Re: [GENERAL] libpq confusion

2017-09-20 Thread John R Pierce
On 9/20/2017 6:30 AM, Igor Korot wrote: Hi, guys, On Wed, Sep 20, 2017 at 12:20 AM, Allan Harvey wrote: How do I properly check if the record exists from libpq? Igor, I use PQntuples() to check the number of ... tuples, for > 0 I was actually curious - isn't it what "PGRES_COMMAND_OK" for?

Re: [GENERAL] libpq confusion

2017-09-20 Thread Allan Harvey
>How do I properly check if the record exists from libpq? Igor, I use PQntuples() to check the number of ... tuples, for > 0 Allan __ This e-mail message may contain confidential or legally privileged information and is only f

Re: [GENERAL] libpq confusion

2017-09-20 Thread Igor Korot
Hi, guys, On Wed, Sep 20, 2017 at 12:20 AM, Allan Harvey wrote: > >>How do I properly check if the record exists from libpq? > > Igor, > I use PQntuples() to check the number of ... tuples, for > 0 I was actually curious - isn't it what "PGRES_COMMAND_OK" for? IIUC, this constant indicates succe

Re: [GENERAL] libpq confusion

2017-09-19 Thread Pavel Stehule
2017-09-20 5:36 GMT+02:00 Igor Korot : > Hi, ALL, > > draft=# SELECT 1 FROM abcattbl WHERE abt_tnam = 'leagues'; > ?column? > -- > (0 rows) > > > However running it thru the PQexecParam() I am getting "PGRES_TUPLES_OK" > which means that the such record exist. > That means so this comman

[GENERAL] libpq confusion

2017-09-19 Thread Igor Korot
Hi, ALL, draft=# SELECT 1 FROM abcattbl WHERE abt_tnam = 'leagues'; ?column? -- (0 rows) However running it thru the PQexecParam() I am getting "PGRES_TUPLES_OK" which means that the such record exist. How do I properly check if the record exists from libpq? -- Sent via pgsql-genera