471,090 Members | 1,385 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,090 software developers and data experts.

SUMMARY mysql -> psql


This is what I finally ended up with, thanks to those who helped get me here.


--
-- PostgreSQL database dump
-- pg_dump -d -c -s dbname
--

\connect - username

SET search_path = public, pg_catalog;

ALTER TABLE ONLY public.inbound DROP CONSTRAINT inbound_pkey;
ALTER TABLE ONLY public.outbound DROP CONSTRAINT id;
DROP TABLE public.inbound;
DROP TABLE public.outbound;
DROP SEQUENCE public.serial8;
DROP SEQUENCE public.serial;
DROP TABLE public.ports;
--
-- TOC entry 4 (OID 119511)
-- Name: ports; Type: TABLE; Schema: public; Owner: username
--

CREATE TABLE ports (
port integer DEFAULT 0 NOT NULL,
protocol text DEFAULT 'tcp' NOT NULL,
service character(50) DEFAULT '' NOT NULL,
description character(100) DEFAULT ''
);
--
-- TOC entry 2 (OID 119520)
-- Name: serial; Type: SEQUENCE; Schema: public; Owner: username
--

CREATE SEQUENCE serial
START 1
INCREMENT 1
MAXVALUE 9223372036854775807
MINVALUE 1
CACHE 1;
--
-- TOC entry 3 (OID 119522)
-- Name: serial8; Type: SEQUENCE; Schema: public; Owner: username
--

CREATE SEQUENCE serial8
START 1
INCREMENT 1
MAXVALUE 9223372036854775807
MINVALUE 1
CACHE 1;
--
-- TOC entry 5 (OID 119536)
-- Name: outbound; Type: TABLE; Schema: public; Owner: username
--

CREATE TABLE outbound (
source character(100) DEFAULT '',
destination character(100) DEFAULT '',
sport integer DEFAULT 0 NOT NULL,
dport integer DEFAULT 0 NOT NULL,
"time" timestamp without time zone DEFAULT now() NOT NULL,
id bigint DEFAULT nextval('serial'::text) NOT NULL
);
--
-- TOC entry 6 (OID 119554)
-- Name: inbound; Type: TABLE; Schema: public; Owner: username
--

CREATE TABLE inbound (
source character(100) DEFAULT '',
destination character(100) DEFAULT '',
sport integer DEFAULT 0 NOT NULL,
dport integer DEFAULT 0 NOT NULL,
"time" timestamp without time zone DEFAULT now() NOT NULL,
id bigint DEFAULT nextval('serial'::text) NOT NULL
);
--
-- TOC entry 7 (OID 119544)
-- Name: id; Type: CONSTRAINT; Schema: public; Owner: username
--

ALTER TABLE ONLY outbound
ADD CONSTRAINT id PRIMARY KEY (id);
--
-- TOC entry 8 (OID 119562)
-- Name: inbound_pkey; Type: CONSTRAINT; Schema: public; Owner: username
--

ALTER TABLE ONLY inbound
ADD CONSTRAINT inbound_pkey PRIMARY KEY (id);

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
3 2615
On Wed, 10 Sep 2003 09:23:46 +0100
Richard Huxton <de*@archonet.com> wrote:
On Wednesday 10 September 2003 03:33, expect wrote:
CREATE TABLE outbound (
source character(100) DEFAULT '',
destination character(100) DEFAULT '',
sport integer DEFAULT 0 NOT NULL,
dport integer DEFAULT 0 NOT NULL,
"time" timestamp without time zone DEFAULT now() NOT NULL,
id bigint DEFAULT nextval('serial'::text) NOT NULL
);
I'm guessing it's too late in the day to change it now, but I'd be sorely
tempted to rename that "time" column to something else (otime?)

Never too late, this is a little pet project. I'm trying to make a util,
written to work with MySql, to work with Pgql.

It's called Link-n-Log (int that cute) and it's for logging the in/out
traffic from a Linksys fw/router befsr4xx. http://link-n-log.sourceforge.net
Now I wonder if anyone here has done any Pgql stuff with Qt from
( http://trolltech.com )??
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #2
On Wednesday 10 September 2003 03:33, expect wrote:
CREATE TABLE outbound (
source character(100) DEFAULT '',
destination character(100) DEFAULT '',
sport integer DEFAULT 0 NOT NULL,
dport integer DEFAULT 0 NOT NULL,
"time" timestamp without time zone DEFAULT now() NOT NULL,
id bigint DEFAULT nextval('serial'::text) NOT NULL
);


I'm guessing it's too late in the day to change it now, but I'd be sorely
tempted to rename that "time" column to something else (otime?)
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #3
On Wed, 10 Sep 2003 09:23:46 +0100
Richard Huxton <de*@archonet.com> wrote:
On Wednesday 10 September 2003 03:33, expect wrote:
CREATE TABLE outbound (
source character(100) DEFAULT '',
destination character(100) DEFAULT '',
sport integer DEFAULT 0 NOT NULL,
dport integer DEFAULT 0 NOT NULL,
"time" timestamp without time zone DEFAULT now() NOT NULL,
id bigint DEFAULT nextval('serial'::text) NOT NULL
);
I'm guessing it's too late in the day to change it now, but I'd be sorely
tempted to rename that "time" column to something else (otime?)

Never too late, this is a little pet project. I'm trying to make a util,
written to work with MySql, to work with Pgql.

It's called Link-n-Log (int that cute) and it's for logging the in/out
traffic from a Linksys fw/router befsr4xx. http://link-n-log.sourceforge.net
Now I wonder if anyone here has done any Pgql stuff with Qt from
( http://trolltech.com )??
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.