Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Problems with p...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15759 of 17437
Post > Topic >>

Problems with pg_dump ?

by alexandr.popov@[EMAIL PROTECTED] (Alexandr Popov) Jun 6, 2008 at 04:25 PM

Hello,

I found small problem and doesn't know where to dig. 
Ok let's start.

postgresql 8.2.7
OS - linux 

Create table and view.

CREATE TABLE t1 (
    a integer NOT NULL,
    b integer NOT NULL
);

CREATE OR REPLACE VIEW v1 AS SELECT DISTINCT a,b, -1 AS d, -1 AS e FROM
t1;

After this i dump database with pg_dump and have following output.

--- pg_dump output start ---
--
-- Name: t1; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE t1 (
    a integer NOT NULL,  b integer NOT NULL
);
ALTER TABLE public.t1 OWNER TO postgres;

--
-- Name: v1; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW v1 AS
    SELECT DISTINCT t1.a, t1.b, -1 AS d, -1 AS e FROM t1 ORDER BY t1.a,
t1.b, -1::integer, -1::integer;
ALTER TABLE public.v1 OWNER TO postgres;
--- pg_dump output end ---

And when i try to restore this thing on new DB i get following error while
creating view

ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select
list

Any help will be appreciated

-- 

Alexandr Popov

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 2 Posts in Topic:
Problems with pg_dump ?
alexandr.popov@[EMAIL PRO  2008-06-06 16:25:44 
Re: Problems with pg_dump ?
tgl@[EMAIL PROTECTED] (T  2008-06-06 12:28:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 13:11:10 CST 2008.