Opened 3 years ago

Last modified 3 years ago

#341 new enhancement

PQfmod / for column size

Reported by:… Owned by: jtv
Priority: normal Component: other
Severity: Incomplete Keywords:

Description (last modified by jtv)


Could you please be so kind as to consider adding the following member function:

int pqxx::result::column_modifier(tuple::size_type ColNum) const
	int col_size = PQfmod(m_data, int(ColNum));
	return col_size;

This is to get the size of a varchar(x) column. I have noticed though that the value returned by PQfmod is a litte larger than what SQL says. In this case, for varchar(10) I seem to be getting 14 as a size. Anyhow, I think there should be a way to get the column size via the pqxx api.

Best Regards, Peter

Change History (3)

comment:1 Changed 3 years ago by jtv

  • Description modified (diff)

comment:2 Changed 3 years ago by jtv

I wish I understood PQfmod a little better! It's documented in the vaguest of terms.

For getting the size of a varchar though, why not use the field's size()?

comment:3 Changed 3 years ago by jtv

  • Severity changed from Fails to communicate failure to Incomplete
Note: See TracTickets for help on using tickets.