pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Judith Altamirano Figueroa <jaltamirano@correolux.com.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: query to file
Date: Tue, 18 Oct 2005 18:05:13 -0600
Message-ID: <20051019000513.GA44530@winnie.fuhr.org> (raw)
In-Reply-To: <1129676639.3523.19.camel@Desarrollo>
References: <1129676639.3523.19.camel@Desarrollo>

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



view thread (4+ messages)  latest in thread

Message-ID: <20051019000513.GA44530@winnie.fuhr.org>
Permalink:  ../20051019000513.GA44530@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20051019000513.GA44530@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, jaltamirano@correolux.com.mx
  Subject: Re: query to file
  In-Reply-To: <20051019000513.GA44530@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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