DO hint update?

Started by Robert Haasalmost 15 years ago4 messages
#1Robert Haas
robertmhaas@gmail.com

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)));

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#1)
Re: DO hint update?

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

#3Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#2)
Re: DO hint update?

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

#4Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Tom Lane (#2)
Re: DO hint update?

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