Search Postgresql Archives

Re: pg_typeof equivalent for numeric scale, numeric/timestamp precision?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/03/2012 05:50 AM, Martijn van Oosterhout wrote:
On Tue, Oct 02, 2012 at 10:19:18AM +0800, Craig Ringer wrote:
Hi all

While examining a reported issue with the JDBC driver I'm finding
myself wanting SQL-level functions to get the scale and precision of
a numeric result from an operation like:

   select NUMERIC(8,4) '1.9999'
   union
   select INTEGER 4;

The typmod in postgres is not maintained very well. In the
wire-protocol the typmod is provided if known (the C interface calls
the function PQfmod) and if it's not there (which is very often,
postgres doesn't try very hard) there's no way to "encourge" postgres
to work it out for you.

OK, thanks for confirming that.

It seems the JDBC spec requires preservation of type qualifiers in ways that PgJDBC just won't be able to do without that info. If the server doesn't keep track of it I don't think there's anything PgJDBC can do to be compliant on that topic :-(

--
Craig Ringer


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux