koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
667 stars 128 forks source link

Service tables are not registered automatically #233

Closed hhkaos closed 9 years ago

hhkaos commented 9 years ago

I'm not sure why I'm having this error while I'm trying to register a provider in a machine with Windows 8:

$ curl --data "host=https://data.lab.fiware.org&id=fiware" localhost:1337/ckan
{"name":"error","length":124,"severity":"ERROR","code":"42P01","position":"31","file":"src\\backend\\parser\\parse_relation.c","line":"986","routine":"parserOpenTable"}

I checked the Postgres error codes and it means UNDEFINED TABLE

I have started the server in the same way as usual (in my machine with Windows 7):

C:\Workspace\koop-sample-app>node server.js
Express koop server listening on port 1337
info: CREATE TABLE "koopinfo" (id varchar(255) PRIMARY KEY, info JSON)
info: CREATE TABLE "kooptimers" (id varchar(255) PRIMARY KEY, expires varchar(25
))

I also SET the PYTHON variable and checked that Postgis in available in the database. Any clue about what can be happening?

Thanks!

dmfenton commented 9 years ago

Hi @hhkaos I've seen this before. There is an existing bug in Koop. Try using sql like below:

CREATE TABLE "ckan:services"
(
  id character varying(100),
  host character varying(100)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE "ckan:services"
  OWNER TO yourUserName;
hhkaos commented 9 years ago

Thanks @dmfenton ! it works!! :dancer: