Re: Terms advice.

From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Terms advice.
Date: 2010-11-27 11:10:02
Message-ID: AANLkTik8dmxah5oy2FmA+CJQLkPD86tiUKyziY9aF04E@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey Craig,

I know about libpqxx. But I like to implement my library
just for fun :-).

The one goal of my library is to support all features of libpq.
So, I don't intent to implement the protocol from scratch
and use libpq as basis.

Another goal of my library is to be very clean and consistent
in terms. For example, I want avoid the situations like this.
consider PQsendQuery function of libpq:

int PQsendQuery(PGconn *conn, const char *command);

Description: "Submits a command to the server ... "

Because I meticulous, I don't clearly understand, why
function called PQsendQuery rather than PQsendCommand?
There is no consistence between name of function and name
of its second argument, and furthermore according to
http://www.postgresql.org/docs/9.0/static/sql-commands.html
users operates with commands (not queries) :-)
But according to SQL (structured query language) users
operates with queries :-)

Next, consider
http://www.postgresql.org/docs/9.0/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO

"These functions are used to extract information from a PGresult
object that represents a successful query result (that is, one that
has status PGRES_TUPLES_OK)... ". Well, here "query" used as
a command which returns data (tuples). But this is inconsistent
e.g., with mentioned PQsendQuery, because in this case "query"
can be a "command" which returns no data (and in terms of SQL
it is correct).

Of course, this may seem petty and not worthy of such attention.
But I believe that extra correctness helps better understand any
library or program.

BTW. "query" and "command" are synonyms, as I mentioned
above. :-)

2010/11/27 Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>

> On 11/26/2010 09:37 PM, Dmitriy Igrishin wrote:
>
>> Hey all,
>>
>> I am working on C++ library to work with PostgreSQL.
>>
>
> Are you aware of libpqxx ?
>
> Is your intent to implement the protocol from scratch in c++ rather than
> wrap libpq? If so, why?
>
> --
> Craig Ringer
>

--
// Dmitriy.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Emanuel Calvo Franco 2010-11-27 12:59:37 array_agg + limit
Previous Message c k 2010-11-27 11:08:27 Re: plpyhton