Thread: DO hint update?
Does this need updating now that languages are more exensiony? Or is it OK? if (!HeapTupleIsValid(languageTuple)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("language \"%s\" does not exist", languageName), (PLTemplateExists(languageName) ? errhint("UseCREATE LANGUAGE to load the language into the database.") : 0))); -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Robert Haas <robertmhaas@gmail.com> writes: > Does this need updating now that languages are more exensiony? Or is > it OK? > if (!HeapTupleIsValid(languageTuple)) > ereport(ERROR, > (errcode(ERRCODE_UNDEFINED_OBJECT), > errmsg("language \"%s\" does not > exist", languageName), > (PLTemplateExists(languageName) ? > errhint("Use CREATE LANGUAGE to load > the language into the database.") : 0))); Hm ... the core languages would now prefer CREATE EXTENSION, but it's not clear how fast non-core PLs will follow suit. Perhaps "Use CREATE EXTENSION or CREATE LANGUAGE to load ..." ? regards, tom lane
On Mar 27, 2011, at 12:10 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Hm ... the core languages would now prefer CREATE EXTENSION, but it's > not clear how fast non-core PLs will follow suit. > > Perhaps "Use CREATE EXTENSION or CREATE LANGUAGE to load ..." ? Dear me. If we don't know what's right, how will anyone else? ...Robert
Tom Lane <tgl@sss.pgh.pa.us> writes: > Perhaps "Use CREATE EXTENSION or CREATE LANGUAGE to load ..." ? The only better phrasing I can think of would be to replace the or with "then". Or… is it practical here to look at the available extensions and choose the HINT depending on whether the given language is there or not? -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support