ISO year.
This patch allows you to use IYYYY as format specifier to get the
ISO year, the year correspondeing to the ISO week number (IW).
Kurt
Attachments:
isoyear.difftext/plain; charset=us-asciiDownload+193-1
Kurt Roeckx <Q@ping.be> writes:
This patch allows you to use IYYYY as format specifier to get the
ISO year, the year correspondeing to the ISO week number (IW).
The purpose of to_char() as I understand it is to be 100% Oracle
compatible, not to invent new features at random. Is this duplicating
some Oracle functionality that was left out?
regards, tom lane
On Thu, Dec 18, 2003 at 11:41:18AM -0500, Tom Lane wrote:
Kurt Roeckx <Q@ping.be> writes:
This patch allows you to use IYYYY as format specifier to get the
ISO year, the year correspondeing to the ISO week number (IW).The purpose of to_char() as I understand it is to be 100% Oracle
compatible, not to invent new features at random. Is this duplicating
some Oracle functionality that was left out?
I have no idea if this in Oracle or not. But it's something I
needed, and other people in the past asked about it too.
You could use the normal year instead of the iso year, but around
newyear this always gives problems.
Kurt
Kurt Roeckx wrote:
I have no idea if this in Oracle or not. But it's something I
needed, and other people in the past asked about it too.
It is in Oracle, but you aren't exactly on the spot. It should be
IYYY - 4 digits ('2003')
IYY - 3 digits ('003')
IY - 2 digits ('03')
I - 1 digit ('3')
On Thu, Dec 18, 2003 at 06:47:41PM +0100, Peter Eisentraut wrote:
Kurt Roeckx wrote:
I have no idea if this in Oracle or not. But it's something I
needed, and other people in the past asked about it too.It is in Oracle, but you aren't exactly on the spot. It should be
IYYY - 4 digits ('2003')
IYY - 3 digits ('003')
IY - 2 digits ('03')
I - 1 digit ('3')
I'll update the patch to support all of them.
Kurt
On Thu, Dec 18, 2003 at 06:47:41PM +0100, Peter Eisentraut wrote:
Kurt Roeckx wrote:
I have no idea if this in Oracle or not. But it's something I
needed, and other people in the past asked about it too.It is in Oracle, but you aren't exactly on the spot. It should be
IYYY - 4 digits ('2003')
IYY - 3 digits ('003')
IY - 2 digits ('03')
I - 1 digit ('3')
Here is an updated patch that does that.
Kurt
Attachments:
isoyear-2.difftext/plain; charset=us-asciiDownload+217-7
On Thu, Dec 18, 2003 at 04:33:44PM +0100, Kurt Roeckx wrote:
+ DCH_IYYYY,
^^^^^^^^^^^
DCH_YYYY,
DCH_YYY,
DCH_YY,
There is a bug.. it's wrong position. Please, add the "enum" of
DCH_IYYYY to same position as you have "IYYYY" in next array. It means
"enum" DCH_IYYYY must be behind DCH_IW. If you will add others IY the
order must be:
DCH_IW
DCH_IYYYY
DCH_IYYY
DCH_IYY
DCH_IY
.. and same for lower case version:
@@ -582,6 +583,7 @@
DCH_ww,
DCH_w,
DCH_y_yyy,
+ DCH_iyyyy,
^^^^^^^^^
Thanks!
Karel
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
On Thu, Dec 18, 2003 at 11:41:18AM -0500, Tom Lane wrote:
Kurt Roeckx <Q@ping.be> writes:
This patch allows you to use IYYYY as format specifier to get the
ISO year, the year correspondeing to the ISO week number (IW).The purpose of to_char() as I understand it is to be 100% Oracle
compatible, not to invent new features at random. Is this duplicating
some Oracle functionality that was left out?
Oracle has IYYYY too. So thanks to Kurt, because now we approximate to
100% compatibity :-)
BTW, I'm open for to_char() PostgreSQL extensions if it will good
described in docs and marked as PostgreSQL extension.
Karel
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
On Thu, Dec 18, 2003 at 08:18:08PM +0100, Kurt Roeckx wrote:
DCH_IW, + DCH_IYYY, + DCH_IYY, + DCH_IY, + DCH_I,
It's better :-) This patch is OK for me.
Karel
--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
Karel Zak wrote:
On Thu, Dec 18, 2003 at 08:18:08PM +0100, Kurt Roeckx wrote:
DCH_IW, + DCH_IYYY, + DCH_IYY, + DCH_IY, + DCH_I,It's better :-) This patch is OK for me.
Which patch is OK? The one attached? You looked like you were making
changes to this patch in your later emails.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Attachments:
/bjm/33text/plainDownload+217-7
On Fri, Dec 19, 2003 at 07:14:53PM -0500, Bruce Momjian wrote:
Which patch is OK? The one attached? You looked like you were making
changes to this patch in your later emails.
That is the changed/good patch.
Kurt
Your patch has been added to the PostgreSQL unapplied patches list at:
http://momjian.postgresql.org/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
---------------------------------------------------------------------------
Kurt Roeckx wrote:
On Thu, Dec 18, 2003 at 06:47:41PM +0100, Peter Eisentraut wrote:
Kurt Roeckx wrote:
I have no idea if this in Oracle or not. But it's something I
needed, and other people in the past asked about it too.It is in Oracle, but you aren't exactly on the spot. It should be
IYYY - 4 digits ('2003')
IYY - 3 digits ('003')
IY - 2 digits ('03')
I - 1 digit ('3')Here is an updated patch that does that.
Kurt
[ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Patch applied. Thanks.
---------------------------------------------------------------------------
Kurt Roeckx wrote:
On Thu, Dec 18, 2003 at 06:47:41PM +0100, Peter Eisentraut wrote:
Kurt Roeckx wrote:
I have no idea if this in Oracle or not. But it's something I
needed, and other people in the past asked about it too.It is in Oracle, but you aren't exactly on the spot. It should be
IYYY - 4 digits ('2003')
IYY - 3 digits ('003')
IY - 2 digits ('03')
I - 1 digit ('3')Here is an updated patch that does that.
Kurt
[ Attachment, skipping... ]
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073