Is there an alternative for Postgres for Python 3.9? - postgresql

I am trying to use psycopg2 to connect to a Postgres DB but apparently it is not supported in 3.9. Is there another alternative I can use?

Documentation says that 3.9 is supported
Python versions from 3.6 to 3.9
https://www.psycopg.org/docs/install.html#prerequisites
Here is list on Postgres Wiki for other libs https://wiki.postgresql.org/wiki/Python
You can also search on python package index https://pypi.org/search/?q=postgre&o=&c=Topic+%3A%3A+Database&c=Programming+Language+%3A%3A+Python

Related

Which JDBC driver version should I use to access PostgreSQL 9.5?

I installed PostgreSQL on my Ubuntu 16.04 using apt install - it installed PostgreSQL 9.5.12. I want to use cmdbuild 2.5. It gives me 9.4.1204 JDBC driver by default in tar.gz install file.
But I have some wrong with install cmdbuild, so I think that driver version is wrong.
The database driver is here: https://jdbc.postgresql.org/download.html
But there is no 9.5, it's 42?
Which driver should I download if I want to connect postgresql 9.5.12?
Like the page you link to says:
If you are using Java 8 or newer, 42.2.2 JDBC 42.
If you are using Java 7, 42.2.2 JDBC 41.
If you are using Java 6, 42.2.2 JDBC 4.
As the page says, it supports PostgreSQL 8.2 or newer.

What is the status of the MongoDB extension for PHP7?

PHP7 is gaining a lot of attention lately, promising great performance and a more mature language. Version 7.0.0-alpha is out. We are just starting to rework our core application, which uses MongoDB as data source.
I am wondering if there is any development underway for a PHP7 compatible MongoDB extension? How far is it? Is there any alternative?
Version 1.1.1 of the new "mongodb" extension supports PHP 7, as does the complementary userland library.
AFAIK, there's no compatible extension yet, but I think Hannes '#bjori' Magnusson - who works at MongoDB - wanted to work on it.
The old Mongo extension for PHP is not going to be supported in PHP7. Instead, there is a new MongoDB extension which is using libmongo under the hood and is a more "bare bones" approach that has the goal of being easy to maintain and easy to port to other environments such as HHVM. It also aims to work with any version down to PHP 5.4.
To make the new extension easier to work with, there is an official php library available on Packagist. This library does not aim to be a drop-in replacement for the old Mongo extension. It should be noted that at the time of writing, the library doesn't implement all the features available in the old Mongo extension, such as GridFS. Hopefully we'll see a non-beta release of the extension and library soon with all the available features.
Should be relapse today with version: 1.1.0
If somebody don't have enough time to play with new extension, you can always try php library compatible with old API.
https://github.com/mongofill/mongofill
Here it is a beta Version:
pecl install mongodb-beta
You need some software to compile and install:
yum -y install php-devel cyrus-sasl-devel openssl-devel gcc
echo extension=mongodb.so >/etc/php.d/mongodb.ini
composer require mongodb/mongodb
everything ok
I use CentOS 7 with PHP 7.0.1 und nginx 1.8 und Mongodb 3.2
for Windows:
http://windows.php.net/downloads/pecl/releases/mongodb/1.1.1/
pecl install mongodb
That should do it.
Php 7 mongo db driver installtion
pecl install mongodb
adding extension on "php.ini"
extension=mogodb.so
Install the mongodb driver using composer on public_html directory
$ composer require alcaeus/mongo-php-adapter
(or)
$ php composer.phar require alcaeus/mongo-php-adapter
add at the top of index.php
require_once 'vendor/autoload.php';

uuid-ossp module for PostgreSQL 8.2 to generate UUID

I am trying to generate UUID in PostgreSQL 8.2. From the documentation I found uuid-ossp module can generate UUID but it supports only PostgreSQL 9+. Is there any way to use this uuid-ossp module in PostgreSQL 8.2 or generate UUID in PostgreSQL 8.2 by using query?
You may be confused about the packaging of that plugin for Postgres. Postgres 9.1 introduced a new packaging scheme called Extension. The idea is that the creator of a plugin does more work with regard to packaging so that the user of the plugin might do less work with regard to installation. The Create Extension command (a mis-nomer to my mind) installs a plugin into your Postgres cluster.
Previous to Postgres 9.1, you can install the UUID plugin, but doing so is not quite so simple. You must locate the "uuid-ossp" plugin appropriate to your version of Postgres. The plugin may well have been bundled with your Postgres cluster but not yet installed (activated). Within that plugin package find the SQL script used for installation. You then execute that script in your Postgres cluster.
For details, see my posting to the Postgres mailing list and my blog post on the old way to install and the new way to install the UUID plugin.
I cannot find the 8.2 doc, but did find the 8.3 doc for the uuid-ossp plugin. I do not know if 8.2 had a version of the uuid-ossp plugin, but I suppose so.
Postgres 8.2 reached end-of-life two years (2011-12). I strongly suggest planning an upgrade.
As Craig Ringer commented, you should be doing only the most basic maintenance to a Postgres 8.2 cluster. Asking about UUID support suggests some major changes. For such changes you really should first complete an upgrade to a more recent Postgres.
You could write a function PL/Perl or PL/Python that generates UUIDs using one of their modules.

PostGIS - can't create spatially-enabled database

I'm using Ubuntu 10.10, PostgreSQL 9.0 and PostGIS 1.5.
I've installed PostGIS 1.5 from:
https://launchpad.net/~ubuntugis/+archive/ubuntugis-unstable
I used PPA first then the command:
sudo apt-get install postgis
to install postgis.
I've been following these instructions to create a spatially-enabled database:
http://ostgis.refractions.net/docs/ch02.html
I got to the point where it's saying:
Now load the PostGIS object and
function definitions into your
database by loading the postgis.sql
definitions file (located in
[prefix]/share/contrib as specified
during the configuration step).
psql -d [yourdatabase] -f postgis.sql
Well, there is no postgis.sql on my server after the installation. I did an sudo updatedb to make sure I can find postgis.sql but it's not there.
Any ideas? Thank you!
The "ubuntugis-unstable" PPA repository that you're using does not ship PostGIS for PostgreSQL 9.0. It includes a package named "postgresql-8.4-postgis", which contains the file /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql. This is what they're referring to.
Unfortunately, the PPA does not include a version of the PostGIS extension for PostgreSQL 9.0 because 9.0 isn't yet shipped with any Ubuntu release. It will be included in the upcoming Ubuntu 11.04 Natty, which will probably also ship an up-to-date PostGIS in the official repositories.
So, you can follow these instructions to build your own PostGIS, or stick with PostgreSQL 8.4 from the official repos.
edit: ubuntu 11.04 don't ship postgres 9.0
The newers Postgres and Postgis versions that work with it are available from
https://launchpad.net/~pitti/+archive/postgresql/+packages
Following this guide that incorporates all needed software for PostGIS, you can set it up easily. It's for 10.04 but the PPA works with 10.10 as well.
I'd recommend 9.x and the latest PostGIS since we had severe (known) speed problems for a project. SO choose either 8.3 or 9.0.
There is a tutorial for PostGIS 8.4 on Ubuntu 10.10 here.

Can I use PostgreSQL 8.3.x for OpenStreetMap?

I'm trying to install phpPgAdmin as an XAMPP addon when I encountered an error because the latest phpPgAdmin supports upto PostgreSQL version 8.3.x. So I decided to install PostgreSQL 8.3.11 instead of the latest (PGSQL 8.4.x). Will this matter to my OSM application? Thanks!
There are a lot of advantages to Postgres 8.4 over 8.3, and Open Street Map / PostGIS should work on it, so I'd recommend using 8.4 for the Postgres version, and instead grabbing the latest version of phpPgAdmin from the projects github repo (http://github.com/xzilla/phppgadmin), which fully supports 8.4. That will tide you over until the next official phpPgAdmin release, which is scheduled to happen in the next few weeks.
The only link between OSM and postgresql is probably postgis.
Postgis lastest version (1.5.1) requires postgresql >= 8.3, so the answer is no, it won't matter - if, of course, I understood your question correctly.