Skip site navigation (1) Skip section navigation (2)

Re: Problem migrating from 8.0.3 to 8.2.3

From: "Anton Pikhteryev" <apikhteryev(at)sandvine(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Problem migrating from 8.0.3 to 8.2.3
Date: 2007-03-19 13:52:27
Message-ID: F489AB573A749146B33461ECE080913A0108BEF9@EXCHANGE-1.sandvine.com (view raw or flat)
Thread:
Lists: pgsql-admin
On the destination box:

#\dD+ valid_user
                                                       List of domains
 Schema |    Name    | Type |         Modifier         |
Check
--------+------------+------+--------------------------+----------------
-----------------------------------------------------
 public | valid_user | name | default "session_user"() | CHECK
(has_table_privilege(VALUE, 'pg_user'::text, 'SELECT'::text))
(1 row)

On the source:

# \dD+ valid_user
                    List of domains
 Schema |    Name    | Type |         Modifier
--------+------------+------+--------------------------
 public | valid_user | name | default "session_user"()
(1 row)


I created valid_user domain on the old system (8.0.3) a long time ago
as:

CREATE DOMAIN valid_user
    AS name     -- pg_catalog.pg_user.usename%TYPE
    DEFAULT SESSION_USER
    CONSTRAINT user_exists
        CHECK (has_table_privilege(VALUE,'pg_user','SELECT'));
COMMENT ON DOMAIN valid_user IS 'valid PostgreSQL user name';

I was also thinking that there is no need to recreate the domain again
as a part of migration and hoping that pg_dumpall will take care of it.



Anton Pikhteryev
 
 

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us] 
> Sent: Friday, March 16, 2007 3:34 PM
> To: Anton Pikhteryev
> Cc: pgsql-admin(at)postgresql(dot)org
> Subject: Re: [ADMIN] Problem migrating from 8.0.3 to 8.2.3 
> 
> "Anton Pikhteryev" <apikhteryev(at)sandvine(dot)com> writes:
> > There is that part and doesn't have any errors:
> > CREATE TABLE clap_file_info (
> >     fileid integer DEFAULT
> > nextval('public.clap_file_info_fileid_seq'::text) NOT NULL,
> >     filename text NOT NULL,
> >     created timestamp with time zone DEFAULT 
> > ('now'::text)::timestamp(6) with time zone NOT NULL,
> >     "owner" valid_user NOT NULL
> > );
> 
> What is a valid_user?  (No, I don't want \dT output, I want 
> the definition of the type.)
> 
> 			regards, tom lane
> 

In response to

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2007-03-19 14:16:42
Subject: Re: [SQL] create view with check option
Previous:From: Sabin CoandaDate: 2007-03-19 07:58:34
Subject: WAL based backup/recovery clarifications

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group