Re: \copy only select rows

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема Re: \copy only select rows
Дата
Msg-id 1188459686.18203.57.camel@neuromancer.home.net
обсуждение исходный текст
Ответ на Re: \copy only select rows  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
On Thu, 2007-08-30 at 09:14 +0200, A. Kretschmer wrote:
> am  Thu, dem 30.08.2007, um 14:59:06 +0800 mailte Ow Mun Heng folgendes:
> > Is there a way to do a dump of a database using a select statement?
>
> A complete database or just a simple table?

a simple table.. couple million records, want some of them for testing..
say ~100pcs

(right now, using insert into foo select * fromt able limit 10)

>
> >
> > eg: \copy trd to 'file' select * from table limit 10
>
> Since 8.2 you can use COPY (select * from table) TO 'file'.

superuser priviledge only right?

> Other solution, use a regular UNIX-Shell and psql, a la
>
> echo "select * from table limit 10;" | psql <database> > file

I want them to be in comma delimited format.. will the output be
importable again using \copy into pg?

В списке pgsql-general по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: \copy only select rows
Следующее
От: "Nitin Verma"
Дата:
Сообщение: Re: What kind of locks does vacuum process hold on the db?