Add DATE command that emits the current date + time as output from Slonik. Enables capturing timing information within a script.
Created attachment 80 [details] Date patch for slonik Hi. An implementation of the date command for slonik. José Arthur.
I'm not quite sure what's up; this doesn't seem to apply to HEAD... postgres@cbbrowne [12:29:52] [~/slony1-engine.github] [master *] -> % git checkout -b bug180 master Switched to a new branch 'bug180' postgres@cbbrowne [12:29:58] [~/slony1-engine.github] [bug180 *] -> % patch < /tmp/date.patch patching file slonik_ref.sgml Hunk #1 FAILED at 379. 1 out of 1 hunk FAILED -- saving rejects to file slonik_ref.sgml.rej patching file parser.y Hunk #1 FAILED at 76. Hunk #2 FAILED at 141. Hunk #3 FAILED at 376. Hunk #4 FAILED at 472. Hunk #5 FAILED at 1597. Hunk #6 FAILED at 1813. 6 out of 6 hunks FAILED -- saving rejects to file parser.y.rej patching file scan.l Hunk #1 FAILED at 88. Hunk #2 FAILED at 99. 2 out of 2 hunks FAILED -- saving rejects to file scan.l.rej patching file slonik.c Hunk #1 FAILED at 264. Hunk #2 FAILED at 1177. 2 out of 2 hunks FAILED -- saving rejects to file slonik.c.rej patching file slonik.h Hunk #1 FAILED at 16. Hunk #2 FAILED at 64. Hunk #3 FAILED at 146. Hunk #4 FAILED at 634. 4 out of 4 hunks FAILED -- saving rejects to file slonik.h.rej I'll attach the rejection notices from patch.
Created attachment 81 [details] Results of rejections from patch Built this tarball thus: postgres@cbbrowne [12:30:53] [~/slony1-engine.github] [bug180 *] -> % tar cfvj rejects-date.tar.bz2 `find -name "*.rej"` ./scan.l.rej ./slonik.c.rej ./slonik_ref.sgml.rej ./parser.y.rej ./slonik.h.rej
A browse of the patch shows that the contents seem quite reasonable. Perhaps "patch" isn't what I should be using to apply it...
(In reply to comment #4) > A browse of the patch shows that the contents seem quite reasonable. Perhaps > "patch" isn't what I should be using to apply it... I did the reverse patch :-(. Sorry about that, I'll post the correct one as soon as possible. I could apply using: "patch -p1 -R < /tmp/date.patch"
Created attachment 82 [details] Date patch for slonik patch -p1 < ~/date.patch should do the job
Cool, that's working now. I have published the patch into a branch in my repo at GitHub. https://github.com/cbbrowne/slony1-engine/commits/bug180 Your patch: https://github.com/cbbrowne/slony1-engine/commit/c734f36a5812ebf82dbd06092ad7dac27dfa1957 I added in a further patch that puts DATE commands into one of the regression tests. https://github.com/cbbrowne/slony1-engine/commit/8ad1dbcc21d8a3ab830920369c83bf956c257594 If someone else can take a peek at this, it looks addable to me.
This patch has been applied to master Thanks http://git.postgresql.org/gitweb?p=slony1-engine.git;a=commit;h=f1f570ea7965f18ba048a452fba2a7f5a411eba0