Skip site navigation (1) Skip section navigation (2)

Re: SELECT to an external file

From: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
To: Mário Gamito <gamito(at)netual(dot)pt>
Cc: olly(at)lfix(dot)co(dot)uk, pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT to an external file
Date: 2004-08-24 17:35:49
Message-ID: 412B7C75.6030105@istreamimaging.com (view raw or flat)
Thread:
Lists: pgsql-general
use the psql -t option

Jeff

Mário Gamito wrote:

> Hi,
>
> First of all, thank you for your answers.
>
> Look at this file output:
>
>                                               url_negado
> ------------------------------------------------------------------------------------------------------ 
>
>  www.startux.org
>  www.hotmail.com
>  www.blabla.com
> (3 rows)
>
>
> Is there a way to postgres not print the 1st, 2nd and last line ?
> I need a list just with URLs.
>
> Thank you in advance.
>
> Warm Regards,
> Mário Gamito
>
> Oliver Elphick wrote:
>
>> On Tue, 2004-08-24 at 18:08, Mário Gamito wrote:
>>
>>> Hi,
>>>
>>> How can i draw the results of a SELECT in to a file in the filesystem ?
>>
>>
>>
>> Using psql:
>>
>>   1.  \o /path/to/file
>>       SELECT ... ;
>>       \o
>>
>>   2. psql -d my_database -c "SELECT ... " >/path/to/file
>>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>


In response to

pgsql-general by date

Next:From: mikeDate: 2004-08-24 17:42:52
Subject: Re: Invalid input for integer on VIEW
Previous:From: Jeff AmielDate: 2004-08-24 17:22:12
Subject: Re: SELECT to an external file

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group