Re: sql_type tinterval not supported by DBD::Pg

"Greg Sabino Mullane" <greg-738XdyZ4GzZWk0Htik3J/[email protected]>
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> [debug] calling bind_param( 6, '14 days', { 'pg_type' => 704 } )
> Cannot bind 6, sql_type tinterval not supported by DBD::Pg
...
> I would think that both INTERVAL => 1186 and  TINTERVAL => 704  are valid
> values for bind_param pg_type hash

Yes and no. You really should be using the provided constants, for
portability and (more importantly) code readability:

use DBD::Pg;
...
$sth->bind_param(6, '14 days', { 'pg_type' => DBD::Pg::PG_TINTERVAL });

The error, however, is completely DBD::Pg's fault. It looks like types.c
was overloading a value indicating if it was okay to bind or not. I
fixed this up in r11297: please give it a whirl and see if it
fixes your problem.

I'm not sure if we should just assume everything not explicitly set can be
quoted via quote_string, or if we should actually go through the entire list
and check each one and prepend the answer to types.c. Probably the latter,
but it may not happen until next week.

- --
Greg Sabino Mullane greg-738XdyZ4GzZWk0Htik3J/[email protected]
End Point Corporation
PGP Key: 0x14964AC8 200805201756
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkgzSUAACgkQvJuQZxSWSsgNKACg3XSxrDpIyxh6gviU1p/TGmje
6pQAmwaB/C+pFIGkW0xbiEkWGvimsvnw
=NIQP
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.