SQL-Syntax (PostgreSQL)

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • SQL-Syntax (PostgreSQL)

    Hallo! Ich habe folgende SQL-Statements für PostgreSQL und möchte wissen, ob diese syntaktisch korrekt sind.

    Leider habe ich hier zwar MySQL, MS-SQL und DB2, aber kein PostgreSQL installiert

    Wäre jemand mit einer funktionstüchtigen PostgreSQL Installation bitte so nett zu prüfen, ob die SQL-Anweisung(en) syntaktisch korrekt sind? Dann könnte ich ggf. entscheiden, ob ich die PostgreSQL Installation doch durchziehen muss, oder den Aufwand vermeiden kann.

    Code:
    CREATE SEQUENCE container_container_id_sq INCREMENT 1;
    CREATE SEQUENCE publication_publication_id_sq INCREMENT 1;
    CREATE SEQUENCE converter_converter_id_sq INCREMENT 1;
    CREATE TABLE "converter" (
    	"converter_id" integer(10) NOT NULL nextval(converter_converter_id_sq) PRIMARY KEY,
    	"container_id" integer(10) NOT NULL REFERENCES "container",
    	"converter_created" integer(11) NOT NULL,
    	"converter_modified" integer(11),
    	"converter_name" varchar(20) NOT NULL UNIQUE,
    	"converter_description" text,
    	"converter_file" varchar(128) NOT NULL
    );
    CREATE TABLE "publication" (
    	"publication_id" integer(10) NOT NULL nextval(publication_publication_id_sq) PRIMARY KEY,
    	"publication_created" integer(11) NOT NULL,
    	"publication_modified" integer(11),
    	"publication_published" integer(11),
    	"publication_name" varchar(20) NOT NULL,
    	"publication_description" text,
    	"publication_frame" varchar(128) NOT NULL
    );
    CREATE INDEX publication_publication_published_idx ON "publication" ("publication_published");
    CREATE INDEX publication_publication_name_idx ON "publication" ("publication_name");
    CREATE TABLE "contentpool" (
    	"contentpool_name" varchar(20) NOT NULL PRIMARY KEY,
    	"contentpool_created" integer(11) NOT NULL,
    	"contentpool_modified" integer(11),
    	"contentpool_description" text,
    	"contentpool_protocol" text NOT NULL,
    	"contentpool_dbms" text NOT NULL,
    	"contentpool_file" varchar(255),
    	"contentpool_host" varchar(128) DEFAULT 'localhost',
    	"contentpool_port" integer(6),
    	"contentpool_user" varchar(128) DEFAULT 'root',
    	"contentpool_pass" varchar(128),
    	"contentpool_database" varchar(128)
    );
    CREATE TABLE "container" (
    	"container_id" integer(10) NOT NULL nextval(container_container_id_sq) PRIMARY KEY,
    	"container_name" varchar(20) NOT NULL,
    	"container_created" integer(11) NOT NULL,
    	"container_modified" integer(11),
    	"container_description" text
    );
    COMMENT ON TABLE "converter" COLUMN "container_id" IS 'Ordner';
    COMMENT ON TABLE "converter" COLUMN "converter_created" IS 'erstellt';
    COMMENT ON TABLE "converter" COLUMN "converter_modified" IS 'bearbeitet';
    COMMENT ON TABLE "converter" COLUMN "converter_name" IS 'Name';
    COMMENT ON TABLE "converter" COLUMN "converter_description" IS 'Beschreibung';
    COMMENT ON TABLE "converter" COLUMN "converter_file" IS 'Quelldatei';
    COMMENT ON TABLE "publication" COLUMN "publication_id" IS 'Id';
    COMMENT ON TABLE "publication" COLUMN "publication_created" IS 'erstellt';
    COMMENT ON TABLE "publication" COLUMN "publication_modified" IS 'bearbeitet';
    COMMENT ON TABLE "publication" COLUMN "publication_published" IS 'Gesamtdokument erzeugt';
    COMMENT ON TABLE "publication" COLUMN "publication_name" IS 'Name';
    COMMENT ON TABLE "publication" COLUMN "publication_description" IS 'Beschreibung';
    COMMENT ON TABLE "publication" COLUMN "publication_frame" IS 'Rahmen';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_name" IS 'Name';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_created" IS 'erstellt';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_modified" IS 'bearbeitet';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_description" IS 'Beschreibung';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_protocol" IS 'Verbindung zu';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_dbms" IS 'DBMS';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_file" IS 'Quelldatei';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_host" IS 'Host';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_port" IS 'Port';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_user" IS 'Nutzername';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_pass" IS 'Passwort';
    COMMENT ON TABLE "contentpool" COLUMN "contentpool_database" IS 'Datenbank';
    COMMENT ON TABLE "container" COLUMN "container_id" IS 'Id';
    COMMENT ON TABLE "container" COLUMN "container_name" IS 'Name';
    COMMENT ON TABLE "container" COLUMN "container_created" IS 'erstellt';
    COMMENT ON TABLE "container" COLUMN "container_modified" IS 'bearbeitet';
    COMMENT ON TABLE "container" COLUMN "container_description" IS 'Beschreibung';
    Vielen Dank!

    Hintergrund (falls es jemand interessiert) - das stammt aus einem selbst geschriebenen SQL-Generator. Der erzeugt mir aus Beschreibungen der Struktur der Datenbank in XML-Format on-the-fly SQL-Statements für das DBMS welches ich gerade brauche.
Lädt...
X