The Postgresql SQL script should be something like this:

CREATE TABLE "public"."g2_node" (
  "nid" BIGINT DEFAULT 0::bigint NOT NULL, 
  "period" VARCHAR(50), 
  "complement" TEXT, 
  "origin" TEXT, 
  CONSTRAINT "g2_node_pkey" PRIMARY KEY("nid")
) WITH OIDS;

CREATE TABLE "public"."g2_referer" (
  "nid" BIGINT DEFAULT 0::bigint NOT NULL, 
  "referer" VARCHAR(128) DEFAULT ''::character varying NOT NULL, 
  "incoming" BIGINT DEFAULT 0::bigint NOT NULL, 
  CONSTRAINT "g2_referer_pkey" PRIMARY KEY("nid", "referer")
) WITH OIDS;

The SQL queries needs some correction, for example

$sq = "SELECT status, count(distinct n.nid) cnt FROM {node} n ";

should be

$sq = "SELECT status, count(distinct n.nid) AS cnt FROM {node} n ";

Comments

fgm’s picture

Hi. Thanks for your suggestion.

As I don't have a PGSQL system available, I suggest you roll up a patch, test it (or ideally have someone else test it), and it will be added to the next version.

Lebowski’s picture

Hello,
Sorry but i don't have skills to make a patch.
This is my third day with Drupal. :)

fgm’s picture

Status: Active » Postponed

OK: I suggest you come back to it later when you know Drupal better. I'm marking it postponed until that day, since I don't support PGSQL myself at the moment.

fgm’s picture

Version: 4.7.x-1.x-dev » master

This should be easier in D6 thanks to the new schema API

fgm’s picture

Version: master » 6.x-1.x-dev
Status: Postponed » Active

D6 branch now exists

fgm’s picture

Status: Active » Fixed

Thanks to the Schema API abstraction, it should at least install / uninstall properly now.

Time to give it a spin for anyone with G2 on Postresql.

Anonymous’s picture

Status: Fixed » Closed (fixed)