Skip to content

Commit 999c710

Browse files
committed
Merge branch 'master' into picky_nodes
2 parents 9757fb8 + f0b9bac commit 999c710

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ EXPLAIN SELECT * FROM items WHERE id = 1234;
192192
-> Index Scan using items_34_pkey on items_34 (cost=0.28..8.29 rows=0 width=0)
193193
Index Cond: (id = 1234)
194194
```
195-
Note that pg_pathman exludes parent table from the query plan. To access parent table use ONLY modifier:
195+
Note that pg_pathman excludes parent table from the query plan. To access parent table use ONLY modifier:
196196
```
197197
EXPLAIN SELECT * FROM ONLY items;
198198
QUERY PLAN

init.sql

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ CREATE OR REPLACE FUNCTION @extschema@.get_schema_qualified_name(
252252
RETURNS TEXT AS
253253
$$
254254
BEGIN
255-
RETURN relnamespace::regnamespace || delimiter || quote_ident(relname || suffix) FROM pg_class WHERE oid = cls::oid;
255+
RETURN (SELECT quote_ident(relnamespace::regnamespace::text) ||
256+
delimiter ||
257+
quote_ident(relname || suffix)
258+
FROM pg_class
259+
WHERE oid = cls::oid);
256260
END
257261
$$
258262
LANGUAGE plpgsql;
@@ -264,23 +268,23 @@ CREATE OR REPLACE FUNCTION @extschema@.validate_relations_equality(relation1 OID
264268
RETURNS BOOLEAN AS
265269
$$
266270
DECLARE
267-
rec RECORD;
271+
rec RECORD;
268272
BEGIN
269-
FOR rec IN (
270-
WITH
271-
a1 AS (select * from pg_attribute where attrelid = relation1 and attnum > 0),
272-
a2 AS (select * from pg_attribute where attrelid = relation2 and attnum > 0)
273-
SELECT a1.attname name1, a2.attname name2, a1.atttypid type1, a2.atttypid type2
274-
FROM a1
275-
FULL JOIN a2 ON a1.attnum = a2.attnum
276-
)
277-
LOOP
278-
IF rec.name1 IS NULL OR rec.name2 IS NULL OR rec.name1 != rec.name2 THEN
279-
RETURN False;
280-
END IF;
281-
END LOOP;
282-
283-
RETURN True;
273+
FOR rec IN (
274+
WITH
275+
a1 AS (select * from pg_attribute where attrelid = relation1 and attnum > 0),
276+
a2 AS (select * from pg_attribute where attrelid = relation2 and attnum > 0)
277+
SELECT a1.attname name1, a2.attname name2, a1.atttypid type1, a2.atttypid type2
278+
FROM a1
279+
FULL JOIN a2 ON a1.attnum = a2.attnum
280+
)
281+
LOOP
282+
IF rec.name1 IS NULL OR rec.name2 IS NULL OR rec.name1 != rec.name2 THEN
283+
RETURN False;
284+
END IF;
285+
END LOOP;
286+
287+
RETURN True;
284288
END
285289
$$
286290
LANGUAGE plpgsql;

range.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ LANGUAGE plpgsql;
613613
* partition will be destroyed.
614614
*
615615
* Notes: dummy field is used to pass the element type to the function
616-
* (it is neccessary because of pseudo-types used in function)
616+
* (it is necessary because of pseudo-types used in function)
617617
*/
618618
CREATE OR REPLACE FUNCTION @extschema@.merge_range_partitions_internal(
619619
p_parent_relid OID

0 commit comments

Comments
 (0)