473,395 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

temas del comando COPY

Hola a todos:

Tengo una duda, estaba leyendo los manuales con
referencia a COPY, pero
deseo hacer algo distinto con eso, si
hay uno equivalente aqui va:
COPY "select col01, col02 FROM TABLA where COND01 AND
COND02" TO
'/tmp/db01.txt' WITH DELIMITER '\t' NULL AS '';

Bueno leyendo el manual COPY solo funciona con tablas
normales, ni siquera
con vistas!!...
Hay alguna otra manera?.
con pgadmin se puede dar formato a las filas que
deseas con la opcion "ASCII
Text File",
no habra alguno con psql??
bueno el motivo de esto es que deseo hacer un trabajo
cron, de una base de
datos a otro..
una es la version mejorada del otro :S, pero por eso
me urge hacer este
tiempo de parches entre ambos :p.

El copiado seria asi, donde el archivo sql contendria
mi comando "COPY"
personalizado.
psql -c f_archivo_copy.sql -o /tmp/db01.txt db01

Y el insertado no habria problema , eso creo
psql -c f_archivo_insert_con_el_comando_copy.sql db02
Ademas con la opcion -o del psql, el resultado de mi
consulta sale demasiado
formateado, con nombres de columnas y el espaciado con
caracteres en blanco
y delimitadores como '|'..
Alguna idea?.
GRacias de Antemano.


__________________________________________________ ____________________
Correo Yahoo! - 6MB, más protección contra el spam ¡Gratis!
http://correo.yahoo.es

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
1 4808
On Wed, May 26, 2004 at 09:23:24PM +0200, mack paul wrote:
i> Hola a todos:

Tengo una duda, estaba leyendo los manuales con
referencia a COPY, pero
deseo hacer algo distinto con eso, si
hay uno equivalente aqui va:


Hola,

Esta es una lista en ingles, y deberias publicar en ingles. Si quieres
una lista en castellano te sugiero pgsql-es-ayuda

http://archives.postgresql.org/pgsql-es-ayuda
PS: si quieres obtener en un archivo el resultado con formato de una
consulta, puedes usar el comando \o de psql, y \pset para cambiar los
separadores de campos y otros atributos.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No es bueno caminar con un hombre muerto"
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
15
by: A | last post by:
Hi, A default copy constructor is created for you when you don't specify one yourself. In such case, the default copy constructor will simply do a bitwise copy for primitives (including...
11
by: Sam Wilson [Bentley] | last post by:
If you pass a C++ object by value as an argument to a function which has a variable-length argument list (...), the MSVC7 C++ compiler does not call the object's copy constructor and will not...
5
by: Tony Johansson | last post by:
Hello! I'm reading in a book about C++ and that is something that sound strange. It says "Pointers have reference-assignment semantics similar to those in Java. For example, after the...
3
by: maheshkadam | last post by:
Hi friends I am new to perl so please guide me. I have one application which created backup log file every day.But it appends that file so you can see logs for different day in one file only. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.