Re: [GENERAL] copy losing information

2006-07-27 Thread Silvela, Jaime \(Exchange\)
int2, freq varchar(2), geog varchar(6) ) Thanks Jaime -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 5:05 PM To: Alvaro Herrera Cc: Silvela, Jaime (Exchange); pgsql-general@postgresql.org Subject: Re: [GENERAL] copy losing information

Re: [GENERAL] copy losing information

2006-07-27 Thread Tom Lane
Silvela, Jaime \(Exchange\) [EMAIL PROTECTED] writes: Tom, how and why would INSERTs be dropped on the client side? [ shrug... ] I don't know your code; I was thinking about garden variety bugs in your ruby script. However, if you can make it happen just through psql \copy then that theory

Re: [GENERAL] copy losing information

2006-07-26 Thread Tom Lane
Silvela, Jaime \(Exchange\) [EMAIL PROTECTED] writes: I've started to notice missing info sometimes. I'll truncate the table, read from the file, and notice that sometimes there are less rows in the table than in the file. Have you made any attempt to determine *which* rows are missing? I'm

Re: [GENERAL] copy losing information

2006-07-26 Thread Silvela, Jaime \(Exchange\)
To: Silvela, Jaime (Exchange) Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] copy losing information Silvela, Jaime \(Exchange\) [EMAIL PROTECTED] writes: I've started to notice missing info sometimes. I'll truncate the table, read from the file, and notice that sometimes there are less rows

Re: [GENERAL] copy losing information

2006-07-26 Thread Alvaro Herrera
Silvela, Jaime (Exchange) wrote: No lines contain quotes. And the same file will sometimes be fully imported, and sometimes lose data. I'm thinking that under heavy loads, the database is discarding INSERTS. I don't think that's very likely. How are you checking that the data is there? Do

Re: [GENERAL] copy losing information

2006-07-26 Thread Reece Hart
On Wed, 2006-07-26 at 12:48 -0400, Silvela, Jaime (Exchange) wrote: This is the first time I post to the list. Ive done a brief search and didnt find my issue treated already, so here it goes. Apologies if this has been reported before. What PG version and environment? How about sending

Re: [GENERAL] copy losing information

2006-07-26 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Silvela, Jaime (Exchange) wrote: No lines contain quotes. And the same file will sometimes be fully imported, and sometimes lose data. I'm thinking that under heavy loads, the database is discarding INSERTS. I don't think that's very likely.

Re: [GENERAL] Copy from text file

2006-06-22 Thread Chris
Ricardo Vaz wrote: Hi, It is possible to copy data from text file (CSV) ignoring some columns of this text file? (How come this was posted 3 times?) I don't think so but you could load it into a temporary table and then: insert into new_table select col1, col2 from temp_table; --

Re: [GENERAL] Copy from text file

2006-06-22 Thread Geoffrey
Chris wrote: Ricardo Vaz wrote: Hi, It is possible to copy data from text file (CSV) ignoring some columns of this text file? Assuming you're on a Unix box, you could easily use awk or perl to parse your csv and create one that contains only the columns you want. -- Until later,

Re: [GENERAL] Copy from text file

2006-06-22 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Geoffrey wrote: Chris wrote: Ricardo Vaz wrote: Hi, It is possible to copy data from text file (CSV) ignoring some columns of this text file? Assuming you're on a Unix box, you could easily use awk or perl to parse your csv and create one

Re: [GENERAL] Copy from text file

2006-06-22 Thread Rich Shepard
On Thu, 22 Jun 2006, Ron Johnson wrote: Assuming you're on a Unix box, you could easily use awk or perl to parse your csv and create one that contains only the columns you want. And probably pipe the results directly into the copy command, bypassing any intermediary steps. Well, why not

Re: [GENERAL] Copy content from dbs

2006-06-14 Thread Thomas Kellerer
On 14.06.2006 13:56 Guido Neitzer wrote: Hi. Is there an easy way to copy the content including the table structure, indexes and so on from one db to another? Let's say I have a production db called db_production and want to create a development db called db_dev with exactly the same

Re: [GENERAL] Copy content from dbs

2006-06-14 Thread Guido Neitzer
On 14.06.2006, at 14:02 Uhr, Thomas Kellerer wrote: pg_dump: http://www.postgresql.org/docs/8.1/static/app-pgdump.html Found it. Thanks. I was just blind and thought, pg_dump can only re- create the db with the same name. Thanks, Guido ---(end of

Re: [GENERAL] Copy content from dbs

2006-06-14 Thread A. Kretschmer
am 14.06.2006, um 13:56:06 +0200 mailte Guido Neitzer folgendes: Hi. Is there an easy way to copy the content including the table structure, indexes and so on from one db to another? Create the new db with the old db as template. Andreas -- Andreas Kretschmer(Kontakt: siehe Header)

Re: [GENERAL] Copy content from dbs

2006-06-14 Thread Guido Neitzer
On 14.06.2006, at 14:12 Uhr, A. Kretschmer wrote: Is there an easy way to copy the content including the table structure, indexes and so on from one db to another? Create the new db with the old db as template. Thanks, but as far as I can see, I have to disconnect all clients from the

Re: [GENERAL] COPY command documentation

2006-04-21 Thread Bruce Momjian
I have added the following patch for 8.2 that suggests using E'' strings and doubling backslashes used as path separators, and backpatched the later suggestion to 8.1. Thanks. --- Oisin Glynn wrote: I have driven myself

Re: [GENERAL] COPY command documentation

2006-03-24 Thread Dave Page
On 23/3/06 20:12, David Fetter [EMAIL PROTECTED] wrote: On Thu, Mar 23, 2006 at 07:00:13PM +0100, Jim Nasby wrote: On Mar 23, 2006, at 4:08 PM, Oisin Glynn wrote: I just discovered that the comments from 8.0 had the answer I was looking for but these comments are not in the 8.1 docs.

Re: [GENERAL] COPY command documentation

2006-03-24 Thread Jim C. Nasby
On Fri, Mar 24, 2006 at 08:58:55AM +, Dave Page wrote: On 23/3/06 20:12, David Fetter [EMAIL PROTECTED] wrote: On Thu, Mar 23, 2006 at 07:00:13PM +0100, Jim Nasby wrote: On Mar 23, 2006, at 4:08 PM, Oisin Glynn wrote: I just discovered that the comments from 8.0 had the answer I

Re: [GENERAL] COPY command documentation

2006-03-24 Thread Dave Page
-Original Message- From: Jim C. Nasby [mailto:[EMAIL PROTECTED] Sent: 24 March 2006 12:28 To: Dave Page Cc: David Fetter; Oisin Glynn; pgsql general; PostgreSQL Docs Subject: Re: [GENERAL] COPY command documentation But now that stuff gets 'lost' with ever new major version

Re: [GENERAL] COPY command documentation

2006-03-23 Thread Jim Nasby
On Mar 23, 2006, at 4:08 PM, Oisin Glynn wrote: I just discovered that the comments from 8.0 had the answer I was looking for but these comments are not in the 8.1 docs. Should the comments be rolled forward as new versions are created? Or if valid comments added to the docs themselves?

Re: [GENERAL] COPY command documentation

2006-03-23 Thread David Fetter
On Thu, Mar 23, 2006 at 07:00:13PM +0100, Jim Nasby wrote: On Mar 23, 2006, at 4:08 PM, Oisin Glynn wrote: I just discovered that the comments from 8.0 had the answer I was looking for but these comments are not in the 8.1 docs. Should the comments be rolled forward as new versions are

Re: [GENERAL] \copy combine with SELECT

2006-03-18 Thread jia ding
Thanks Martijn. \d test Table public.test Column | Type | Modifiers id | integer | score| integer | I tried \copy test (score) to test.txt. It works well. But, suppose I want to select rows with score 20 (just an example). Then,\copy table [ ( column_list ) ] { from |

Re: [GENERAL] \copy combine with SELECT

2006-03-17 Thread Martijn van Oosterhout
On Fri, Mar 17, 2006 at 10:45:16AM +1100, Chris wrote: Doesn't look like \copy lets you specify which fields to include though. Ofcourse it does, you just need to use parenthesis. From the manpage: \copy table [ ( column_list ) ] { from | to } filename | stdin | stdout [ with ] [ oids ] [

Re: [GENERAL] \copy combine with SELECT

2006-03-16 Thread jia ding
yes, of couse COPYbut,= copy test to 'test.txt';ERROR: must be superuser to COPY to or from a fileHINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone. On 3/16/06, Chris [EMAIL PROTECTED] wrote: jia ding wrote: Hi all, I tried: select id, nameinto table2 from

Re: [GENERAL] \copy combine with SELECT

2006-03-16 Thread Chris
jia ding wrote: yes, of couse COPY but, = copy test to 'test.txt'; ERROR: must be superuser to COPY to or from a file HINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone. Straight from the documentation: Do not confuse COPY with the psql instruction

Re: [GENERAL] \copy combine with SELECT

2006-03-15 Thread Chris
jia ding wrote: Hi all, I tried: select id, name into table2 from table1; \copy table2 to filename.txt in order to export 2 columns from table1 to a file. But, I am thinking, if there is a command can combine these two command together? Maybe, something like: \copy select id,name from

Re: [GENERAL] \copy combine with SELECT

2006-03-15 Thread Qingqing Zhou
jia ding [EMAIL PROTECTED] wrote I tried: select id, name into table2 from table1; \copy table2 to filename.txt in order to export 2 columns from table1 to a file. But, I am thinking, if there is a command can combine these two command together? Notice that COPY command can be used

Re: [GENERAL] COPY has no access permissions

2006-03-12 Thread P G
Thanks, Mike! Your solution seems to have solved it. --- mike [EMAIL PROTECTED] wrote: XP is denying access to your desktop to the postgres account which the database service is running on. If you go to the folder C:\Document and Settings\your_login_id, right click on it, select

Re: [GENERAL] copy a postgres dbase to the same machine with different name?

2006-01-10 Thread Tom Lane
Jonathan Roby [EMAIL PROTECTED] writes: For a project here at work I look after a web app that communicates with = a postgresql database. We need to clone/copy the existing database to = run app upgrades on the clone database and then use the upgraded = database in place of the original. Are

Re: [GENERAL] COPY to

2006-01-08 Thread Tino Wildenhain
Angshu Kar schrieb: Thanks Andreas. But how can I run this from the pgAdmin III Query tool in a WinXP m/c? You dont. There is the function for saving query data to file already built in. Just press the button (documentation or tooltips tell you) and select the format of your csv in the

Re: [GENERAL] COPY to

2006-01-08 Thread Angshu Kar
Got it. Thanks a ton Tino... On 1/8/06, Tino Wildenhain [EMAIL PROTECTED] wrote: Angshu Kar schrieb: Thanks Andreas. But how can I run this from the pgAdmin III Query tool in a WinXP m/c? You dont. There is the function for saving query data to filealready built in. Just press the button

Re: [GENERAL] COPY to

2006-01-07 Thread A. Kretschmer
am 07.01.2006, um 14:13:28 -0600 mailte Angshu Kar folgendes: Hi Pgsql, I want to copy the output of a SELECT query onto a text file. I'm trying to use the COPY command for that as : COPY (SELECT ) to 'outfile' Wrong. \o output.txt select ... \o And now you have the result in

Re: [GENERAL] COPY to

2006-01-07 Thread Angshu Kar
Thanks Andreas. But how can I run this from the pgAdmin III Query tool in a WinXP m/c?On 1/7/06, A. Kretschmer [EMAIL PROTECTED] wrote:am07.01.2006, um 14:13:28 -0600 mailte Angshu Kar folgendes: Hi Pgsql, I want to copy the output of a SELECT query onto a text file. I'm trying to use the COPY

Re: [GENERAL] COPY to

2006-01-07 Thread Andreas Kretschmer
Angshu Kar [EMAIL PROTECTED] schrieb: Thanks Andreas. But how can I run this from the pgAdmin III Query tool in a WinXP m/c? Sorry, i don't using pgAdmin nor windows... I mean, use the CLI-Interface psql. Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely

Re: [GENERAL] COPY to

2006-01-07 Thread Angshu Kar
Ok thanks AndreasOn 1/7/06, Andreas Kretschmer [EMAIL PROTECTED] wrote: Angshu Kar [EMAIL PROTECTED] schrieb: Thanks Andreas. But how can I run this from the pgAdmin III Query tool in a WinXP m/c?Sorry, i don't using pgAdmin nor windows... I mean, use the CLI-Interface psql.Andreas--Really, I'm

Re: [GENERAL] copy from error

2006-01-05 Thread marcelo Cortez
Tom , Michael Thanks for your responses, there any procedure for fix fts installation? any advice will be appreciated Tia. best regards. MDC --- Tom Lane [EMAIL PROTECTED] escribió: marcelo Cortez [EMAIL PROTECTED] writes: the follow error: Warning: pg_query(): Query failed:

Re: [GENERAL] copy from error

2006-01-05 Thread Michael Fuhr
On Thu, Jan 05, 2006 at 02:34:14PM +, marcelo Cortez wrote: there any procedure for fix fts installation? As Tom asked, what steps did you follow to install tsearch2? The standard installation script creates its tables with oids, at least in current releases, so you appear to have

Re: [GENERAL] copy from error

2006-01-04 Thread Michael Fuhr
On Wed, Jan 04, 2006 at 06:30:50PM +, marcelo Cortez wrote: Warning: pg_query(): Query failed: ERROR: no existe la columna oid the column oid don't exists in english. CONTEXT: sentencia SQL: select oid from public.pg_ts_cfg where locale = $1 I'd guess that you're using tsearch2 but

Re: [GENERAL] copy from error

2006-01-04 Thread Tom Lane
marcelo Cortez [EMAIL PROTECTED] writes: the follow error: Warning: pg_query(): Query failed: ERROR: no existe la columna oid the column oid don't exists in english. CONTEXT: sentencia SQL: select oid from public.pg_ts_cfg where locale = $1 You seem to have managed to create the

Re: [GENERAL] copy csv eclosed by analog quotes problem superuser ?

2005-12-28 Thread George Pavlov
use this: $ psql -Uyer_user -dyer_database -fyer_copy_script.sql yer_data_file.csv where yer-copy-script.sql is: -- - drop table foo; create table foo ( c01 varchar, c02 varchar, c03 varchar, c04 varchar, c05 varchar, c06 varchar, c07 varchar, c08 varchar,

Re: [GENERAL] copy with where query?

2005-12-08 Thread Dann Corbit
How about something like: BEGIN TRAN SELECT INTO TEMP TABLE foobar WHERE cond_list COPY foobar TO data.txt COMMIT -Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-general- [EMAIL PROTECTED] On Behalf Of CSN Sent: Thursday, December 08, 2005 5:29 PM To:

Re: [GENERAL] copy data from utf16 csv file

2005-10-28 Thread Peter Wiersig
On Thu, Oct 27, 2005 at 03:30:43PM -0700, Shane wrote: Can anyone suggest how I can either get these into PG directly or massage the file so as to be compatable? To my knowledge the only Unicode encoding used by Postgres is utf-8. Try 'recode' or 'iconv' on unix-like systems. A better text

Re: [GENERAL] Copy of a schema

2005-10-27 Thread A. Kretschmer
am 27.10.2005, um 11:13:43 +0200 mailte Frederic Massot folgendes: Hi, I wonder whether it is possible to copy a schema with a postgreSQL command like copy_schema schema_src schema_dest ? You can rename a schema. And, you can make a dump, then rename it, and then restore from backup. Or,

Re: [GENERAL] copy data between database

2005-10-10 Thread Scott Marlowe
On Fri, 2005-10-07 at 21:34, Qingqing Zhou wrote: [EMAIL PROTECTED] wrote Hi, I have a table A in both database d1 and d2. I would like to copy data in A in d1 to A in d2. How can I do it? I do not want to copy all data, just some part of A, Here is a way if you feel want to try. The

Re: [GENERAL] copy data between database

2005-10-10 Thread Qingqing Zhou
Scott Marlowe [EMAIL PROTECTED] wrote Under no circumstances should you do this with a database that has any data in it that you value. pg_dump / pg_restore / psql are the preferred way of doing this. Oh yeah, sorry for the miss leading information. My method is dangerous and can not

Re: [GENERAL] copy data between database

2005-10-10 Thread Scott Marlowe
On Mon, 2005-10-10 at 13:53, Qingqing Zhou wrote: Scott Marlowe [EMAIL PROTECTED] wrote Under no circumstances should you do this with a database that has any data in it that you value. pg_dump / pg_restore / psql are the preferred way of doing this. Oh yeah, sorry for the miss

Re: [GENERAL] copy data between database

2005-10-07 Thread Hannes Dorbath
Never used it, but look at contrib/dblink and better use different schemas instead of different databases in future -- if you want to exchange data. On 07.10.2005 03:55, [EMAIL PROTECTED] wrote: Hi, I have a table A in both database d1 and d2. I would like to copy data in A in d1 to A in d2.

Re: [GENERAL] copy data between database

2005-10-07 Thread Qingqing Zhou
[EMAIL PROTECTED] wrote Hi, I have a table A in both database d1 and d2. I would like to copy data in A in d1 to A in d2. How can I do it? I do not want to copy all data, just some part of A, Here is a way if you feel want to try. The basic idea is that create a table (say OS file name of

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread Dawid Kuroczko
On 9/23/05, John Seberg [EMAIL PROTECTED] wrote: I have used the COPY command dozens of times! I thinkI *get* it. But, I'm getting permission deniederrors.This is a fresh install of Fedora Core 4 (x86). I havePostgresql running under the user postgres. I am logged into to psql as postgres. The

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread Michael Fuhr
On Fri, Sep 23, 2005 at 07:03:44AM -0700, John Seberg wrote: I have used the COPY command dozens of times! I think I *get* it. But, I'm getting permission denied errors. This is a fresh install of Fedora Core 4 (x86). I have Postgresql running under the user postgres. I am logged into to

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread Douglas McNaught
John Seberg [EMAIL PROTECTED] writes: I have bounced the db, made sure the processes and files are owned by postgres. What else is there? COPY consult FROM '/var/lib/pgsql/migrate/consult.txt'; This is probably a dumb question, but is 'migrate' owned and readable by 'postgres' as well? If

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread Tom Lane
John Seberg [EMAIL PROTECTED] writes: I have used the COPY command dozens of times! I think I *get* it. But, I'm getting permission denied errors. This is a fresh install of Fedora Core 4 (x86). I have Postgresql running under the user postgres. I am logged into to psql as postgres. The

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread John Seberg
--- Tom Lane [EMAIL PROTECTED] wrote: John Seberg [EMAIL PROTECTED] writes: I have used the COPY command dozens of times! I think I *get* it. But, I'm getting permission denied errors. This is a fresh install of Fedora Core 4 (x86). I have Postgresql running under the user

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread Dawid Kuroczko
On 9/23/05, John Seberg [EMAIL PROTECTED] wrote: --- Tom Lane [EMAIL PROTECTED] wrote: John Seberg [EMAIL PROTECTED] writes: I have used the COPY command dozens of times! I think I *get* it. But, I'm getting permission denied errors. This is a fresh install of Fedora Core 4 (x86). I have

Re: [GENERAL] COPY and Unicode...

2005-09-21 Thread Douglas McNaught
Cristian Prieto [EMAIL PROTECTED] writes: Hello, I need to import some amount of data using the COPY command, the main trouble I found is that the Database is in UNICODE format and the data in ASCII Latin-1 codepage, when I try to import it, COPY respond with: ERROR: invalid byte sequence

Re: [GENERAL] COPY and Unicode...

2005-09-21 Thread Tom Lane
Cristian Prieto [EMAIL PROTECTED] writes: Hello, I need to import some amount of data using the COPY command, the main trouble I found is that the Database is in UNICODE format and the data in ASCII Latin-1 codepage, when I try to import it, COPY respond with: ERROR: invalid byte sequence

Re: [GENERAL] COPY and Unicode...

2005-09-21 Thread Cristian Prieto
Thanks a lot! Your help was very handy! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Douglas McNaught Sent: Miércoles, 21 de Septiembre de 2005 02:39 p.m. To: Cristian Prieto Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] COPY and Unicode

Re: [GENERAL] Copy DataBases Server to server

2005-09-15 Thread Tino Wildenhain
nicolas.hafner schrieb: Hi everyone, I've a problem that i'am not able to solve alone (i'm kinda newbie on postgresql). we were running PostgreSQL 7.4 under Linux (Mandriva) but our HDD crashs and we lost the system but were able to backup the database files to an other HDD. now we want to

Re: [GENERAL] copy from ignores \,

2005-08-19 Thread Bruce Momjian
Read the COPY manual page --- backslashes are special and have to be doubled to be treated as literal. --- Bauhofer Mario wrote: Hi, i tried to copy a german text file into a table imp using copy from.

Re: [GENERAL] COPY command use UTF-8 encoding and NOT UNICODE(16bits)... please confirm. Should postgresql add :set CLIENT_ENCODING to 'UTF-8'; to avoid confusion

2005-04-06 Thread Tom Lane
David Gagnon [EMAIL PROTECTED] writes: So am I right ? Is Postgresql using UTF-8 and don`t really understand UNICODE file (UCS-2)? Is there a way I can make the COPY command with a UNICODE UCS-2 encoding Postgres only supports UTF-8, not any other encoding of Unicode. Sorry.

Re: [GENERAL] COPY command use UTF-8 encoding and NOT

2005-04-06 Thread Tino Wildenhain
Am Mittwoch, den 06.04.2005, 18:12 -0400 schrieb David Gagnon: Hi all, I ran into this problem and want to share and have a confirmation. I tried to use COPY function to load bulk data. I craft myself a UNICODE file from a MSSQL db. I can't load it into the postgresql. I always get

Re: [GENERAL] COPY command use UTF-8 encoding and NOT UNICODE(16bits)... please confirm. Should postgresql add :set CLIENT_ENCODING to 'UTF-8'; to avoid confusion

2005-04-06 Thread Mike Rylander
On Apr 6, 2005 10:22 PM, Tom Lane [EMAIL PROTECTED] wrote: David Gagnon [EMAIL PROTECTED] writes: So am I right ? Is Postgresql using UTF-8 and don`t really understand UNICODE file (UCS-2)? Is there a way I can make the COPY command with a UNICODE UCS-2 encoding Postgres only supports

Re: [GENERAL] Copy row from table to table

2004-12-14 Thread Michael Fuhr
On Tue, Dec 14, 2004 at 11:48:21AM -0600, Kall, Bruce A. wrote: What is the easiest way to copy a particular row from one table to another (assuming all the columns are exactly the same). I want to maintain a table ('backup_table') that has rows I have (or will be) deleting from my

Re: [GENERAL] Copy row from table to table

2004-12-14 Thread Doug Bloebaum
Michael Fuhr [EMAIL PROTECTED] 12/14/04 1:45 PM On Tue, Dec 14, 2004 at 11:48:21AM -0600, Kall, Bruce A. wrote: What is the easiest way to copy a particular row from one table to another (assuming all the columns are exactly the same). I want to maintain a table ('backup_table') that has

Re: [GENERAL] Copy command and import - MS SQL Server to Postgres

2004-11-07 Thread Sim Zacks
I know this doesn't answer your question, but have you considered doing it with DTS instead of BCP? I used it recently to migrate an Access database to PostGreSQL and it worked great. One of the big advantages is the ability to transform the data as it is being converted. It is also built

Re: [GENERAL] Copy command and import - MS SQL Server to Postgres

2004-11-05 Thread Allen Landsidel
On Fri, 5 Nov 2004 16:31:21 -0500, Goutam Paruchuri [EMAIL PROTECTED] wrote: Iam trying to import data from ms-sql server to postgres. I export the data which has datetime columns in sql server using BCP. I use the following to import back into postgres. copy tablename from

Re: [GENERAL] Copy command and import - MS SQL Server to Postgres

2004-11-05 Thread Robert Fitzpatrick
On Fri, 2004-11-05 at 16:48, Allen Landsidel wrote: On Fri, 5 Nov 2004 16:31:21 -0500, Goutam Paruchuri [EMAIL PROTECTED] wrote: Iam trying to import data from ms-sql server to postgres. I export the data which has datetime columns in sql server using BCP. I use the following to import

Re: [GENERAL] Copy command and import - MS SQL Server to Postgres

2004-11-05 Thread Goutam Paruchuri
Title: Re: [GENERAL] Copy command and import - MS SQL Server to Postgres I tried by taking the .000 still the same issue. WITH NULL AS '' works fine. WITH NULL AS NULL gives an error as well. - Goutam From: Robert Fitzpatrick [mailto:[EMAIL PROTECTED]Sent: Fri 11/5/2004 5:33 PMTo

Re: [GENERAL] Copy command and import - MS SQL Server to Postgres

2004-11-05 Thread Tom Lane
Robert Fitzpatrick [EMAIL PROTECTED] writes: My input file has the timestamp value like 2004-09-30 11:31:00.000 What about the .000 on the end? I am not able to enter that format in a timestamp field in 7.4.5, it is invalid. Nonsense. regression=# select '2004-09-30

Re: [GENERAL] copy - fields enclosed by, ignore x lines

2004-10-25 Thread CSN
Ah, looks like enclosed by will be in PG 8 :). Is QUOTE [ AS ] 'quote' for the enclosed by character? Ignore x lines would be nice, but not as big of a deal. http://developer.postgresql.org/docs/postgres/sql-copy.html --- CSN [EMAIL PROTECTED] wrote: Any chance of changing \copy and COPY

Re: [GENERAL] copy - fields enclosed by, ignore x lines

2004-10-25 Thread Pierre-Frdric Caillaud
Use python's (or another language) CSV reader module which will parse the quotes for you and write the values in a tab-delimited file. Don't forget to escape the tabs in the strings... it should be less than 10 lines of code. On Mon, 25 Oct 2004 14:45:57 -0700 (PDT), CSN [EMAIL

Re: [GENERAL] COPY data and referential triggers ...

2004-10-23 Thread Tom Lane
James Robinson [EMAIL PROTECTED] writes: Just a sanity check -- data fed into pg using the COPY tablename (col1, col2) FROM stdin; ... data \. Does not cause referential triggers to fire (i.e. foreign keys), right? Sure it does. regression=# create table t1 (f1 int

Re: [GENERAL] COPY FROM STDIN not in local file

2004-09-30 Thread Josh Close
On Wed, 29 Sep 2004 14:40:34 -0500, Josh Close [EMAIL PROTECTED] wrote: Is there a way to do COPY FROM STDIN from sql? So, remotely I could run the copy command and somehow push the info over instead of having it on the server. For those who are curious, I found a php implementation of this.

Re: [GENERAL] COPY FROM STDIN not in local file

2004-09-29 Thread Bruce Momjian
You have to use psql's \copy. --- Josh Close wrote: Is there a way to do COPY FROM STDIN from sql? So, remotely I could run the copy command and somehow push the info over instead of having it on the server. -Josh

Re: [GENERAL] copy a database

2004-08-26 Thread David Suela Fernández
El mié, 25-08-2004 a las 20:54, Tom Lane escribió: David Suela =?ISO-8859-1?Q?Fern=E1ndez?= [EMAIL PROTECTED] writes: The problem is that pg_dump always give me the next error: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: relation pg_user does not exist Have

Re: [GENERAL] copy a database

2004-08-26 Thread Tom Lane
David Suela =?ISO-8859-1?Q?Fern=E1ndez?= [EMAIL PROTECTED] writes: It return: ERROR: permission denied to create pg_catalog.pg_user DETAIL: System catalog modifications are currently disallowed. How can i change this permissions? IIRC, you need to run a standalone backend, with either the

Re: [GENERAL] copy a database

2004-08-26 Thread Guy Fraser
Have you tried to use copy to export the data from each table? As a last resort you could try this, since you said you can still select data from the tables. Make a list of tables then : sed -e /^.*/copy TO '.sql';/ table.list | psql database This should create a file for each table ending with

Re: [GENERAL] copy a database

2004-08-25 Thread Oliver Elphick
On Wed, 2004-08-25 at 15:08, David Suela Fernández wrote: The problem is that pg_dump always give me the next error: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: relation pg_user does not exist pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE

Re: [GENERAL] copy a database

2004-08-25 Thread Alvaro Herrera
On Wed, Aug 25, 2004 at 04:25:02PM +0100, Oliver Elphick wrote: On Wed, 2004-08-25 at 15:08, David Suela Fernández wrote: The problem is that pg_dump always give me the next error: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: relation pg_user does not exist

Re: [GENERAL] copy a database

2004-08-25 Thread Alvaro Herrera
On Wed, Aug 25, 2004 at 12:09:58PM -0400, Alvaro Herrera wrote: No, pg_user is a view on pg_shadow ... SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper, pg_shadow.usecatupd, ''::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig FROM

Re: [GENERAL] copy a database

2004-08-25 Thread Oliver Elphick
On Wed, 2004-08-25 at 17:09, Alvaro Herrera wrote: On Wed, Aug 25, 2004 at 04:25:02PM +0100, Oliver Elphick wrote: Maybe recreating pg_user in the database will help. It is a global table, so if you have other databases where pg_user exists, copy the row from pg_class in that database to

Re: [GENERAL] COPY not handling BLOBs

2004-08-08 Thread Doug McNaught
Jan Wieck [EMAIL PROTECTED] writes: On 8/4/2004 1:58 PM, David Rysdam wrote: bytea will only go up to several thousand bytes according to the docs. I assume it's not very precise because the maximum is 8196 - $other_fields_in_row. My binary data could be a couple times that or even much

Re: [GENERAL] COPY, \copy with defaults

2004-08-08 Thread Tom Lane
CSN [EMAIL PROTECTED] writes: I guess this is a feature request since I can't figure out a way to do it directly in postgresql (plus COPY/\copy isn't in SQL specs). You do know that COPY uses the column defaults for all columns not listed in the input list? regards,

Re: [GENERAL] COPY, \copy with defaults

2004-08-08 Thread CSN
--- Tom Lane [EMAIL PROTECTED] wrote: CSN [EMAIL PROTECTED] writes: I guess this is a feature request since I can't figure out a way to do it directly in postgresql (plus COPY/\copy isn't in SQL specs). You do know that COPY uses the column defaults for all columns not listed in the

Re: [GENERAL] COPY not handling BLOBs

2004-08-07 Thread Jan Wieck
On 8/4/2004 1:58 PM, David Rysdam wrote: Doug McNaught wrote: David Rysdam [EMAIL PROTECTED] writes: Right now I'm having to write a program to create all the large objects up front and record the OIDs in a file which I will then COPY in with the rest of my data. You might consider using

Re: [GENERAL] COPY error handling

2004-06-07 Thread Bricklen
Bruno Wolff III wrote: On Fri, Jun 04, 2004 at 14:11:19 +, Bricklen [EMAIL PROTECTED] wrote: Hi, I'm not sure if this is the correct group for this question, but I'll post it hoping that it is. I'm loading several ~15 million row files into a table using the COPY command. Apparently one of

Re: [GENERAL] COPY TO order

2004-04-12 Thread Guy Fraser
Christopher Browne wrote: Centuries ago, Nostradamus foresaw when [EMAIL PROTECTED] (Clodoaldo Pinto Neto) would write: How to make sure COPY TO writes the table lines to the file in the same order they were inserted? You probably want to rewrite PostgreSQL then. I'm producing html

Re: [GENERAL] COPY TO order

2004-04-12 Thread Clodoaldo Pinto Neto
--- Guy Fraser [EMAIL PROTECTED] If you have a 'serial' or 'bigserial' field like this : create table test_table ( test_id bigserial, data integer, comment text ); and you use : copy test_table (data,comment) from '/wherever/the/file/is' using delimiters ','; to insert

Re: [GENERAL] COPY TO order

2004-04-10 Thread Christopher Browne
Centuries ago, Nostradamus foresaw when [EMAIL PROTECTED] (Clodoaldo Pinto Neto) would write: How to make sure COPY TO writes the table lines to the file in the same order they were inserted? You probably want to rewrite PostgreSQL then. I'm producing html pages in pl/pgsql and using COPY TO

Re: [GENERAL] Copy and xml files

2004-02-03 Thread Chris Gamache
COPY works for whole tables, and can't append rows. You're going to have to escape your linebreaks and tabs to use COPY ... As I recall, you can specify your own custom column and row delimiters... You might consider creating some type of primary key for the table. A serial column would work

Re: [GENERAL] COPY - Ignore Problems

2003-12-22 Thread Dann Corbit
How about this: Let's call your current table tab. Insert into a table with the same shape as your table tab called 'lfd'. Create an index on table lfd on fields lname, fname, workdate. Delete from lfd where lfd.lname = tab.lname and lfd.fname = tab.fname and lfd.workdata = tab.workdate Insert

Re: [real] Re: [GENERAL] copy command problem

2003-12-17 Thread Don Isgitt
Bernd Helmle wrote: Don Isgitt wrote: Hi, gds2=# copy survey_match from '/home/djisgitt/perl/fixsvy.dat' with delimiter as ''; ERROR: could not open file /home/djisgitt/perl/fixsvy.dat for reading: Permission denied File sysem permissions are [EMAIL PROTECTED] perl]$ ls -l

Re: [GENERAL] COPY COMMAND

2003-10-07 Thread Richard Huxton
On Tuesday 07 October 2003 07:29, Deepa K wrote: Hi All, Is it possible to insert n rows with 1 or 2 invalid rows using copy command. I used it, it rollbacks everything even if 1 row gets an error. Is their any other way to do it. You need to remove the bad rows. This is IMHO a Good

Re: [GENERAL] Copy From with null data

2003-08-16 Thread Tom Lane
James Moe [EMAIL PROTECTED] writes: this bizarre error message is produced in psql: : can't parse ne 1, pg_atoi: error in 1 That's unrelated to your NULL issue. It looks like you have Windows-style newlines (\r\n) in your data. COPY only likes Unix-style newlines (\n). It thinks the \r is a

Re: [GENERAL] COPY and double-quote-separated fields

2003-08-03 Thread Ron Johnson
On Sun, 2003-08-03 at 06:08, Jason Godden wrote: Hi Ron, I have the same issue - best thing is to run the data through sed but pipe it straight to the psql import table - that way you never have to worry about creating misc. files. I also always use an intermediate temporary import

Re: [GENERAL] COPY and domains

2003-08-01 Thread Richard Huxton
On Friday 01 August 2003 08:45, Tambet Matiisen wrote: I noticed that COPY is getting very slow, when importing to table, which makes use of domains as column datatypes. It seems like foreign key validation is especially slow. It takes ages to import table with 25000 rows, which has foreign

Re: [GENERAL] COPY problem

2003-07-16 Thread Andrew Gould
--- Ron [EMAIL PROTECTED] wrote: I am creating a new database on a brand new server (P4, 1GB RAM, postgres 7.3.3, debian 3.0) and trying to populate one of the tables with the COPY command. I split a large file with 20 million records into 20 files, but when I run COPY I usually get the

Re: [GENERAL] COPY command with timestamp and NULLs

2001-09-10 Thread Jeff Eckermann
COPY expects NULL to be represented by \N by default. Probably easiest to explicitly specify on the command line what you want COPY to recognize as a NULL: copy table from wherever with null as 'something'; - Original Message - From: Dwayne Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED]

Re: [GENERAL] COPY and triggers

2001-08-18 Thread Peter Eisentraut
Oliver Elphick writes: When using the COPY command to load data into a Great Bridge PostgreSQL database, the triggers and constraints on tables are disabled. Perhaps that's a feature of Great Bridge PostgreSQL, but it's not a feature of Plain Old PostgreSQL. ;-) (It would be correct to say

Re: [GENERAL] COPY and triggers

2001-08-18 Thread Tom Lane
Oliver Elphick [EMAIL PROTECTED] writes: I've been reading Great Bridge's document on Administration and Tuning (PDF document under http://www.greatbridge.com/product/software.php) and came across this statement on page 27: When using the COPY command to load data into a Great Bridge

<    1   2   3   4   5   6   7   >