Zandis Murāns Posted March 13, 2008 Report Share Posted March 13, 2008 Kas par jokiem? Tipa uz viena postgresql servera palaidu "CREATE LANGUAGE plpgsql;" un viss notikās, viss strādā, a uz cita: ERROR: syntax error at or near ";" LINE 1: CREATE LANGUAGE plpgsql; ^ ********** Error ********** ERROR: syntax error at or near ";" SQL state: 42601 Character: 24 Link to comment Share on other sites More sharing options...
Guest Zigis Posted March 13, 2008 Report Share Posted March 13, 2008 Izmēģini nelikt semikolu beigās. Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 13, 2008 Author Report Share Posted March 13, 2008 ERROR: syntax error at end of input LINE 1: CREATE LANGUAGE plpgsql ^ ********** Error ********** ERROR: syntax error at end of input SQL state: 42601 Character: 24 Link to comment Share on other sites More sharing options...
andrisp Posted March 13, 2008 Report Share Posted March 13, 2008 Salīdzini versijas. Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 13, 2008 Author Report Share Posted March 13, 2008 Publiski? "PostgreSQL 8.2.6 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)" - tur iet, "PostgreSQL 8.0.9 on i386-pc-dragonfly, compiled by GCC gcc (GCC) 3.4.5 20050809 (prerelease) [DragonFly] (propolice, visibility)" - a tur nē. Link to comment Share on other sites More sharing options...
bubu Posted March 13, 2008 Report Share Posted March 13, 2008 Tad jau viss skaidrs, ne? 8.0.9 < 8.2.6 Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 13, 2008 Author Report Share Posted March 13, 2008 http://www.postgresql.org/docs/7.4/interac...telanguage.html A tur nav rakstīts, ka no 7.4 versijas var? Link to comment Share on other sites More sharing options...
bubu Posted March 13, 2008 Report Share Posted March 13, 2008 Tajā linkā ir dota sekojoša sintakse: CREATE LANGUAGE name HANDLER call_handler Kur ir tavs HANDLER? Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 13, 2008 Author Report Share Posted March 13, 2008 Tipa lai uztaisītu valodu, man vajag funkciju gatavu. Lai uztaisītu funkciju, man vajag valodu. Neko nesaprotu. Link to comment Share on other sites More sharing options...
bubu Posted March 13, 2008 Report Share Posted March 13, 2008 Nezinu gan kāpēc tu gribētu taisīt jaunu valodu, bet no tā linka toč ir skaidrs, ka jābūt ir uzdefinētai kautkādai handlera funkcijai, kura mācēs izpildīt tavas jaunās valodas funkcijas. Ja tev nav pieejama šī handlera funkcija kautkādā gatavā bibliotēkā, tad fig tev sanāks uztaisīt to valodu. Tipa no šī linka http://www.postgresql.org/docs/8.2/static/...telanguage.html man top skaidrs, ka "There are two forms of the CREATE LANGUAGE command. In the first form, the user supplies just the name of the desired language, and the PostgreSQL server consults the pg_pltemplate system catalog to determine the correct parameters. " Tb Postgre kautkādām savām esošām valodām māk paņemt to handleri no pg_pltemplate sistēmas kataloga. Vecākās versijās acīmredzot nebija šāda pg_pltemplate, un vajadzēja vienmēr to handleri norādīt manuāli. Vecākām versijām btw manuālī ir rakstīts: "This command normally should not be executed directly by users. For the procedural languages supplied in the PostgreSQL distribution, the createlang program should be used, which will also install the correct call handler. (createlang will call CREATE LANGUAGE internally.)" Tā ka RTFM vairāk :) Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 14, 2008 Author Report Share Posted March 14, 2008 Tad sanāk, ka tajā jaunajā versijā tā handlera funkcija JAU ir nodefinēta. Kā es varu apskatīties to handlera funkciju no jaunās versijas, lai varētu viņu uztaisīt vecajā? Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 14, 2008 Author Report Share Posted March 14, 2008 Irrr, atradu, viss ir forši. Link to comment Share on other sites More sharing options...
bubu Posted March 14, 2008 Report Share Posted March 14, 2008 Tad pastāsti mums ar, varbūt kādam citam arī vēlāk noderēs. Link to comment Share on other sites More sharing options...
Delfins Posted March 14, 2008 Report Share Posted March 14, 2008 Es izmantoju shell scriptu (iekš PG bin direktorijas). Ērtāk... nav jālogojās papildus, kaut kas jāraksta... Link to comment Share on other sites More sharing options...
Zandis Murāns Posted March 14, 2008 Author Report Share Posted March 14, 2008 (edited) --Izveidoju valodas handleri CREATE OR REPLACE FUNCTION plpgsql_call_handler() RETURNS language_handler AS '$libdir/plpgsql', 'plpgsql_call_handler' LANGUAGE 'c' VOLATILE; ALTER FUNCTION plpgsql_call_handler() OWNER TO pgsql; --Izveidoju valodu: CREATE LANGUAGE plpgsql handler plpgsql_call_handler; Edited March 14, 2008 by Zandis Murāns Link to comment Share on other sites More sharing options...
Recommended Posts