PQntuples

PQntuplesで、タプルの数を取得する。

https://www.postgresql.jp/document/8.4/html/libpq-exec.html

実行すると、

[bg1@localhost PQntuples]$ vi main.c
[bg1@localhost PQntuples]$ gcc main.c -o main -lpq
[bg1@localhost PQntuples]$ ./main
CONNECTION_OK
PGRES_TUPLES_OK
field_count = 3
tuple_count = 2
name address age
[bg1@localhost PQntuples]$

タプルの数は2であることがわかる。

Sample/libpq/PQntuples/PQntuples/src/PQntuples at master · bg1bgst333/Sample · GitHub