Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Brent Wood
Can you show the output of \d geo_data ? Try 'using' delimiters Are you doing this as the postgres superuser? Because COPY can't load from files as a casual user, you need to pipe it to copy & read from stdin. Simple script below works for me, modified copy statement might help?. HTH, Bren

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
Thanks Tom that did it :) James: I'll add those books to my list I appreciate everyone's help! On Fri, Jul 15, 2011 at 2:16 PM, Tom Lane wrote: > Bryan Nelson writes: >> Tom, rake is a rails command, also after doing a \d geo_data it does >> show that it's adding an id column before everythin

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread James B. Byrne
On: Fri, 15 Jul 2011 13:57:03 -0400, Bryan Nelson > Tom, rake is a rails command, also after doing a \d geo_data > it does show that it's adding an id column before everything > else. I'm guessing my best bet is going to be creating the table > by hand as I have no idea how to tell it not to crea

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Scott Ribe
On Jul 15, 2011, at 12:06 PM, Bryan Nelson wrote: > Hi Scott, do you know if it's possible to force it not to create the > extra field? If you do that, you are going to have to figure out how to get Rails to work with that table--which is probably far beyond the Rails help you're going to get o

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Tom Lane
Bryan Nelson writes: > Tom, rake is a rails command, also after doing a \d geo_data it does > show that it's adding an id column before everything else. I'm > guessing my best bet is going to be creating the table by hand as I > have no idea how to tell it not to create the extra field. No need t

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Adrian Klaver
On Friday, July 15, 2011 10:33:34 am Bryan Nelson wrote: > Tom, the file was created in linunx and is utf-8. Here is the rake > task that created the table: > > class CreateGeoData < ActiveRecord::Migration ActiveRecord will add an auto-incrementing id column to the table. You will need to loo

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
Tom, rake is a rails command, also after doing a \d geo_data it does show that it's adding an id column before everything else. I'm guessing my best bet is going to be creating the table by hand as I have no idea how to tell it not to create the extra field. Thanks for the help everyone, figured i

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Scott Ribe
On Jul 15, 2011, at 11:44 AM, Tom Lane wrote: > Never heard of rake before, but I'm betting that it's doing stuff > behind your back, like including an "id" column in the table definition. > Try looking at the table in psql (\d geo_data), or enabling query > logging on the server so you can see wh

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Steve Crawford
On 07/15/2011 10:42 AM, Steve Crawford wrote: . Error Message - ERROR: invalid input syntax for integer: "96799" CONTEXT: COPY geo_data, line 1, column id: "96799" If you have given us a correct table layout, there is no column 96799 ... Oops, meant column "id". Cheers, Steve -

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Tom Lane
Bryan Nelson writes: > Tom, the file was created in linunx and is utf-8. Here is the rake > task that created the table: > class CreateGeoData < ActiveRecord::Migration > def self.up > create_table :geo_data do |t| > t.column :zip_code, :text > t.column :latitude, :float8 >

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Steve Crawford
On 07/15/2011 09:03 AM, Bryan Nelson wrote: I am having problems importing a CSV file of sample data for testing in a web app. Do you mean that you are importing the data using something like psql to use in a web app or that you are testing a web-app that does the import? Columns& Types --

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
Tom, the file was created in linunx and is utf-8. Here is the rake task that created the table: class CreateGeoData < ActiveRecord::Migration def self.up create_table :geo_data do |t| t.column :zip_code, :text t.column :latitude, :float8 t.column :longitude, :float8

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
Rick, thanks for the tip. I tried that but it's giving me the same error. On Fri, Jul 15, 2011 at 1:19 PM, Rick Genter wrote: > I think the COPY is expecting the first line of the file to be a header and > it doesn't find a column named "96799" in the table. Try putting a line at > the top of th

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Rick Genter
I think the COPY is expecting the first line of the file to be a header and it doesn't find a column named "96799" in the table. Try putting a line at the top of the file that looks like this: zip_code,latitude,longitude,city,state,county On Fri, Jul 15, 2011 at 10:10 AM, Susan Cassidy wrote: >

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Tom Lane
Bryan Nelson writes: > I am having problems importing a CSV file of sample data for testing > in a web app. > Columns & Types > --- > zip_code - text > lattitude - float8 > longitude - float8 > city - text > state - text > county - text > Some Sample Data From CSV File >

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Susan Cassidy
There seems to be no reason it should be looking for an integer, if your table definition as shown is correct. You don't have any integers listed. Also, why does it think that the column id is 96799? Stupid question, but are you logged into the right database? Maybe a different db has a diffe

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
Hi Susan, I have tried importing the file both with and without "'s around each field. But for some reason it still always chokes on the first one. On Fri, Jul 15, 2011 at 12:30 PM, Susan Cassidy wrote: > The default quote character is ", so I believe it is expecting quotes to be > around text f

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
Hi Adrian, yes that is the entire table definition. On Fri, Jul 15, 2011 at 12:30 PM, Adrian Klaver wrote: > On 07/15/2011 09:03 AM, Bryan Nelson wrote: >> >> I am having problems importing a CSV file of sample data for testing >> in a web app. >> >> Columns&  Types >> --- >> zip_

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Susan Cassidy
The default quote character is ", so I believe it is expecting quotes to be around text fields. That is the norm for CSV files. Susan -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Bryan Nelson Sent: Friday, July 15,

Re: [GENERAL] Error Importing CSV File

2011-07-15 Thread Adrian Klaver
On 07/15/2011 09:03 AM, Bryan Nelson wrote: I am having problems importing a CSV file of sample data for testing in a web app. Columns& Types --- zip_code - text lattitude - float8 longitude - float8 city - text state - text county - text Is this the complete table description

[GENERAL] Error Importing CSV File

2011-07-15 Thread Bryan Nelson
I am having problems importing a CSV file of sample data for testing in a web app. Columns & Types --- zip_code - text lattitude - float8 longitude - float8 city - text state - text county - text Some Sample Data From CSV File -- 96799,-7.209975,-170.77

Re: [GENERAL] C function returns null values

2011-07-15 Thread Tom Lane
Gregor Trefs writes: > I developed a C function which returns a record. The record contains 3 scalar > values and 2 arrays. Randomly some record elements are null and I wonder why. > I could trace down the problem to the point where the return record is > created. Until this point everything is

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Tony Wang
On Fri, Jul 15, 2011 at 18:44, Scott Marlowe wrote: > On Fri, Jul 15, 2011 at 4:36 AM, Tony Wang wrote: > > Weird that I receive your each message twice. > > On Fri, Jul 15, 2011 at 15:33, Radoslaw Smogura < > rsmog...@softperience.eu> > > wrote: > >> > >> Simple and obvious question right now do

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Tony Wang
On Fri, Jul 15, 2011 at 19:47, Radosław Smogura wrote: > On Fri, 15 Jul 2011 19:07:45 +0800, Tony Wang wrote: > >> On Fri, Jul 15, 2011 at 18:50, Radosław Smogura wrote: >> >> On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: >>> >>> Weird that I receive your each message twice. On

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Adrian Klaver
On Friday, July 15, 2011 3:52:13 am Radosław Smogura wrote: > On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: > > Weird that I receive your each message twice. > > Once message You get from mailing list, one because You are (B)CC. If it is continues to be a problem go to : http://www.post

Re: [GENERAL] COPY command documentation

2011-07-15 Thread Fabio Milillo
Hi Oisin, I am right in the condition you described, but nowadays the 8.0 documentation is only available without comments. I tried the way suggested by Richard Sydney-Smith (*eliminating the spaces in the path*), but unsuccessfully. Could you please help me? thanks, Fabio *hint from Richard Sydne

Re: [GENERAL] Concurrent read from a partition table.

2011-07-15 Thread Chetan Suttraway
On Tue, Jul 12, 2011 at 11:46 PM, hyelluas wrote: > Hi Chetan, > > I'm not sure how I can create a test case, I'm running queryes on 50g of > data to see this. > > My general questions are about locking children when select from a parent, > I > have not seen any documentation on it. Does any para

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Radosław Smogura
On Fri, 15 Jul 2011 19:07:45 +0800, Tony Wang wrote: On Fri, Jul 15, 2011 at 18:50, Radosław Smogura wrote: On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: Weird that I receive your each message twice. On Fri, Jul 15, 2011 at 15:33, Radoslaw Smogura  wrote: Simple and obvious questio

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Scott Marlowe
On Fri, Jul 15, 2011 at 5:08 AM, Tony Wang wrote: > On Fri, Jul 15, 2011 at 18:52, Radosław Smogura > wrote: >> >> On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: >>> >>> Weird that I receive your each message twice. >> >> Once message You get from mailing list, one because You are (B)CC. >

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Tony Wang
On Fri, Jul 15, 2011 at 18:52, Radosław Smogura wrote: > On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: > >> Weird that I receive your each message twice. >> > Once message You get from mailing list, one because You are (B)CC. > gmail should be clever enough handling that, at lease I didn't

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Tony Wang
On Fri, Jul 15, 2011 at 18:50, Radosław Smogura wrote: > On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: > >> Weird that I receive your each message twice. >> >> On Fri, Jul 15, 2011 at 15:33, Radoslaw Smogura wrote: >> >> >> Simple and obvious question right now do You call commit after >>

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Radosław Smogura
On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: Weird that I receive your each message twice. Once message You get from mailing list, one because You are (B)CC. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Radosław Smogura
On Fri, 15 Jul 2011 18:36:19 +0800, Tony Wang wrote: Weird that I receive your each message twice. On Fri, Jul 15, 2011 at 15:33, Radoslaw Smogura wrote: Simple and obvious question right now do You call commit after transaction? If yes do you use any query or connection pooler? Yes. connec

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Scott Marlowe
On Fri, Jul 15, 2011 at 4:36 AM, Tony Wang wrote: > Weird that I receive your each message twice. > On Fri, Jul 15, 2011 at 15:33, Radoslaw Smogura > wrote: >> >> Simple and obvious question right now do You call commit after >> transaction? If yes do you use any query or connection pooler? > > Y

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Tony Wang
Weird that I receive your each message twice. On Fri, Jul 15, 2011 at 15:33, Radoslaw Smogura wrote: > Simple and obvious question right now do You call commit after > transaction? If yes do you use any query or connection pooler? > Yes. connection pool is used as application level, not db leve

Re: [GENERAL] About permissions on large objects

2011-07-15 Thread Giuseppe Sacco
Hi Howard, Il giorno mer, 13/07/2011 alle 23.30 +0100, Howard Cole ha scritto: > Hi Guiseppe, > > Perhaps you can create a trigger that monitors for the insertion of an > oid and then grant permissions. No idea if this can be done, but if it > can it will save you lots of repeated grants. [...]

[GENERAL] C function returns null values

2011-07-15 Thread Gregor Trefs
Hello all, I developed a C function which returns a record. The record contains 3 scalar values and 2 arrays. Randomly some record elements are null and I wonder why. I could trace down the problem to the point where the return record is created. Until this point everything is computed correctl

Re: [GENERAL] Weird problem that enormous locks

2011-07-15 Thread Radoslaw Smogura
Simple and obvious question right now do You call commit after transaction? If yes do you use any query or connection pooler? Regards, Radoslaw Smogura (mobile) -Original Message- From: Tony Wang Sent: 15 lipca 2011 03:51 To: Scott Marlowe Cc: PostgreSQL Subject: