PostgreSQL: After using CreateLang, I still get an error "42704: language "plpgsql" does not exist"

StackOverflow https://stackoverflow.com/questions/16302401

Question

I am using pgProvider on a MVC3 Mono application and had no issues on Windows Postgres 9.2. I am migrating to my production Linux/Mono environment, and received an error when attempting to access the provider:

"42704: language "plpgsql" does not exist"

I am using postgreSQL 8.4 on CentOS 6.3

I looked at some info, and ran the following:

createlang -d dbname plpgsql

When I run it again, it affirms that the database is already there.

I restarted postgresql and my app. However, I still get the above error.

Does anyone have any info on why I would still receive an "plpgsql does not exist -- after it is installed?"

Was it helpful?

Solution

In general this sort of error is an indication that something is not as you expect and you need to challenge your assumptions.

Please note that languages do not require restarting the database server to take effect on any version of PostgreSQL. Also note that what languages are allowed in PostgreSQL is a per-db catalog entry (languages, unlike users and roles, are not cluster-global).

So in troubleshooting this, you need to start with:

  1. Is this the right db? The right server?

  2. Is my application connecting to the same db/server I think it is?

Given that createlang affirms that the language exists after you run it, this can't be an issue with PostgreSQL raising a phony error. Instead it must be a problem with the changes you made not affecting the database your application is using.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top