Re: Dumping views, functions, ...

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: arnaulist(at)andromeiberica(dot)com
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Dumping views, functions, ...
Date: 2007-04-02 14:45:48
Message-ID: bf54be870704020745o5014082fj8417d4ca85fa1d81@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

You can use the following query to get all the views:

select 'CREATE VIEW '||viewname||' AS '||definition as viewSQL from pg_views
where schemaname='<schemaname>';

--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 4/2/07, Arnau <arnaulist(at)andromeiberica(dot)com> wrote:
>
> Hi all,
>
> Lets say that in my database I have a view named foo_view and I'd
> like to dump it's definition. I'd like to do something like:
>
> pg_dump --view=foo_view bar_db > foo_view.log
>
> so I'd have in the foo_view.log file the foo_view's definition. This
> same concept I'm searching to apply it to rules, functions, ...
>
> I have been looking into pg_dump options and I haven't found the way.
> The most similar thing I have found is -t option that does what I need
> but with tables. Is it possible to do this with pg_dump?
>
> Thanks
> --
> Arnau
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Sorin N. Ciolofan 2007-04-02 14:52:15 Re: Increasing the shared memory
Previous Message Arnau 2007-04-02 14:28:09 Dumping views, functions, ...