@@ -486,8 +486,8 @@ BEGIN
486
486
487
487
SELECT nodes .connstring FROM shardman .nodes WHERE id = part .owner
488
488
INTO connstring;
489
- SELECT * FROM shardman .conninfo_to_postgres_fdw_opts (connstring, ' ADD ' )
490
- INTO server_opts, um_opts;
489
+ SELECT * FROM shardman .conninfo_to_postgres_fdw_opts (connstring)
490
+ INTO server_opts, um_opts;
491
491
492
492
-- ALTER FOREIGN TABLE doesn't support changing server, ALTER SERVER doesn't
493
493
-- support dropping all params, and I don't want to recreate foreign table
@@ -582,11 +582,9 @@ END $$ LANGUAGE plpgsql;
582
582
-- have C function which parses the opts and returns them in two parallel
583
583
-- arrays, and this sql function joins them with quoting. TODO: of course,
584
584
-- quote_literal_cstr exists.
585
- -- prfx is prefix added before opt name, e.g. 'ADD ' for use in ALTER SERVER.
586
585
-- Returns two strings: one with opts ready to pass to CREATE FOREIGN SERVER
587
586
-- stmt, and one wih opts ready to pass to CREATE USER MAPPING.
588
- CREATE FUNCTION conninfo_to_postgres_fdw_opts (
589
- IN connstring text , IN prfx text DEFAULT ' ' ,
587
+ CREATE FUNCTION conninfo_to_postgres_fdw_opts (IN connstring text ,
590
588
OUT server_opts text , OUT um_opts text ) RETURNS record AS $$
591
589
DECLARE
592
590
connstring_keywords text [];
@@ -608,14 +606,14 @@ BEGIN
608
606
um_opts := um_opts || ' , ' ;
609
607
END IF;
610
608
um_opts_first_time_through := false;
611
- um_opts := prfx || um_opts ||
609
+ um_opts := um_opts ||
612
610
format(' %s %L' , connstring_keywords[i], connstring_vals[i]);
613
611
ELSE -- server option
614
612
IF NOT server_opts_first_time_through THEN
615
613
server_opts := server_opts || ' , ' ;
616
614
END IF;
617
615
server_opts_first_time_through := false;
618
- server_opts := prfx || server_opts ||
616
+ server_opts := server_opts ||
619
617
format(' %s %L' , connstring_keywords[i], connstring_vals[i]);
620
618
END IF;
621
619
END LOOP;
0 commit comments