Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

contrib

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Tom Lane authored
    A large majority of the callers of pg_do_encoding_conversion were
    specifying the database encoding as either source or target of the
    conversion, meaning that we can use the less general functions
    pg_any_to_server/pg_server_to_any instead.
    
    The main advantage of using the latter functions is that they can make use
    of a cached conversion-function lookup in the common case that the other
    encoding is the current client_encoding.  It's notationally cleaner too in
    most cases, not least because of the historical artifact that the latter
    functions use "char *" rather than "unsigned char *" in their APIs.
    
    Note that pg_any_to_server will apply an encoding verification step in
    some cases where pg_do_encoding_conversion would have just done nothing.
    This seems to me to be a good idea at most of these call sites, though
    it partially negates the performance benefit.
    
    Per discussion of bug #9210.
    769065c1
    History