Thread: "Mons" in JDBC driver
Hello all. Is it intended, that months is shrinked as "mons" instead "months"? http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/jdbc/pgjdbc/org/postgresql/util/PGInterval.java?rev=1.14&content-type=text/x-cvsweb-markup
On Mon, 2 Aug 2010, Alexander Yerenkow wrote: > Is it intended, that months is shrinked as "mons" instead "months"? > > http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/jdbc/pgjdbc/org/postgresql/util/PGInterval.java?rev=1.14&content-type=text/x-cvsweb-markup > Yes, this mirrors the server's behavior: kjurka=# select '3 months'::interval; interval ---------- 3 mons (1 row) Kris Jurka
On Mon, Aug 2, 2010 at 10:23 AM, Kris Jurka <books@ejurka.com> wrote: > Yes, this mirrors the server's behavior: > > kjurka=# select '3 months'::interval; > interval > ---------- > 3 mons > (1 row) From: http://www.postgresql.org/docs/9.0/static/runtime-config-client.html#GUC-INTERVALSTYLE Here is what I see from the server: p2082849b=> SET SESSION IntervalStyle TO DEFAULT; SET p2082849b=> select Interval '3 months'; interval ---------- 3 mons (1 row) p2082849b=> SET session IntervalStyle TO 'postgres'; SET p2082849b=> select Interval '3 months'; interval ---------- 3 mons (1 row) p2082849b=> SET session IntervalStyle TO 'postgres_verbose'; SET p2082849b=> select Interval '3 months'; interval ---------- @ 3 mons (1 row) p2082849b=> SET session IntervalStyle TO 'sql_standard'; SET p2082849b=> select Interval '3 months'; interval ---------- 0-3 (1 row) p2082849b=> SET session IntervalStyle TO 'iso_8601'; SET p2082849b=> select Interval '3 months'; interval ---------- P3M (1 row) -- Regards, Richard Broersma Jr. Visit the Los Angeles PostgreSQL Users Group (LAPUG) http://pugs.postgresql.org/lapug
On Mon, 2 Aug 2010, Richard Broersma wrote: > [IntervalStyle can be changed] > Hmm. The JDBC driver explicitly sets DateStyle and complains loudly if someone attempts to change it. I guess we should do the same for IntervalStyle as well. Kris Jurka
02.08.2010 23:02, Kris Jurka пишет: > > > On Mon, 2 Aug 2010, Richard Broersma wrote: > >> [IntervalStyle can be changed] >> > > Hmm. The JDBC driver explicitly sets DateStyle and complains loudly if > someone attempts to change it. I guess we should do the same for > IntervalStyle as well. > > Kris Jurka Maybe my question was wrong :) What is reason of Months are written as "mons" in this IntervalStyles? 1. Is this some wide term, for shortening months? 2. Is this described in any SQL standards? I have no access to these not freely available standards, to check myself. 3. Is this just historical thing? Thank you.