Re: [OSM-dev] Osmosis and Postgresql

2009-07-10 Thread Jeffrey Warren
I attempted to find all orphan current_way_nodes, which have no current_node, and are causing the constraint to fail: SELECT * FROM current_way_nodes LEFT JOIN current_nodes ON current_nodes.id= current_way_nodes.node_id WHERE current_nodes.id IS NULL This seems to hang, but perhaps I just need t

Re: [OSM-dev] Osmosis and Postgresql

2009-07-08 Thread Joachim Zobel
Am Dienstag, den 07.07.2009, 18:50 -0400 schrieb Jeffrey Warren: > No, the data is not corrupt, nor are there duplicate entries. Quite a > few current_way_nodes are not getting deleted when they cease to be > 'current', that is, once they're only > history and no longer part of the current planet.

Re: [OSM-dev] Osmosis and Postgresql

2009-07-08 Thread Tom Hughes
On 08/07/09 09:10, Richard Fairhurst wrote: > I get another constraint throwing an error whenever I try to write to the > db: > > ERROR: duplicate key value violates unique constraint "current_nodes_pkey1" > : INSERT INTO "current_nodes" ("visible", "timestamp", "latitude", > "changeset_id", "til

Re: [OSM-dev] Osmosis and Postgresql

2009-07-08 Thread Tom Hughes
On 08/07/09 09:10, Richard Fairhurst wrote: > Slightly oddly, I also find that when I create a new user, it has id 1, > whereas I'd have expected it to be maximum user id plus one. Postgres uses proper sequences to do the allocation and a newly created sequence starts at one. MySQL used to give

Re: [OSM-dev] Osmosis and Postgresql

2009-07-08 Thread Richard Fairhurst
Jeffrey Warren wrote: > I'm still not done right now (i've been pinging the list here > occasionally) and my latest problem is that I'm getting several > errors like the following: > ERROR: insert or update on table "current_way_nodes" violates > foreign key constraint "current_way_nodes_node_

Re: [OSM-dev] Osmosis and Postgresql

2009-07-07 Thread Jeffrey Warren
No, the data is not corrupt, nor are there duplicate entries. Quite a few current_way_nodes are not getting deleted when they cease to be 'current', that is, once they're only history and no longer part of the current planet. I asked earlier about what mechanism actually deletes current_way_nodes i

Re: [OSM-dev] Osmosis and Postgresql

2009-07-07 Thread Shaun McDonald
On 7 Jul 2009, at 18:47, Joachim Zobel wrote: > Am Mittwoch, den 01.07.2009, 09:47 +1000 schrieb Brett Henderson: >> Jeffrey Warren wrote: >>> And along those lines, should we remove the foreign key constraints >>> from the schema, Brett, if they're not necessary and they cause >>> Osmosis import

Re: [OSM-dev] Osmosis and Postgresql

2009-07-07 Thread Joachim Zobel
Am Mittwoch, den 01.07.2009, 09:47 +1000 schrieb Brett Henderson: > Jeffrey Warren wrote: > > And along those lines, should we remove the foreign key constraints > > from the schema, Brett, if they're not necessary and they cause > > Osmosis imports to fail? > I don't mind really. I only make th

Re: [OSM-dev] Osmosis and Postgresql

2009-07-03 Thread Jeffrey Warren
Hmm, I'm not sure I'm equipped to do that. On Tue, Jun 30, 2009 at 7:47 PM, Brett Henderson wrote: > I don't mind really. I only make them available as a convenience so people > don't need to run the rails migrations themselves. I don't want to put much > effort into maintaining them so I just

Re: [OSM-dev] Osmosis and Postgresql

2009-06-30 Thread Brett Henderson
Jeffrey Warren wrote: > I'd like to, but how does the schema you want differ from the schemas > Brett Henderson hosts? > > And along those lines, should we remove the foreign key constraints > from the schema, Brett, if they're not necessary and they cause > Osmosis imports to fail? I don't min

Re: [OSM-dev] Osmosis and Postgresql

2009-06-30 Thread Jeffrey Warren
Agreed, it's quite confusing. The page you reference seems hard to maintain since it's basically an image. Perhaps a sub-page for each schema would be nice? At least mentioning the simple-schema, the rails-port schema (the one in the migrations) and the one brett hosts, those three would be quite n

Re: [OSM-dev] Osmosis and Postgresql

2009-06-30 Thread Graham Jones
I don't think I want a different one, I was just struggling to understand what the differences are between all these different databases that people use so I can choose one, and thought it would be worth documenting it once I had worked it out! Graham 2009/6/30 Jeffrey Warren > I'd like to, but

Re: [OSM-dev] Osmosis and Postgresql

2009-06-30 Thread Jeffrey Warren
I'd like to, but how does the schema you want differ from the schemas Brett Henderson hosts? And along those lines, should we remove the foreign key constraints from the schema, Brett, if they're not necessary and they cause Osmosis imports to fail? Jeff On Tue, Jun 23, 2009 at 4:48 PM, Graham Jo

Re: [OSM-dev] Osmosis and Postgresql

2009-06-23 Thread Brett Henderson
Jeffrey Warren wrote: > I dropped it as well; there are many instances of data in the planet > dump which do not meet the constraint; do you know what part of the > codebase does in fact rely upon the constraints? I'm not familiar with the internals of the rails API. However I suspect that noth

Re: [OSM-dev] Osmosis and Postgresql

2009-06-23 Thread Graham Jones
Jeffrey, I can't help with your error, I'm afraid, but if you have an up to date description of the database schema I would be happy to add it ot the summary page I am writing. I think that http://wiki.openstreetmap.org/wiki/Database/Model is supposed to be a description of the main API DB schema,

Re: [OSM-dev] Osmosis and Postgresql

2009-06-23 Thread Jeffrey Warren
I dropped it as well; there are many instances of data in the planet dump which do not meet the constraint; do you know what part of the codebase does in fact rely upon the constraints? Jeff On Tue, Jun 23, 2009 at 9:09 AM, Brett Henderson wrote: > Jeffrey Warren wrote: > > Hi, I'm compiling a

Re: [OSM-dev] Osmosis and Postgresql

2009-06-23 Thread Brett Henderson
Jeffrey Warren wrote: Hi, I'm compiling a very long description of a Postgres/Rails port schema import, though I'm writing directly to the db. I'd be happy to share/post my notes on the process as I managed to get around a number of undocumented problems. I'm still not done right now (i've be

Re: [OSM-dev] Osmosis and Postgresql

2009-06-22 Thread Jeffrey Warren
Hi, I'm compiling a very long description of a Postgres/Rails port schema import, though I'm writing directly to the db. I'd be happy to share/post my notes on the process as I managed to get around a number of undocumented problems. I'm still not done right now (i've been pinging the list here occ

Re: [OSM-dev] Osmosis and Postgresql

2009-06-22 Thread 80n
On Mon, Jun 22, 2009 at 2:29 AM, Brett Henderson wrote: > Graham Jones wrote: > > Brett, > > > > I'll have a look at --write-pgsql-dump and add some words about that > > too. Then I'll have a go at MySQL... > > > > The other thing I would like to add is a write-up on choosing a > > database to u

Re: [OSM-dev] Osmosis and Postgresql

2009-06-21 Thread Brett Henderson
Graham Jones wrote: > Brett, > > I'll have a look at --write-pgsql-dump and add some words about that > too. Then I'll have a go at MySQL... > > The other thing I would like to add is a write-up on choosing a > database to use, because it is not obvious to me which would be the > best, but I su

Re: [OSM-dev] Osmosis and Postgresql

2009-06-21 Thread Graham Jones
Brett, I'll have a look at --write-pgsql-dump and add some words about that too. Then I'll have a go at MySQL... The other thing I would like to add is a write-up on choosing a database to use, because it is not obvious to me which would be the best, but I suspect this has been looked at a lot be

Re: [OSM-dev] Osmosis and Postgresql

2009-06-21 Thread Brett Henderson
Graham Jones wrote: > Hi Folks, > I have spent a couple of evenings trying to persuade osmosis to import > a planet dump into postgresql. > > It was quite a lot harder than I expected because of the need to set > up the database schema, postgis etc. first (I am not used to > postgresql, which wa

Re: [OSM-dev] Osmosis and Postgresql

2009-06-20 Thread Graham Jones
Emilie, Thank you for looking at that for me - I will have a look at the other options now I have got it working. I know what you mean about seeing what it is doing, so dumping the SQL to a file then importing it will make it easier to understand. I can't remember why I included postgres-contrib -

Re: [OSM-dev] Osmosis and Postgresql

2009-06-19 Thread Emilie Laffray
Graham Jones wrote: > Hi Folks, > I have spent a couple of evenings trying to persuade osmosis to import > a planet dump into postgresql. > > It was quite a lot harder than I expected because of the need to set > up the database schema, postgis etc. first (I am not used to > postgresql, which was a

[OSM-dev] Osmosis and Postgresql

2009-06-19 Thread Graham Jones
Hi Folks, I have spent a couple of evenings trying to persuade osmosis to import a planet dump into postgresql. It was quite a lot harder than I expected because of the need to set up the database schema, postgis etc. first (I am not used to postgresql, which was a lot of the problem). I have had