Getting Invalid schema name error on postgresql RDS after upgrading from 9.3 to 9.4 - postgresql

As pointed by amazon that PostgreSQL 9.3 is deprecated and need to upgrade our version of PostgreSQL to upper version, we just upgraded our version to 9.4. But after upgrade we are not able to do any save() operation from your Yii 1.1 project locally but the operation is working fine from the server.
When we try to run our project from locally and connect the remote PostgreSQL, we got the below error.
{"error":"SQLSTATE[3F000]: Invalid schema name: 7 ERROR: schema
\"publicubfo06sm23qicfa8kmm0nrv3td81qf928i\" does not
exist","try":"end"}
When I try to see my existing schemas using,
SELECT table_name FROM information_schema.tables
I got 3 values namely 'public','pg_catalog', 'information_schema'
Also want to mention that previously with our version 9.3 we were able to do model operations on Yii 1.1 like $model->save() and then immediately get back the primary key value using $model->id or $model->getPrimaryKey() but now it is not working. Only the $lastId = Yii::app()->db->getLastInsertID('tbl_user_group_id_seq'); way is working now.
Can anyone point me out what is the reason behind it? is something get lost while upgrading from 9.3 to 9.4 like schema, role, sequence or anything else that is causing the errors now to access my RDS from local machine.

Related

You have specified a database that is not empty, please specify an empty database

I'm trying to connect to an RDS cluster in AWS that's an Aurora PostgreSQL database. It's a brand-new database that I created along with the instances that I have Jira deployed to. However, when I try to connect to the instance from the Jira configuration screen I get this error
You have specified a database that is not empty, please specify an empty database.
I haven't touched this database at all, why is it giving me this error? I have one read and one write database in my cluster and the "hostname" is the endpoint for my write database, which is what the docs say. Could this be an issue with the Jira version I'm using?
This is the download link I'm using in my user-data script to install Jira. I'm also using PostgreSQL version 12.11
https://www.atlassian.com/software/jira/downloads/binary/atlassian-servicedesk-4.19.1-x64.bin
I switched to a different PostgreSQL version and now it's working.
PostgreSQL version 12.11 was giving me the error and switching to version 13.7 works as expected.

RDS upgrade postgres version 13.1, unsupported DB Instance Class

I'm trying to upgrade from version 12.5 to the version 13.1 in RDS. But I'm receiving an error similar to the one described in this question: RDS does not support creating a DB instance with the following combination. As far as I understand in order to upgrade a proper version DB instance class should be selected. However the error message shows a previous selection, not a new one. Same message is received in Terraform setting up
engine_version = "13.1"
instance_class = "db.t3.small"
Screenshot from AWS showing the changes and message:
Copied error message to make it easier to research:
We're sorry, your request to modify DB instance [service-name] has failed.
RDS does not support creating a DB instance with the following combination: DBInstanceClass=db.t2.small, Engine=postgres, EngineVersion=13.1, LicenseModel=postgresql-license. For supported combinations of instance class and database engine version, see the documentation.
Is there some key to allow_instance_class_change (a made up key) or something else I overlooked what prevents an upgrade? Thank you!
I would suggest upgrading to T3 first, then upgrading to PostgreSQL 13. If you need to do those at the same time you might have better luck going through the API, but I'm guessing the way the version 13 upgrade works you need to already be on a supported instance type for the upgrade to proceed.

phraseto_tsquery in PostgreSQL 9.5x or just from 9.6x?

I'm finding references in the 9.5 manual to phraseto_tsquery
https://postgrespro.com/docs/postgrespro/9.5/textsearch-controls
But if I use it in my query it gives me this error:
No function matches the given name and argument types.
SELECT phraseto_tsquery('english', 'The Fat Rats');
Was this function not added with 9.5 as intended or is it likely there's some other problem on my side. Running 9.5.4 of the database currently. Anyone that can confirm?
For anyone looking; took the step to install postgresql 9.6beta4 and I'm no longer receiving the error message. In other words phraseto_tsquery seems to only be fully supporting in the current 9.6 beta and upcoming full release.

Postgres Upgrade Heroku from 9.2.4 to 9.3

I am fairly new to Rails and especially Heroku. I received an email informing me that I needed to update my PostgreSQL DB version. I am a little fuzzy on how to accomplish this without changing my plan. I am currently using Heroku's Kappa Postgres plan. Based on what I am reading here:
https://devcenter.heroku.com/articles/upgrade-heroku-postgres-with-pgbackups
Should I use the command:
heroku addons:add heroku-postgresql:kappa --version 9.3
And then just continue on as instructed?
Just doing this myself, from 9.2.4 databases ...
You don't have to upgrade to 9.3, you can just create a new 9.2 and it will be 9.2.6, in which the issue you're being notified about has been fixed. However if you go to 9.3 the plans are different -- https://devcenter.heroku.com/articles/heroku-postgres-plans#standard-tier
It's more simple/safe to upgrade with a follower database. Instructions here, although you probably want to add your app name to most of those commands. https://devcenter.heroku.com/articles/heroku-postgres-follower-databases#database-upgrades-and-migrations-with-changeovers

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

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?"
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:
Is this the right db? The right server?
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.