Skip to content

Redshift does not support startup parameter LC_MONETARY #163

Closed

Description

@griffoff

It seems that Amazon redshift does not support some of the functionality expected by postgres connections. When connecting to an SSL enabled cluster with the 2.1.0.beta1 driver the following error occurs:

permission denied to set parameter "lc_monetary" to "C"

I would like to request a feature whereby a connection string option can be set to specify that the connection is to redshift and subsequently decisions can be made in the code to avoid certain nuances with the implementation of the postgres-like schema.

Activity

  1. franciscojunior commented on Feb 12, 2014

    @franciscojunior
    Member

    When this error occurs, are you able to continue connecting and use the server ?

  2. franciscojunior commented on Feb 12, 2014

    @franciscojunior
    Member

    We need better handling of those cases.
    Until now, the only reported problem was about the lc_monetary. Maybe we need to find another way to handle monetary values instead of relying on changing runtime configuration value.

    Stackoverflow also has a question about that: http://stackoverflow.com/questions/20969365/permission-denied-to-set-parameter-lc-monetary-to-c

  3. griffoff commented on Feb 12, 2014

    @griffoff
    Author

    No. The error stops the connection as it throws an error within the open method.

  4. griffoff commented on Feb 12, 2014

    @griffoff
    Author

    I agree. An inability to set a parameter should not stop the connection.
    But also this is an expected parameter in postgres so it is entirely
    reasonable to expect it to be there.

    I do appreciate that Redshift is an edge case and could potentially become
    a branch to the driver rather than being accommodated in a over size fits
    all driver.
    On 12 Feb 2014 20:54, "Francisco Figueiredo Jr." [email protected]
    wrote:

    We need better handling of those cases.
    Until now, the only reported problem was about the lc_monetary. Maybe we
    need to find another way to handle monetary values instead of relying on
    changing runtime configuration value.

    Stackoverflow also has a question about that:
    http://stackoverflow.com/questions/20969365/permission-denied-to-set-parameter-lc-monetary-to-c

    Reply to this email directly or view it on GitHubhttps://github.com//issues/163#issuecomment-34916622
    .

  5. mateusaubin commented on Feb 17, 2014

    @mateusaubin

    I wrote some custom code to avoid two issues with Redshift. You can see it on my fork.

    I could create a pull request if you guys find it usefull.

    The issues I've found were:

    • LC_MONETARY;
    • varchar fields prefixed with E (i.e: E'string');
  6. added this to the milestone on Apr 10, 2014
  7. khalidsalomao commented on Apr 10, 2014

    @khalidsalomao

    This issue was introduced in the versions +2.1.
    Last version that worked fine is 2.0.14.3.

  8. modified the milestones: , on Jul 27, 2014
  9. Heucles commented on Aug 29, 2014

    @Heucles

    Thanks @khalidsalomao for the tip. I am looking forward to have this bug fixed. Regardless, @franciscojunior great job with the lib, I'm starting to use, but I can already consider myself a big fan.

  10. 62 remaining items

  11. franciscojunior commented on Feb 18, 2015

    @franciscojunior
    Member

    Yes. There is only a missing line in #489 . I'm committing it now....

  12. franciscojunior commented on Feb 18, 2015

    @franciscojunior
    Member

    Done! Now #489 is 100%.

  13. franciscojunior commented on Feb 18, 2015

    @franciscojunior
    Member

    All set!
    @mateusaubin , @khalidsalomao you can download latest 2.2 binaries with latest amazon redshift support here: https://build.npgsql.org/viewLog.html?buildId=14051&tab=artifacts&buildTypeId=npgsql_All22

    Please, give it a try and let us know if you find any issues. Thanks in advance.

  14. khalidsalomao commented on Feb 19, 2015

    @khalidsalomao

    Hi @franciscojunior, @roji ,

    It worked! 😄

    Tested several operations and all is fine!

    Thanks guys!

  15. roji commented on Feb 19, 2015

    @roji
    Member

    Great. @franciscojunior, go ahead and merge #489 into 2.2. Then we can see if there's anything else we want to do for 2.2.5.

  16. franciscojunior commented on Feb 19, 2015

    @franciscojunior
    Member

    Great. @franciscojunior, go ahead and merge #489 into 2.2. Then we can see if there's anything else we want to do for 2.2.5.

    Done!

  17. ReinsBrain commented on Nov 16, 2020

    @ReinsBrain

    This issue comes back again when you use pgbouncer ( which cannot support startup parameters for various reasons ). If I may weigh in on the matter, I don't think the driver should be setting parameters - please let the users do that :)

  18. roji commented on Nov 16, 2020

    @roji
    Member

    @ReinsBrain this issue is 5 years old, which means I've been maintaining Npgsql for too long :)

    More importantly though, Npgsql hasn't been sending LC_MONETARY for several years now - which exact parameter incompatibility are you seeing with pgbouncer? For reference, here's the code which sends the parameters on startup.

  19. added theissue type on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions