pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Dumping views, functions, ...
3+ messages / 3 participants
[nested] [flat]

* Dumping views, functions, ...
@ 2007-04-02 14:28  Arnau <arnaulist@andromeiberica.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Arnau @ 2007-04-02 14:28 UTC (permalink / raw)
  To: pgsql-admin

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Dumping views, functions, ...
@ 2007-04-02 14:45  Shoaib Mir <shoaibmir@gmail.com>
  parent: Arnau <arnaulist@andromeiberica.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Shoaib Mir @ 2007-04-02 14:45 UTC (permalink / raw)
  To: arnaulist@andromeiberica.com; +Cc: 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@andromeiberica.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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Dumping views, functions, ...
@ 2007-04-02 16:22  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Arnau <arnaulist@andromeiberica.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2007-04-02 16:22 UTC (permalink / raw)
  To: arnaulist@andromeiberica.com; +Cc: pgsql-admin

Arnau <arnaulist@andromeiberica.com> writes:
>    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

-t works fine on views...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-04-02 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-04-02 14:28 Dumping views, functions, ... Arnau <arnaulist@andromeiberica.com>
2007-04-02 14:45 ` Shoaib Mir <shoaibmir@gmail.com>
2007-04-02 16:22 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox