I'm having problem with Slony-I - Mailing list pgadmin-support
From | Renaud Fortier |
---|---|
Subject | I'm having problem with Slony-I |
Date | |
Msg-id | 001c01c64d19$df9eb840$1caecb84@fsaa.ulaval.ca Whole thread Raw |
List | pgadmin-support |
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Hi,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">I installed a Slony-I cluster on a test database on my production server. When I try to join thisnew cluster from my test database on my development server, I always got this error: </span></font><p class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">----------------------------------------------</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">An error has occurred:</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">ERROR: syntax error at or near “$” at character 1959</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">----------------------------------------------</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">This is the SQL near the character 1959 (AS $_$):</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">----------------------------------------------</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">--</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">-- Name: add_missing_table_field(text, text, text, text); Type: FUNCTION; Schema: _MY_Cluster;Owner: postgres</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">--</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">CREATE FUNCTION add_missing_table_field(text, text, text, text) RETURNS boolean</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> AS $_$</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">DECLARE</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> p_namespace alias for $1;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanlang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> p_table alias for $2;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanlang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> p_field alias for $3;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanlang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> p_type alias for $4;</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanlang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> v_row record;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> v_query text;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial">BEGIN</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> select 1 into v_row from pg_namespace n, pg_class c, pg_attribute a</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> where "_MY_Cluster".slon_quote_brute(n.nspname) = p_namespace and </span></font><p class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> c.relnamespace = n.oid and</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanlang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> "_MY_Cluster".slon_quote_brute(c.relname) = p_table and</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> a.attrelid = c.oid and</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanlang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> "_MY_Cluster".slon_quote_brute(a.attname) = p_field;</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> if not found then</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> raise notice 'Upgrade table %.% - add field %', p_namespace, p_table, p_field;</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> v_query := 'alter table ' || p_namespace || '.' || p_table || ' add column ';</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> v_query := v_query || p_field || ' ' || p_type || ';';</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> execute v_query;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> return 't';</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> else</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> return 'f';</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> end if;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">END;$_$</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> LANGUAGE plpgsql;</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA"style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">---------------------------------------------------</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">Could you help me please with this error?</span></font><p class="MsoNormal"><font face="Arial"size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial">Thank you</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="EN-CA" style="font-size: 10.0pt;font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Renaud Fortier</span></font><p class="MsoNormal"><font face="Times New Roman" size="3"><span style="font-size: 12.0pt"> </span></font></div>
pgadmin-support by date: