pg_saurus 4.0.3 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6752e3270a15b3c039999db06e47cef3a6cbb7bddc6b9c1a11e3a53b3e032932
|
4
|
+
data.tar.gz: bdcf9f4e1d30a30f84930595dba797e005e6e42e29e74cbd9eb0fad929d4f09b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f26c0a9d9147f8a2af05eefc95f7f65d21ab048cec633b93875a652e8ae77815e248ffe6c09155f3318e8d81cb53ef957cb00a9562e37baeffaee6b6c8bdf542
|
7
|
+
data.tar.gz: 2867b714cf7599e686cce0f01f388f227874f00c641fb8b969fbf1a3316886c21c4a9e665d96fe0dbbd3fb3dc359157ae62ed1ed0e9c6eb7a735695ff14925ec
|
@@ -112,8 +112,7 @@ module PgSaurus::ConnectionAdapters::PostgreSQLAdapter::ExtensionMethods
|
|
112
112
|
# @return [Hash{String => Hash{Symbol => String}}] A list of loaded extensions with their options
|
113
113
|
def pg_extensions
|
114
114
|
# Check postgresql version to not break on Postgresql < 9.1 during schema dump
|
115
|
-
|
116
|
-
return {} unless pg_version_str =~ /^PostgreSQL (\d+\.\d+.\d+)/ && ($1 >= '9.1')
|
115
|
+
return {} if (::PgSaurus::Engine.pg_server_version <=> [9, 1]) < 0
|
117
116
|
|
118
117
|
sql = <<-SQL
|
119
118
|
SELECT pge.extname AS ext_name, pgn.nspname AS schema_name, pge.extversion AS ext_version
|
@@ -11,12 +11,13 @@ module PgSaurus::ConnectionAdapters::PostgreSQLAdapter::FunctionMethods
|
|
11
11
|
|
12
12
|
# Return a list of defined DB functions. Ignore function definitions that can't be parsed.
|
13
13
|
def functions
|
14
|
+
pg_major = ::PgSaurus::Engine.pg_server_version[0]
|
14
15
|
res = select_all <<-SQL
|
15
16
|
SELECT n.nspname AS "Schema",
|
16
17
|
p.proname AS "Name",
|
17
18
|
pg_catalog.pg_get_function_result(p.oid) AS "Returning",
|
18
19
|
CASE
|
19
|
-
WHEN p.proiswindow
|
20
|
+
WHEN #{pg_major >= 11 ? "p.prokind = 'w'" : "p.proiswindow"} THEN 'window'
|
20
21
|
WHEN p.prorettype = 'pg_catalog.trigger'::pg_catalog.regtype THEN 'trigger'
|
21
22
|
ELSE 'normal'
|
22
23
|
END AS "Type",
|
@@ -26,7 +27,7 @@ module PgSaurus::ConnectionAdapters::PostgreSQLAdapter::FunctionMethods
|
|
26
27
|
WHERE pg_catalog.pg_function_is_visible(p.oid)
|
27
28
|
AND n.nspname <> 'pg_catalog'
|
28
29
|
AND n.nspname <> 'information_schema'
|
29
|
-
AND p.proisagg <> TRUE
|
30
|
+
AND #{pg_major >= 11 ? "p.prokind <> 'a'" : "p.proisagg <> TRUE"}
|
30
31
|
ORDER BY 1, 2, 3, 4;
|
31
32
|
SQL
|
32
33
|
res.inject([]) do |buffer, row|
|
data/lib/pg_saurus/engine.rb
CHANGED
@@ -2,6 +2,16 @@ module PgSaurus
|
|
2
2
|
# :nodoc:
|
3
3
|
class Engine < Rails::Engine
|
4
4
|
|
5
|
+
# Postgres server version.
|
6
|
+
#
|
7
|
+
# @return [Array<Integer>]
|
8
|
+
def self.pg_server_version
|
9
|
+
@pg_server_version ||=
|
10
|
+
::ActiveRecord::Base.connection.
|
11
|
+
select_value('SHOW SERVER_VERSION').
|
12
|
+
split('.')[0..1].map(&:to_i)
|
13
|
+
end
|
14
|
+
|
5
15
|
initializer "pg_saurus" do
|
6
16
|
ActiveSupport.on_load(:active_record) do
|
7
17
|
# load monkey patches
|
data/lib/pg_saurus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_saurus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Potapov Sergey
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
- Matt Dressel
|
11
11
|
- Bruce Burdick
|
12
12
|
- HornsAndHooves
|
13
|
-
autorequire:
|
13
|
+
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
date: 2020-01-31 00:00:00.000000000 Z
|
@@ -270,7 +270,7 @@ homepage: https://github.com/HornsAndHooves/pg_saurus
|
|
270
270
|
licenses:
|
271
271
|
- MIT
|
272
272
|
metadata: {}
|
273
|
-
post_install_message:
|
273
|
+
post_install_message:
|
274
274
|
rdoc_options: []
|
275
275
|
require_paths:
|
276
276
|
- lib
|
@@ -285,9 +285,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
285
|
- !ruby/object:Gem::Version
|
286
286
|
version: '0'
|
287
287
|
requirements: []
|
288
|
-
|
289
|
-
|
290
|
-
signing_key:
|
288
|
+
rubygems_version: 3.0.9
|
289
|
+
signing_key:
|
291
290
|
specification_version: 4
|
292
291
|
summary: ActiveRecord extensions for PostgreSQL.
|
293
292
|
test_files: []
|