Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.3.0 published #54

Open
xxgreg opened this issue Dec 4, 2014 · 10 comments
Open

Version 0.3.0 published #54

xxgreg opened this issue Dec 4, 2014 · 10 comments

Comments

@xxgreg
Copy link
Owner

xxgreg commented Dec 4, 2014

https://pub.dartlang.org/packages/postgresql

@tomyeh @pisabev @Fox32

Let me know if you have any issues.

Change log:

A new connection pool with more configuration options.
Support for json and timestamptz types.
Utc time zone support.
User customisable type conversions.
Improved error handling.
Connection.onClosed has been removed.
Some api has been renamed, the original names are still functional but marked as deprecated.
Pool.destroy() => Pool.stop()
The constants were upper case and int type. Now typed and lower camel case to match the style guide.
Connection.unhandled => Connection.messages
Connection.transactionStatus => Connection.transactionState

@Fox32
Copy link
Contributor

Fox32 commented Dec 4, 2014

I'm already using the 0.3.0 version from github since some days. Everything seems to work fine.

Btw. the readme still needs an update, especially the pooling part (take a look at the import comment at the beginning of the example)

@xxgreg
Copy link
Owner Author

xxgreg commented Dec 4, 2014

Cool thanks for pointing that out.

Next time feel free to open an issue if you see something, or for the readme you can just edit it via the github web editor, and send a pull request.

I also updated the bit about type mappings.

Cheers.

@tomyeh
Copy link
Contributor

tomyeh commented Jan 19, 2015

Sorry, I was busy. The new implementation looks great. Here is a few issues (It is a quick test. I might be wrong):

  1. Line 163, type_convert.dart: it shall be replaced with encodeString(value.toString()), since PostgreSQL expects a JSON string. Otherwise, it throws an exception: pgpool1:11048:3 ERROR 42804 column "value" is of type json but expression is of type integer
  2. maxConnections seems not working. I set minConnections to 10, and maxConnections to 200, but it rejects the connection after 10 with the following exception: pgpool1:null FATAL 53300 sorry, too many clients already

@xxgreg
Copy link
Owner Author

xxgreg commented Jan 19, 2015

Good timing. I've been away, and have just turned on my computer for the first time this year. Thanks for the feedback.

@xxgreg
Copy link
Owner Author

xxgreg commented Jan 21, 2015

@tomyeh

  1. Good catch - I need to add single quotes around the number. Encoding numbers as json is buggy. #57

  2. What is your max_connection set to in postgresql.conf? It sounds like you're hitting that limit. It's usually set to 100 by default.

@tomyeh
Copy link
Contributor

tomyeh commented Jan 21, 2015

I set it to 200, but # of connections allowed depends only on minConnections. For instance, if 10-200, it stops at 10, and 15-200 stops at 15. It got no problem in the previous version.

_pool = new Pool(dbUri, minConnections: 10, maxConnections: 200,
    typeConverter: new _DBTypeConverter());

@xxgreg
Copy link
Owner Author

xxgreg commented Jan 21, 2015

Sure. I will look into it.

The error message you've quoted is what the database returns when
max_connections is exhausted.

Btw in postgresql it is typical to only use ~2*cores number of connections
in a pool, increasing it past this will likely reduce performance of the
database due to increased contention.

On Wed, Jan 21, 2015 at 5:24 PM, Tom Yeh [email protected] wrote:

I set it to 200, but # of connections allowed depends only on
minConnections. For instance, if 10-200, it stops at 10, and 15-200 stops
at 15. It got no problem in the previous version.


Reply to this email directly or view it on GitHub
#54 (comment)
.

@xxgreg
Copy link
Owner Author

xxgreg commented Jan 21, 2015

Regarding the pool issue, I created a new ticket #58.

@tomyeh
Copy link
Contributor

tomyeh commented Jan 21, 2015

Thanks.

@artem-malko
Copy link

I think, that task should be closed, shouldn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants