brianc/node-pg-query-stream — pull request #4 by tbuchok (2014-04-10 04:07:18+00:00)
Title: maxListeners on timestamp queries

thanks for all the great work helping with the pg => node ecosystem. really appreciate it.

tl;dr: i seem to have come across an issue where the client emits a lot of pushes a lot of `rows.length > 0` when doing a query with timestamp -- with the net effect of adding a lot of listeners on the eventemitter.

you're the boss on this stuff, so maybe that makes no sense and i'm totally insane O_O. a little more detail ...

---

my app was printing the [`maxListeners` warning](http://nodejs.org/api/events.html#events_emitter_setmaxlisteners_n) when doing a QueryStream with a timestamp included.

the query in my app is basically:

```
SELECT * FROM model WHERE updated_at >=
```

in this pull request:

1. 87b52f9e516ec0d5b70554886d46cb40ddec0069 shows a failing test when querying against a date range.
1. cab956ba5030b146ea2132954588023b062ed02e passes this test.

maybe it's worth a look -- any feedback on why you think this might of happened -- and perhaps the queries i'm writing are just garbage themselves!

thanks again.