pg 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 012dafe387d9f1fe9444dee7674ff5fdfcebce3b8ca61500b0ccbba847e28721
4
- data.tar.gz: 2a3d537246a65cb6c86822296d723154abbab3be71ca772cfa71678535eb3369
3
+ metadata.gz: c220f1cc5cfd8e07690949fcf30a96abd8f710bc64f0c358eb6452288966a5b4
4
+ data.tar.gz: cd5f28d3098e2537e04dc218c8809b83308cb541e6b17891220559d33e2ada82
5
5
  SHA512:
6
- metadata.gz: 9d395a1d05e7bafda559f0a5041579b5d15c7f8b5c50b8ff0e37ae0b577a21e20b0f3471fb874ed23f6101e0fe21591f22efd60c230b59106029d7f1713b3023
7
- data.tar.gz: 2456f8130e18b84aebd95aa08254fb79747024ce1e4747237aa36909e3031039fdfede8b315a2ad4b7ab03daf79f067e634336abeb675151e5d9a2950cb7ec13
6
+ metadata.gz: f5de3fb30c6da95937d6c8913c9e172a348fa376edc6f06cc9333669c908a25cb2af85853aafbdc6839407f6b4aea93ca97e3b5b53f7182732664ecd6cd81e33
7
+ data.tar.gz: 00f5c6e8c359e81bf7c9145b7322583e511d440f681d32192430d9ce96772f1d71f8abce35e12ccf126d96a552205e799efee2533c54a84c623fa0aeee5c1c3c
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## v1.6.1 [2025-08-03] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ - Add binary gems for platforms `aarch64-linux-musl` and `x86_64-linux-musl` without the need to install package `gcompat`. [#657](https://github.com/ged/ruby-pg/pull/657).
4
+ - Serialize CompositeCoder#dimensions only when set. [#652](https://github.com/ged/ruby-pg/pull/652)
5
+ This fixes the compatibility to pg-1.5.9, when deserializing Marshal data from pg-1.6, as long as the new attribute isn't used.
6
+ - Remove dependency to MSYS2 package "postgresql" from binary Windows gem [#654](https://github.com/ged/ruby-pg/pull/654)
7
+
8
+
1
9
  ## v1.6.0 [2025-07-27] Lars Kanis <lars@greiz-reinsdorf.de>
2
10
 
3
11
  Added:
data/README.md CHANGED
@@ -40,29 +40,34 @@ A small example usage:
40
40
  ## Requirements
41
41
 
42
42
  * Ruby 2.7 or newer
43
- * PostgreSQL 10.x or later (with headers, -dev packages, etc).
43
+ * PostgreSQL 10.x or later
44
+ * When installing the source gem: libpq with headers, -dev packages, etc.
44
45
 
45
- It usually works with earlier versions of Ruby/PostgreSQL as well, but those are
46
- not regularly tested.
47
46
 
47
+ ## How To Install
48
48
 
49
- ## Versioning
49
+ Install via RubyGems:
50
50
 
51
- We tag and release gems according to the [Semantic Versioning](http://semver.org/) principle.
51
+ gem install pg
52
52
 
53
- As a result of this policy, you can (and should) specify a dependency on this gem using the [Pessimistic Version Constraint](http://guides.rubygems.org/patterns/#pessimistic-version-constraint) with two digits of precision.
53
+ This installs the binary gem, specific to the running platform by default.
54
54
 
55
- For example:
55
+ ### Binary gem
56
56
 
57
- ```ruby
58
- spec.add_dependency 'pg', '~> 1.0'
59
- ```
57
+ The binary gems don't depend on the libpq package on the running system.
58
+ They have libpq builtin.
60
59
 
61
- ## How To Install
60
+ The gems for platform `x86_64-linux` and `aarch64-linux` run on Alpine Linux, but require the package `gcompat` there as long as we don't provide a native gem for platform `x86_64-linux-musl`. Install this package like so:
62
61
 
63
- Install via RubyGems:
62
+ apk add gcompat
64
63
 
65
- gem install pg
64
+ There is one use case the binary gems don't support: Retrieval of connection [options from LDAP](https://www.postgresql.org/docs/current/libpq-ldap.html). To support this `libldap` would be necessary, but it has a lot of dependencies. It doesn't seem to be a widely used feature and that it's worth to support it. If it's necessary, the source gem can be forced.
65
+
66
+ ### Source gem
67
+
68
+ The source gem can be forced by:
69
+
70
+ gem install pg --platform ruby
66
71
 
67
72
  You may need to specify the path to the 'pg_config' program installed with
68
73
  Postgres:
@@ -73,6 +78,28 @@ If you're installing via Bundler, you can provide compile hints like so:
73
78
 
74
79
  bundle config build.pg --with-pg-config=<path to pg_config>
75
80
 
81
+ ### Bundler
82
+
83
+ To make sure, the necessary platforms and the source gem are fetched by bundler, they can be added like so
84
+
85
+ ```
86
+ bundle lock --add-platform x86_64-linux
87
+ bundle lock --add-platform arm64-darwin
88
+ bundle lock --add-platform x64-mingw-ucrt
89
+ bundle lock --add-platform ruby
90
+ bundle package --all-platforms
91
+ ```
92
+
93
+ A re-run of `bundle package` is also necessary after `bundle update`, in order to retrieve the new specific gems of all platforms.
94
+
95
+ If the binary gems don't work for some reason, it's easy to force the usage of the source gem in the Gemfile:
96
+
97
+ ```
98
+ gem "pg", force_ruby_platform: true
99
+ ```
100
+
101
+ ### More
102
+
76
103
  See README-OS_X.rdoc for more information about installing under MacOS X, and
77
104
  README-Windows.rdoc for Windows build/installation instructions.
78
105
 
@@ -85,6 +112,19 @@ can be found in [the `certs` directory](https://github.com/ged/ruby-pg/tree/mast
85
112
  of the repository.
86
113
 
87
114
 
115
+ ## Versioning
116
+
117
+ We tag and release gems according to the [Semantic Versioning](http://semver.org/) principle.
118
+
119
+ As a result of this policy, you can (and should) specify a dependency on this gem using the [Pessimistic Version Constraint](http://guides.rubygems.org/patterns/#pessimistic-version-constraint) with two digits of precision.
120
+
121
+ For example:
122
+
123
+ ```ruby
124
+ spec.add_dependency 'pg', '~> 1.0'
125
+ ```
126
+
127
+
88
128
  ## Type Casts
89
129
 
90
130
  Pg can optionally type cast result values and query parameters in Ruby or
data/Rakefile CHANGED
@@ -50,7 +50,9 @@ CrossLibraries = [
50
50
  ['x86-mingw32', 'mingw', 'i686-w64-mingw32'],
51
51
  ['x64-mingw32', 'mingw64', 'x86_64-w64-mingw32'],
52
52
  ['x86_64-linux', 'linux-x86_64', 'x86_64-linux-gnu'],
53
+ ['x86_64-linux-musl', 'linux-x86_64', 'x86_64-unknown-linux-musl'],
53
54
  ['aarch64-linux', 'linux-aarch64', 'aarch64-linux-gnu'],
55
+ ['aarch64-linux-musl', 'linux-aarch64', 'aarch64-linux-musl'],
54
56
  ['x86_64-darwin', 'darwin64-x86_64', 'x86_64-apple-darwin'],
55
57
  ['arm64-darwin', 'darwin64-arm64', 'arm64-apple-darwin'],
56
58
  ].map do |platform, openssl_config, toolchain|
@@ -68,7 +70,13 @@ Rake::ExtensionTask.new do |ext|
68
70
  ext.lib_dir = 'lib'
69
71
  ext.source_pattern = "*.{c,h}"
70
72
  ext.cross_compile = true
71
- ext.cross_platform = CrossLibraries.map(&:platform)
73
+
74
+ # Activate current cross compiled platform only.
75
+ # This is to work around the issue that `linux` platform is selected in `linux-musl` image.
76
+ ext.cross_platform = CrossLibraries.map(&:platform).select do |pl|
77
+ m = ENV["RCD_IMAGE"]&.match(/:(?<ruby_ver>[\d\.]+)-mri-(?<platform>[-\w]+)$/)
78
+ m && m[:platform] == pl
79
+ end
72
80
 
73
81
  ext.cross_config_options += CrossLibraries.map do |xlib|
74
82
  {
@@ -85,6 +93,9 @@ Rake::ExtensionTask.new do |ext|
85
93
  spec.files << "ports/#{spec.platform.to_s}/lib/libpq-ruby-pg.so.1" if spec.platform.to_s =~ /linux/
86
94
  spec.files << "ports/#{spec.platform.to_s}/lib/libpq-ruby-pg.1.dylib" if spec.platform.to_s =~ /darwin/
87
95
  spec.files << "ports/#{spec.platform.to_s}/lib/libpq.dll" if spec.platform.to_s =~ /mingw|mswin/
96
+
97
+ # Binary gems don't postgresql header+lib files
98
+ spec.metadata.delete("msys2_mingw_dependencies")
88
99
  end
89
100
  end
90
101
 
data/ext/pg_coder.c CHANGED
@@ -364,6 +364,7 @@ pg_coder_flags_get(VALUE self)
364
364
  * Specifies whether the assigned #elements_type requires quotation marks to
365
365
  * be transferred safely. Encoding with #needs_quotation=false is somewhat
366
366
  * faster.
367
+ * It is only used by text coders and ignored by binary coders.
367
368
  *
368
369
  * The default is +true+. This option is ignored for decoding of values.
369
370
  */
@@ -397,6 +398,7 @@ pg_coder_needs_quotation_get(VALUE self)
397
398
  * Specifies the character that separates values within the composite type.
398
399
  * The default is a comma.
399
400
  * This must be a single one-byte character.
401
+ * It is only used by text coders and ignored by binary coders.
400
402
  */
401
403
  static VALUE
402
404
  pg_coder_delimiter_set(VALUE self, VALUE delimiter)
data/lib/pg/coder.rb CHANGED
@@ -72,12 +72,13 @@ module PG
72
72
 
73
73
  class CompositeCoder < Coder
74
74
  def to_h
75
- { **super,
75
+ h = { **super,
76
76
  elements_type: elements_type,
77
77
  needs_quotation: needs_quotation?,
78
78
  delimiter: delimiter,
79
- dimensions: dimensions,
80
79
  }
80
+ h[:dimensions] = dimensions if dimensions # Write only when set, for Marshal compat with pg<1.6
81
+ h
81
82
  end
82
83
 
83
84
  def inspect
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.6.0'
3
+ VERSION = '1.6.1'
4
4
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -33,7 +33,7 @@ cert_chain:
33
33
  DrkJ9tVlPQtJB0LqT0tvBap4upnwT1xYq721b5dwH6AF4Pi6iz/dc5vnq1/MH8bV
34
34
  8VbbBzzeE7MsvgkP3sHlLmY8PtuyViJ8
35
35
  -----END CERTIFICATE-----
36
- date: 2025-07-27 00:00:00.000000000 Z
36
+ date: 1980-01-02 00:00:00.000000000 Z
37
37
  dependencies: []
38
38
  description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
39
39
  10 and later.
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  - !ruby/object:Gem::Version
244
244
  version: '0'
245
245
  requirements: []
246
- rubygems_version: 3.6.2
246
+ rubygems_version: 3.7.1
247
247
  specification_version: 4
248
248
  summary: Pg is the Ruby interface to the PostgreSQL RDBMS
249
249
  test_files: []
metadata.gz.sig CHANGED
Binary file