Wednesday, October 27, 2010

Wordings For Puberty Invitation

key PostgreSQL result of a SELECT Copy a file

There are times when it is desirable to pass the results of a select a file, postgres allows you to perform this operation. For this you must run the following command at the console of postgres.
  • postgres = # copy (select * from table_name) to 'directorio_name / file_name',
This lets you copy all data from the select the file in the selected directory. To make it more clear you can see the following example which is executed in postgres console on a computer with Linux installed.
  • postgres = # copy (select * from students) to '/ tmp / data.txt';

IMPORTANT:
is important to remember some postgres commands that allow assistance.
  • postgres = # \\ h => can get help from the postgres commands.
  • postgres = # \\ help command => can get help from a postgres specific command.
  • postgres = # \\? => Can get help from the postgres client commands. Before concluding
I should clarify that "postgres = #" indicates that the command is executed in postgres console.

"Thank you for sharing your knowledge"

0 comments:

Post a Comment