Comments on patch for date_trunc( 'week', ... );

From: Robert Creager <Robert_Creager(at)LogicalChaos(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Comments on patch for date_trunc( 'week', ... );
Date: 2004-03-01 00:11:05
Message-ID: 20040229171105.0b63a914.Robert_Creager@LogicalChaos.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

--Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.w_KmuR(eRfU8lY
Content-Type: multipart/mixed;
boundary="Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.efcc)pQwOzEslc"

--Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.efcc)pQwOzEslc
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Per a brief conversation with Tom, I've created a patch for adding support for
'week' within the date_trunc function.

Within the patch I added a couple of test cases and associated target output,
and changed the documentation to add 'week' appropriately.

Comments? Should I of bypassed this list and subscribed/posted to the patch
list?

Cheers,
Rob

--
17:07:39 up 15 days, 46 min, 4 users, load average: 2.18, 2.23, 2.27
Linux 2.4.21-0.13_test #60 SMP Sun Dec 7 17:00:02 MST 2003

--Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.efcc)pQwOzEslc
Content-Type: application/octet-stream;
name="date_trunc.patch"
Content-Disposition: attachment;
filename="date_trunc.patch"
Content-Transfer-Encoding: base64

SW5kZXg6IGRvYy9zcmMvc2dtbC9mdW5jLnNnbWwKPT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQpSQ1MgZmlsZTogL3Byb2plY3RzL2N2c3Jvb3QvcGdzcWwtc2Vy
dmVyL2RvYy9zcmMvc2dtbC9mdW5jLnNnbWwsdgpyZXRyaWV2aW5nIHJldmlz
aW9uIDEuMTg5CmRpZmYgLXUgLXIxLjE4O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CnJldHJpZXZpbmcgcmV2
aXNpb24gMS41CmRpZmYgLXUgLXIxLjUgdGltZXN0YW1wdHouc3FsCi0tLSBz
cmMvdGVzdC9yZWdyZXNzL3NxbC90aW1lc3RhbXB0ei5zcWwJMjUgRGVjIDIw
MDMgMDM6MzY6MjQgLTAwMDAJMS41CisrKyBzcmMvdGVzdC9yZWdyZXNzL3Nx
bC90aW1lc3RhbXB0ei5zcWwJMjkgRmViIDIwMDQgMjM6NDQ6MzYgLTAwMDAK
QEAgLTE0NSw2ICsxNDUsOCBAQAogU0VMRUNUICcnIEFTICI1NCIsIGQxIC0g
dGltZXN0YW1wIHdpdGggdGltZSB6b25lICcxOTk3LTAxLTAyJyBBUyBkaWZm
CiAgICBGUk9NIFRJTUVTVEFNUFRaX1RCTCBXSEVSRSBkMSBCRVRXRUVOICcx
OTAyLTAxLTAxJyBBTkQgJzIwMzgtMDEtMDEnOwogCitTRUxFQ1QgJycgQVMg
ZGF0ZV90cnVuY193ZWVrLCBkYXRlX3RydW5jKCAnd2VlaycsIHRpbWVzdGFt
cCB3aXRoIHRpbWUgem9uZSAnMjAwNC0wMi0yOSAxNTo0NDoxNy43MTM5Mycg
KSBBUyB3ZWVrX3RydW5jOworCiAtLSBUZXN0IGNhc3Rpbmcgd2l0aGluIGEg
QkVUV0VFTiBxdWFsaWZpZXIKIFNFTEVDVCAnJyBBUyAiNTQiLCBkMSAtIHRp
bWVzdGFtcCB3aXRoIHRpbWUgem9uZSAnMTk5Ny0wMS0wMicgQVMgZGlmZgog
ICBGUk9NIFRJTUVTVEFNUFRaX1RCTAo=

--Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.efcc)pQwOzEslc--

--Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.w_KmuR(eRfU8lY
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAkBCf5kACgkQLQ/DKuwDYzne8wCaArjPnffqEpsXHsnsF96PGo+b
XHkAn1XYBCv0tNz1EXUupPzEiIfxSDcR
=H1zn
-----END PGP SIGNATURE-----

--Multipart_Sun__29_Feb_2004_17_11_05_-0700_=.w_KmuR(eRfU8lY--

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2004-03-01 01:41:32 Re: Collaboration Tool Proposal -- Summary to date
Previous Message Robert Creager 2004-03-01 00:07:20 Re: pgAdmin