Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2711 closed enhancement (fixed)

[PATCH] PostgreSQL schema support

Reported by: pacopabl@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.10
Component: general Version: devel
Severity: normal Keywords:
Cc: pacopablo@…, shishz@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Trac works wonderfully with PostgrwSQL. However, it requires that a separate database be used for each project. With SQLite, this is how things must be, but with PostgreSQL, it becomesa nightmare to manage and just feels nasty.

Attached is a patch against r2771, though it applies cleanly to the latest trunk (r2861).

It is also available on Trac-hacks

Attachments (4)

trac-r2771-schema.patch (2.4 KB ) - added by pacopablo 19 years ago.
Patch for schema support in PostgreSQL
trac-r2975-schema.patch (2.5 KB ) - added by pacopablo@… 19 years ago.
PostgreSQL schema support
trac-r3026-schema.patch (2.7 KB ) - added by pacopablo@… 19 years ago.
Patch for r3026
trac-r3248-schema.patch (2.7 KB ) - added by pacopablo 19 years ago.
Updated patch to support PostgreSQL schemas

Download all attachments as: .zip

Change History (11)

by pacopablo, 19 years ago

Attachment: trac-r2771-schema.patch added

Patch for schema support in PostgreSQL

comment:1 by anonymous, 19 years ago

Cc: shishz@… added

by pacopablo@…, 19 years ago

Attachment: trac-r2975-schema.patch added

PostgreSQL schema support

comment:2 by pacopablo@…, 19 years ago

Version: 0.9.3devel
  • Updated patch for trunk r2975. It now only touches db/postgres_backend.py.
  • Cleaned up code per suggestions from cmlenz

by pacopablo@…, 19 years ago

Attachment: trac-r3026-schema.patch added

Patch for r3026

comment:3 by pacopablo@…, 19 years ago

Updated patch to apply cleanly to r3026.

No code changes, just line changes

comment:4 by Christopher Lenz, 19 years ago

Milestone: 0.10
Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned

by pacopablo, 19 years ago

Attachment: trac-r3248-schema.patch added

Updated patch to support PostgreSQL schemas

comment:5 by pacopablo, 19 years ago

Ok, with the help of cmlenz, I was able to narrow down the changes a little.

The issue turns out to be that the search_path is lost on a rollback(). Because of connection pooling, it appears that there are instances where a connection which has called rollback() get used again. However, the search_path isn't set because a cursor is being reused.

Anyway, the solution in the r3248 patch is to overload rollback() and set the search_path after a rollback happens.

comment:6 by Christopher Lenz, 19 years ago

Looks good, thanks!

comment:7 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

Patch applied in [3249]. Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.