Bug 193619 - databases/py-psycopg2: pkg install removes postgresql 9.3 server/client
Summary: databases/py-psycopg2: pkg install removes postgresql 9.3 server/client
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2014-09-13 20:04 UTC by Tom S
Modified: 2014-11-18 11:03 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (miwi)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom S 2014-09-13 20:04:20 UTC
If a system already has postgresql93-(server|client)-9.3.5 installed, attempting to install py27-psycopg2-2.5.3 causes pkg to remove the existing postgres packages, and install only postgresql92-client-9.2.9 in their place.

Can the psycopg2 package be updated to use/support the latest/future postgres package(s)?
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-09-13 20:04:20 UTC
Maintainers CC'd
Comment 2 Tom S 2014-09-13 20:06:53 UTC
root@devbox:~ # pkg install py27-psycopg2-2.5.3
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):

New packages to be INSTALLED:
	py27-psycopg2: 2.5.3
	postgresql92-client: 9.2.9

The process will require 10 MB more space.
2 MB to be downloaded.

Proceed with this action? [y/N]: y
Fetching py27-psycopg2-2.5.3.txz: 100%  274 KB 280.3k/s    00:01    
Fetching postgresql92-client-9.2.9.txz: 100%    2 MB 633.4k/s    00:03    
Checking integrity... done (1 conflicting)
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 4 packages will be affected (of 0 checked):

Installed packages to be REMOVED:
	postgresql93-server-9.3.5
	postgresql93-client-9.3.5

New packages to be INSTALLED:
	postgresql92-client: 9.2.9
	py27-psycopg2: 2.5.3

The operation will free 15 MB.

Proceed with this action? [y/N]:
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2014-09-21 04:57:11 UTC
This is likely related to the current value for PGSQL_DEFAULT from head/Mk/bsd.default-versions.mk.

Uses may use DEFAULT_VERSIONS set in /etc/make.conf to set alternate values. Can you try setting this and letting us know if that resolves the issue for you.
Comment 4 Tom S 2014-09-21 09:50:46 UTC
Thanks for the suggestion.

I just tried this and it still seems to want to blast away pgsql 9.3 client+server and only install 9.2 client.

Does the new pkg tool take that setting in to account, or will I just have to install psycopg using ports rather than pkg for the time being?


(In reply to Kubilay Kocak from comment #3)
> This is likely related to the current value for PGSQL_DEFAULT from
> head/Mk/bsd.default-versions.mk.
> 
> Uses may use DEFAULT_VERSIONS set in /etc/make.conf to set alternate values.
> Can you try setting this and letting us know if that resolves the issue for
> you.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2014-09-27 23:55:47 UTC
Port requires conversion to USES=pgsql (thanks antoine@)
Comment 6 Palle Girgensohn freebsd_committer freebsd_triage 2014-11-18 11:02:09 UTC
The short answer is that you must use the port, (i.e. cd /usr/ports/databases/py-psocypg2; make install) to install software depending on a "non-default" postgresql version.

This is a design limitation.

The default PostgreSQL version is 9.2. This is the only version for which you can use prebuilt packages to install dependant software.

For example, there is only one py-psycopg2 port. It is built against postgresql92-client. The resulting package is py27-psycopg2. There is no package automaticially built for python32 or postgresql93. The default packages are built with the default set of versions, for example python27 and postgresql92.

Another way to design this would be to have different ports for different versions of postgresql, e.g. py27-pg92-psycopg2, py27-pg93-psycopg2 and so on. No-one has stepped forward to actually do this, and I am not entirely sure that it is even a good idea, given the complexity and the amount of ports this would require. With five versions of postgresql and four versions of python, we would get 20 ports for psycopg2 alone =). Even with a framework where one port would create 20 packages, the complexity of it all is still a bit overwhelming.
Comment 7 Palle Girgensohn freebsd_committer freebsd_triage 2014-11-18 11:03:04 UTC
A tip is to use poudriere to built your own package set.