git.iko.soy/typeable/postgresql-simple
on master help sign in
Merge pull request #20 from bergey/docs

document `tableColumn` behavior on non-table columns

commit4515c9d324c7e87adc91776c650899534cfae86e authorOleg Grenrus <oleg.grenrus@iki.fi> dateTue 2 Jul 2019, 17:19 (7 years ago) parentd0fcf28ae72d0a
1 file changed+5−3
src/Database/PostgreSQL/Simple/FromField.hs+5−3
src/Database/PostgreSQL/Simple/FromField.hs+5−3
@@ -244,9 +244,11 @@ tableOid Field{..} = toMaybeOid (unsafeDupablePerformIO (PQ.ftable result column
244244 then Nothing
245245 else Just x
246246
247−-- | If the column has a table associated with it, this returns the number
248−-- off the associated table column. Numbering starts from 0. Analogous
249−-- to libpq's @PQftablecol@.
247+-- | If the column has a table associated with it, this returns the
248+-- number of the associated table column. Table columns have
249+-- nonzero numbers. Zero is returned if the specified column is not
250+-- a simple reference to a table column, or when using pre-3.0
251+-- protocol. Analogous to libpq's @PQftablecol@.
250252
251253tableColumn :: Field -> Int
252254tableColumn Field{..} = fromCol (unsafeDupablePerformIO (PQ.ftablecol result column))