pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
query to file
4+ messages / 4 participants
[nested] [flat]

* query to file
@ 2005-10-18 23:03  Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
  0 siblings, 3 replies; 4+ messages in thread

From: Judith Altamirano Figueroa @ 2005-10-18 23:03 UTC (permalink / raw)
  To: pgsql-sql

Excuse me, how can I send a query to a file?, for example the result of
this query:

select id_articulo, articulo, color_code from articulos;





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

* Re: query to file
@ 2005-10-19 00:05  Michael Fuhr <mike@fuhr.org>
  parent: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
  2 siblings, 0 replies; 4+ messages in thread

From: Michael Fuhr @ 2005-10-19 00:05 UTC (permalink / raw)
  To: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>; +Cc: pgsql-sql

On Tue, Oct 18, 2005 at 06:03:59PM -0500, Judith Altamirano Figueroa wrote:
> Excuse me, how can I send a query to a file?, for example the result of
> this query:
> 
> select id_articulo, articulo, color_code from articulos;

If you have a shell on a platform that supports input/output
redirection then you could redirect psql's output:

psql -c 'select ...' > filename



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

* Re: query to file
@ 2005-10-19 00:09  Michael Glaesemann <grzm@myrealbox.com>
  parent: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
  2 siblings, 0 replies; 4+ messages in thread

From: Michael Glaesemann @ 2005-10-19 00:09 UTC (permalink / raw)
  To: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>; +Cc: pgsql-sql


On Oct 19, 2005, at 8:03 , Judith Altamirano Figueroa wrote:

> Excuse me, how can I send a query to a file?, for example the  
> result of
> this query:
>
> select id_articulo, articulo, color_code from articulos;

You don't mention what client you're using. In psql, you can use

\o path/to/file.txt

For more psql goodness, take a look at:

http://www.postgresql.org/docs/8.0/interactive/app-psql.html

Hope this helps!

Michael Glaesemann
grzm myrealbox com






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

* Re: query to file
@ 2005-10-19 05:41  Eugene E. <sad@bankir.ru>
  parent: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
  2 siblings, 0 replies; 4+ messages in thread

From: Eugene E. @ 2005-10-19 05:41 UTC (permalink / raw)
  To: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>; +Cc: pgsql-sql

Judith Altamirano Figueroa wrote:
> Excuse me, how can I send a query to a file?, for example the result of
> this query:
> 
> select id_articulo, articulo, color_code from articulos;

if you mean psql

\o filename

and try to read output of a command \?



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


end of thread, other threads:[~2005-10-19 05:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-18 23:03 query to file Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
2005-10-19 00:05 ` Michael Fuhr <mike@fuhr.org>
2005-10-19 00:09 ` Michael Glaesemann <grzm@myrealbox.com>
2005-10-19 05:41 ` Eugene E. <sad@bankir.ru>

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