|
1 | 1 | <!-- |
2 | | -$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.67 2005/09/05 14:44:05 adunstan Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.68 2005/10/13 02:00:09 momjian Exp $ |
3 | 3 | PostgreSQL documentation |
4 | 4 | --> |
5 | 5 |
|
@@ -708,6 +708,18 @@ COPY country FROM '/usr1/proj/bray/sql/country_data'; |
708 | 708 | </programlisting> |
709 | 709 | </para> |
710 | 710 |
|
| 711 | + <para> |
| 712 | + To copy into a file just the countries whose names start with 'A' |
| 713 | + using a temporary table which is automatically deleted: |
| 714 | +<programlisting> |
| 715 | +BEGIN; |
| 716 | +CREATE TEMP TABLE a_list_COUNTRIES AS |
| 717 | + SELECT * FROM country WHERE country_name LIKE 'A%'; |
| 718 | +COPY a_list_countries TO '/usr1/proj/bray/sql/a_list_countries.copy'; |
| 719 | +ROLLBACK; |
| 720 | +</programlisting> |
| 721 | + </para> |
| 722 | + |
711 | 723 | <para> |
712 | 724 | Here is a sample of data suitable for copying into a table from |
713 | 725 | <literal>STDIN</literal>: |
|