tag:blogger.com,1999:blog-5541296000399974369.post3735430954923724068..comments2024-03-09T02:51:27.612-05:00Comments on Peter Eisentraut's Blog: Readding implicit casts in PostgreSQL 8.3Anonymoushttp://www.blogger.com/profile/02849480732923051923noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-5541296000399974369.post-25899155448096125072014-01-09T00:13:16.764-05:002014-01-09T00:13:16.764-05:00Hi,
I create insert function but when that execute...Hi,<br />I create insert function but when that execute for insert data that time generate error this function does not exit. what problem in function execution?<br />My function<br /><br />CREATE OR REPLACE FUNCTION insertuserlogin(userloginidp integer, usercategoryidf integer, usertypeidf integer, usertypereferenceidf integer, loginname character varying, loginpassword character varying, menutypeidf integer, username character varying, dashboardconfig text, careprovideridf integer, isactive boolean)<br /> RETURNS void AS<br />$BODY$BEGIN<br /> INSERT INTO "tbuserlogin" VALUES (userloginidp,usercategoryidf,usertypeidf,usertypereferenceidf,loginname,loginpassword,menutypeidf,username,dashboardconfig,careprovideridf,isactive);<br />END$BODY$<br /> LANGUAGE plpgsql VOLATILE<br /> COST 100;<br />ALTER FUNCTION insertuserlogin(integer, integer, integer, integer, character varying, character varying, integer, character varying, text, integer, boolean)<br /> OWNER TO postgres;<br /><br />Insert Data Query<br /><br />SELECT insertuserlogin(1,2,4,3,'fg','sdf',6,'err','fgsd',7);<br /><br />Error<br /><br />RROR: function insertuserlogin(integer, integer, integer, integer, unknown, unknown, integer, unknown, unknown, integer) does not exist<br />LINE 1: SELECT insertuserlogin(1,2,4,3,'fg','sdf',6,'err','fgsd',7);<br /> ^<br />HINT: No function matches the given name and argument types. You might need to add explicit type casts.<br /><br /><br />Anonymoushttps://www.blogger.com/profile/07955864585166156968noreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-57552667697797025042012-05-29T13:59:04.159-04:002012-05-29T13:59:04.159-04:00Hi, you could help me with this error:
pg_query()...Hi, you could help me with this error:<br /><br />pg_query(): Query failed: ERROR: el operador no es �nico: d_valor_numerico || unknown LINE 8: cast(p.valor_1||' '||m.simbolo as varchar) as valor1_comple... ^ HINT: No se pudo escoger el operador m�s adecuado. Puede ser necesario agregar conversiones expl�citas de tipos.Anonymoushttps://www.blogger.com/profile/07381817295288667706noreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-74432715938149071712012-05-11T01:10:39.050-04:002012-05-11T01:10:39.050-04:00I want an explicit type cast for character varying...I want an explicit type cast for character varying = integer error. When I write mycolumn=?::text(or)mycolumn=?::char(or)<br />mycolumn=?::character varying(20)(or)mycolumn=?::string in my sql statement .But,not ok.What i want to know is how to type cast explicitly from integer to character varying.MrPeacehttps://www.blogger.com/profile/01354250642752585375noreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-4172811502969681772011-03-03T11:29:34.296-05:002011-03-03T11:29:34.296-05:00What's the difference between implicit cast an...What's the difference between implicit cast and explicit cast?Brad Fallonhttp://www.facebook.com/bradfallonnoreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-50551022799936991042010-06-28T12:55:42.281-04:002010-06-28T12:55:42.281-04:00@Milton
I don't have any experiences with 8.2...@Milton<br /><br />I don't have any experiences with 8.2 cast compatibility. There is no simple parameter, but I imagine the recipe described here for 8.3 should apply similarly, meaning you can add (or remove) the missing casts, as the case may be.Anonymoushttps://www.blogger.com/profile/02849480732923051923noreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-26827696269151036312010-06-23T10:03:13.918-04:002010-06-23T10:03:13.918-04:00Exist some option to set the 8.2 cast compatibilit...Exist some option to set the 8.2 cast compatibility, some like put a option at the pg conf files?Milton Labandahttps://www.blogger.com/profile/13188325082757906571noreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-15928345911485379682009-04-27T01:10:00.000-04:002009-04-27T01:10:00.000-04:00I'm trying to get my EXECUTE function to work and ...I'm trying to get my EXECUTE function to work and is giving me type cast errors and has me stumped. And I'm not sure how to align the casting properly.<br /><br />I have a trigger that calls a function. In my trigger I dynamically create my select statement. <br /><br />My Variable:<br />array_details character varying[];<br />I populate it with {a,b}<br /><br />Hard-coded (Works):<br />SELECT catalogue.cg_bdd (ARRAY['a','b']);<br /><br />Dynamically Created (Fails):<br />EXECUTE 'SELECT catalogue.cg_bdd '(' || array_details || ');';<br /><br />Error:<br />ERROR: operator does not exist: text || character varying[]<br />LINE 1: SELECT 'SELECT ' || $1 || '(' || $2 || ');'<br />HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.<br />QUERY: SELECT 'SELECT ' || $1 || '(' || $2 || ');'Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-65751275632155524062009-03-14T06:22:00.000-04:002009-03-14T06:22:00.000-04:00Thank you for your superbly simple and helpful typ...Thank you for your superbly simple and helpful typecasting sqls.Brainspothttps://www.blogger.com/profile/12500579919807815674noreply@blogger.comtag:blogger.com,1999:blog-5541296000399974369.post-68677209986613897872009-02-25T02:56:00.000-05:002009-02-25T02:56:00.000-05:00Hi,I noticed that using these "comptability casts"...Hi,<BR/><BR/>I noticed that using these "comptability casts" for Postgresql 8.3 can cause some problems when concatenating strings and non-strings, as explained here:<BR/><BR/>http://www.postgresql.org/docs/current/static/functions-string.html<BR/><BR/>Example:<BR/>--------------------<BR/>CREATE FUNCTION pg_catalog.text(integer) RETURNS text STRICT IMMUTABLE LANGUAGE SQL AS 'SELECT textin(int4out($1));';<BR/>CREATE CAST (integer AS text) WITH FUNCTION pg_catalog.text(integer) AS IMPLICIT;<BR/><BR/>select 'value = ' || 123<BR/>--------------------<BR/>ERROR: operator is not unique: unknown || integer<BR/>LINE 4: select 'value = ' || 123<BR/> ^<BR/>HINT: Could not choose a best candidate operator. You might need to add explicit type casts.<BR/>--------------------<BR/><BR/>Without the casts, concatenation without explicit cast works just fine:<BR/>--------------------<BR/>select 'value = ' || 123<BR/>--------------------<BR/>value = 123<BR/>--------------------Anonymousnoreply@blogger.com