* returns NULL if the field_num is invalid */
| 3370 | * returns NULL if the field_num is invalid |
| 3371 | */ |
| 3372 | char * |
| 3373 | PQfname(const PGresult *res, int field_num) |
| 3374 | { |
| 3375 | if (!check_field_number(res, field_num)) |
| 3376 | return NULL; |
| 3377 | if (res->attDescs) |
| 3378 | return res->attDescs[field_num].name; |
| 3379 | else |
| 3380 | return NULL; |
| 3381 | } |
| 3382 | |
| 3383 | /* |
| 3384 | * PQfnumber: find column number given column name |