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

error: payload string too long #246

Closed
cymen opened this issue Dec 1, 2016 · 3 comments
Closed

error: payload string too long #246

cymen opened this issue Dec 1, 2016 · 3 comments

Comments

@cymen
Copy link

cymen commented Dec 1, 2016

I'm testing sending a really long string to a TEXT column and I'm getting an exception. It is:

  error: payload string too long
      at Connection.parseE (/Users/cvig/dev/test/server/node_modules/pg-promise/node_modules/pg/lib/connection.js:539:11)
      at Connection.parseMessage (/Users/cvig/dev/test/server/node_modules/pg-promise/node_modules/pg/lib/connection.js:366:17)
      at Socket.<anonymous> (/Users/cvig/dev/test/server/node_modules/pg-promise/node_modules/pg/lib/connection.js:105:22)
      at emitOne (events.js:96:13)
      at Socket.emit (events.js:188:7)
      at readableAddChunk (_stream_readable.js:176:18)
      at Socket.Readable.push (_stream_readable.js:134:10)
      at TCP.onread (net.js:551:20)
  From previous event:
      at promise (/Users/cvig/dev/test/server/node_modules/pg-promise/lib/promise.js:22:20)
      at Task.$query (/Users/cvig/dev/test/server/node_modules/pg-promise/lib/query.js:124:12)
      at Task.<anonymous> (/Users/cvig/dev/test/server/node_modules/pg-promise/lib/query.js:227:23)
      at Task.query (/Users/cvig/dev/test/server/node_modules/pg-promise/lib/task.js:120:34)
      at Task.obj.one (/Users/cvig/dev/test/server/node_modules/pg-promise/lib/database.js:397:31)
      at _callee6$ (/Users/cvig/dev/test/server/src/routes/blah.js:74:28)
      at tryCatch (/Users/cvig/dev/test/server/node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (/Users/cvig/dev/test/server/node_modules/regenerator-runtime/runtime.js:336:22)
      at Generator.prototype.(anonymous function) [as next] (/Users/cvig/dev/test/server/node_modules/regenerator-runtime/runtime.js:95:21)
      at step (/Users/cvig/dev/test/server/src/routes/blah.js:59:191)
      at /Users/cvig/dev/test/server/src/routes/blah.js:59:361

It looks like that comes from pg or node-postgres. Am I right in thinking that? If so, I can close this and go there.

My test string is going to this lorem ipsum generator http://www.lipsum.com/ and choosing 20 paragraphs of text.

@cymen
Copy link
Author

cymen commented Dec 1, 2016

To be clear, opening here first just to confirm no length limits in pg-promise!

@cymen
Copy link
Author

cymen commented Dec 1, 2016

I figured it out -- I'm playing with NOTIFY too and it's related to the payload size for NOTIFY.

@cymen cymen closed this as completed Dec 1, 2016
@vitaly-t
Copy link
Owner

vitaly-t commented Dec 2, 2016

Only noticed it now :)

The maximum payload size for NOTIFY in PostgreSQL is 8000 bytes. Passing in a longer string will result in an error 😉

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

2 participants