PostGIS/PostgreSQL - ERROR: must be owner of type spheroid - sql

Hope you are well.
I am trying to move a PostGIS data table from one server to another. I have installed postgresql on the target machine, configured it to allow sensible authentication (username/password). I have also used yum to install the postgis2_91 package (including debuginfo, devel, docs and utils).
When i initially tried to restore the sql dump to the target server i got a load of errors, i put this down to postgis not being installed as it was complaining about the "geometry" data type.
I believe i need to follow these instructions (from spatially enable database) http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21CentOS6pgdg however, when i tried to run the command below I got an error saying "ERROR: must be owner of the spheroid", this is while I'm logged in as the "postgres" user which I believe has full permissions?
CREATE EXTENSION postgis;
Edit - I managed to fix this by completely removing postgres and postgis, then tried the procedure again and it worked. No idea why it didn't work but it is now resolved.
Any ideas?
Thanks
Paul

Related

Unable create tc server instance on sts 4

Creating server from server window in sts gives me this error. I am choosing base template to create server. I also tried using cmd with admin rights, still same error.
Error Details:create command failed. String runtimes not valid version format. Expected ,,[.patch][.release]
Reason: Error creating server instance with command:
D:\Users\pivotal location..\tcserver.bat create server -v runtimes -t base --property base.runtime.user=null --java-home C:\Java\jdk1.8.0_191. Check access permission for the directory D:\Users\pivotal location.. and its files and subdirectories.
Can't share the picture didn't have reputation.
It looks like the Pivotal tc Server installation sits in a read-only location on your disc or with limited write permissions. I would recommend to install tc-Server into a directory where you have full permissions, configure that install in STS, and try again. That should help.
You will get ahead if you provide a proper tc runtime version at the -v option. E.g. if you have the tc runtime tomcat-9.0.12.A.RELEASE installed, take "9.0.12.A.RELEASE" as runtime version.
Unfortunately you will not be out of the woods by doing so. Although a server instance will be created, there will be another error message: "The specified server is not valid. The .tc-runtime-instance file is missing.". There will be a .tc-runtime-instance-file in your instance-dir, but without any content. That's the point where I am currently sticking.

create or replace PACKAGE BODY not honored

The command create or replace PACKAGE ... is not being honored.
I have had numerous times where if I use # command in a driver file on a Package Body or Spec, where the old version of the code remains intact. The new version doesn't get uploaded. This has even happened when I drop the package in question, and use #THIS_PACKAGE_SPEC.SQL. The old package will come back. The error logs show the package loaded and compiled normally.
One way to deal with this is to load the THIS_PACKAGE_SPEC.SQL into developer and execute it by itself.
Another is to drop the old package, shut down and restart Oracle SQL Developer then proceed normally.
This problem has exhibited itself using both Oracle SQL Developer, and SQLPlus. In Unix and Linux environments.
Anyone else experience this?

The local psql command could not be located

I'm following the instructions found here.
When I try to run $ heroku pg:psql or $ heroku pg:psql HEROKU POSTGRESQL_BROWN I recieve the following error message:
! The local psql command could not be located ! For help
installing psql, see local-postgresql
I can't find anything useful on the link it gives me (it just links to the instructions I was already using, but further down the page) nor can I find this error anywhere else.
If I've missed anything you need to know to answer this, just let me know. I'm rather new to all this and teaching myself as I go.
I had same error even after installing Postgres locally.
But after seeing this
I saw that "pqsl" was not in the PATH so I then did
PATH=%PATH%;C:\Program Files\PostgreSQL\9.2\bin
which worked for me
I have since solved this myself. When I ran heroku pg:info it says the version number is 9.1.8, I was locally running 9.2
installing 9.1.8 and ensuring Path pointed to the appropriate folder solved the problem.
After you change the path, make sure to restart the terminal!
Set the PATH. To find out the PATH of your psql script (on mac) open the sql shell script from your finder in Applications/Postgres installation. This will give you a hint as to where it is installed. That opened a window which told me it is located here: /Library/PostgreSQL/8.4/scripts/runpsql.sh
Then, I set the PATH variable from the terminal window by typing:
$ PATH="/Library/PostgreSQL/8.4/bin:$PATH"
(depends on the location of your PostgreSQL installation, find your bin path first, another exp: /usr/local/Cellar/postgresql#9.6/9.6.8/bin)
OR.....
You can also connect to the shell by opening the shell directly from your postgres installation folder. Then enter the credentials. If you don't know the credentials, here is how to find them out:
$ heroku pg:info
=== HEROKU_POSTGRESQL_RED_URL (DATABASE_URL)
$ heroku pg:credentials HEROKU_POSTGRESQL_RED_URL
Top answer wouldn't work for me oddly, my system would not add the Path via cmd with administrator access (Not sure why).
So check this > Windows key > environment variables > system variables
And add the last line (your version may differ in the path)
Make sure you've installed the toolbelt as psql is installed by default.
However you also need to ensure you've installed a local copy of PostgreSQL; if you don't the toolbelt will be unable to find the native psql client.
Assuming you have installed a local copy of PostgreSQL, make sure you can execute psql from the command line directly (i.e make sure you PATH is set correctly ). If the command does not execute, check your PATH, if it does execute see if you can connect via the PSQL connection string provided in the Heroku control panel. If you can connect reinstall the toolbelt, if you are unable to connect provision another dev database and try again.
If there are still issues, I would suggest contacting Heroku support for assistance after verifying no API issues are listed on the status page located here.
I got rid if this annoying message on Windows by adding a path element without the spaces, i.e.
C:\Progra~1\PostgreSQL\9.4\data
instead of
“C:\Program Files\PostgreSQL\9.4\data”
I followed the instructions here: http://www.computerhope.com/issues/ch000549.htm, which worked for me if you prefer to go the point-and-click configuration of the PATH variable.
This type of error usually appears in the Windows environment, because if you do not update the PATH after installing Postgresql, heroku pg:psql command does not work.
So you need to update your PATH environment variable to add the bin directory of your Postgres installation. The directory will look like this:
C:\Program Files\PostgreSQL\<VERSION>\bin.
For more information, go to the Heroku in Local setup website:
heroku-postgresql: Local setup
I had the same problem and discovered that Heroku doesn't seem to provision the latest version of PostgreSQL by default. Where the Heroku Getting Started instructions said
heroku addons:create heroku-postgresql:hobby-dev
That provisioned a v10 database for some reason (which you can check by clicking on Heroku Postgres in the Add-ons tab of your dashboard). I deleted that database and provisioned a new database using the --version flag:
heroku addons:create heroku-postgresql:hobby-dev --version 11
As of now, at least, you can find the latest version of Postgres supported by Heroku at this link: https://devcenter.heroku.com/articles/heroku-postgresql#version-support-and-legacy-infrastructure
I'm writing this in early 2019, but according to the PostgreSQL website the next version (12) is "tentatively scheduled" for third quarter of 2019 so if you're reading this in late 2019 potentially the same problem will come up for v12 instead
On Mac you can use the following:
export PATH="/Library/PostgreSQL/12/bin/:$PATH"
The only solution that I found on Windows:
go to advanced system settings
go to environment variables
select Path variable and click Edit
add a new line and enter your bin directory path (C:\Program Files\PostgreSQL<version>\bin) and click ok
restart your terminal
enter your psql command (heroku pg:psql)

pgadmin crash when click SQL query button

I installed pgAdmin 3 on my windows 64bit system, when I connect to some server, click on the SQL button to execute some script, it crashed, i checked the error log, it says
2012-08-05 08:10:00 ERROR : ERROR: permission denied to create extension "adminpack"
HINT: Must be superuser to create this extension.
Can you help me to solve this problem? thanks!
adminpack is an optional extension. pgAdmin should definitely not crash if you don't have it installed.
You can try to install it manually. In PostgreSQL 9.1 run once in one of your databases:
CREATE EXTENSION adminpack;
You must be superuser for that. Normally the database user postgres is superuser.

pg_bulkload error: "FATAL: unrecognized configuration parameter "wal_level""

I'm trying to give pg_bulkload a try.
When I try to use the postgresql executable it provides, I get the following error:
/usr/local/src/pg_bulkload-3.0.1/bin> ./postgresql start -D /pg_data
server starting
/usr/local/src/pg_bulkload-3.0.1/bin>
FATAL: unrecognized configuration parameter "wal_level"
Google turned up an exact match for this error when someone was using a 9.0 version of psql to run a script on an instance of Postgres 8.4. I don't see how that could be related to my case--I have two versions of Postgres, but I'm sure I'm pointing at the right directory... any thoughts are very welcome.
As far as I can tell from the docs, PostgreSQL 9.x supports a configuration parameter named "wal_level", but version 8.4 does not. The postgresql.conf file for my 9.0.something server has that parameter; the one for my 8.4 server does not.
PostgreSQL 9.x server configuration
PostgreSQL 8.4 server configuration
Your error message suggests you're running version 8.4, but it's reading the configuration file for a 9.x server. Check your postgresql.conf and installation process. I'm thinking pg_bulkload might have "helped" you in ways you didn't anticipate.
I think that it can be a bit tricky to install pg_bulkload to the right place if you have more than one version of PostgreSQL installed on your machine. My first problem was that pg_bulkload (version 3.1.6) could not find pg_port library. I copied the library libpgport.a (a static library) to /usr/local/lib where it was found, but this approach is not recommended, because this is only a quick fix that doesn't work at the end. So, very soon there was another problem: "undefined reference to `pstrdup'". I reckon that in pg_bulkload there should be a possibility of pointing out where PostgreSQL is installed. Well, I changed Makefile of pg_bulkload in pg_bulkload-3.1.6/bin, namely line with PG_LIBS: PG_LIBS = $(libpq) -L/current location of your PostgreSQL/PostgreSQL/pgsql/lib -lpgport -lpgcommon. -lpgport has to be added before -lpgcommon. Last but not least, to compile and install pg_bulkload you shoud modify your PATH: PATH=/current location of your PostgreSQL/PostgreSQL/pgsql/bin:$PATH make USE_PGXS=1 [install]; This makes sure that your pg_bulkload will be added to the correct version of PostgreSQL (in my case 9.3). Enjoy!