Re: [GENERAL] copy ... from stdin csv; and bytea

2008-07-28 Thread Klint Gore
David Wilson wrote: On Mon, Jul 28, 2008 at 1:24 AM, Klint Gore [EMAIL PROTECTED] wrote: Try just a single \ e.g. ge.xls,application/vnd.ms-excel,71168,\320\317\021\340\241[snip] Thanks- I did try that, and it at least gave the expected output from select, but is there a way to verify that

Re: [GENERAL] copy ... from stdin csv; and bytea

2008-07-28 Thread Tom Lane
Klint Gore [EMAIL PROTECTED] writes: David Wilson wrote: I'm not certain how to check the actual byte width of a column within a row, select length(bytea_field) from table If you want the actual on-disk footprint, use pg_column_size() regards, tom lane -- Sent via

[GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Yi Zhao
hi, all when I do the command from a sql file by psql client, I got the message: psql:/home/zhay/insert.sql:8: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. psql:/home/zhay/insert.sql:8:

Re: [GENERAL] copy ... from stdin csv; and bytea

2008-07-28 Thread Klint Gore
Tom Lane wrote: Klint Gore [EMAIL PROTECTED] writes: David Wilson wrote: I'm not certain how to check the actual byte width of a column within a row, select length(bytea_field) from table If you want the actual on-disk footprint, use pg_column_size() Size on disk would have the

Re: [GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Craig Ringer
Hi When creating a new thread (asking a new question, etc) on a mailing list please create a new message rather than replying to an existing one. It helps people reading the mailing list keep track. so, I check the pg_log ---- TRAP: FailedAssertion(!(file-curFile = 0), File:

Re: [GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Yi Zhao
I'm sorry for the lack of information given in this mail; Postgresql: 8.3.3 System:Linux 2.6.9-55.ELsmp Install: I compile it myself Others: the same command, it works fine on another machine(called A):( I EXPLAIN the sql machine A and machine B, I found that on machine B, it never use index

Re: [GENERAL] PostgreSQL vs FreeBSD 7.0 as regular user

2008-07-28 Thread Kirk Strauser
On Friday 25 July 2008, Zoltan Boszormenyi wrote: is there anyone using PostgreSQL on FreeBSD 7.0 starting from scratch? Every day. I compiled 8.3.3 and wanted to run initdb in my home directory but it fails with the error below. How did you install PostgreSQL? -- Kirk Strauser Daycos --

Re: [GENERAL] PostgreSQL vs FreeBSD 7.0 as regular user

2008-07-28 Thread Patrick TJ McPhee
In article [EMAIL PROTECTED], Greg Smith [EMAIL PROTECTED] wrote: % Looks like the PostgreSQL documentation here ( % http://www.postgresql.org/docs/current/static/kernel-resources.html ) is % now outdated. From http://www.manpages.info/freebsd/sysctl.8.html : % % The -w option has been

[GENERAL] why my postgresql auto crashed???

2008-07-28 Thread 赵 熠
hi, all when I do the command from a sql file by psql client, I got the message: psql:/home/zhay/insert.sql:8: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. psql:/home/zhay/insert.sql:8:

[GENERAL] why my postgresql auto crashed???

2008-07-28 Thread 赵 熠
hi, all when I do the command from a sql file by psql client, I got the message: psql:/home/zhay/insert.sql:8: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. psql:/home/zhay/insert.sql:8:

Re: [GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Craig Ringer
Yi Zhao wrote: I'm sorry for the lack of information given in this mail; Postgresql: 8.3.3 System:Linux 2.6.9-55.ELsmp Install: I compile it myself Others: the same command, it works fine on another machine(called A):( I EXPLAIN the sql machine A and machine B, I found that on machine

R: [GENERAL] How to get the real postgreql error from visual basic

2008-07-28 Thread Paolo Saudin
-Messaggio originale- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Per conto di dfx Inviato: domenica 27 luglio 2008 19.37 A: pgsql-general@postgresql.org Oggetto: [GENERAL] How to get the real postgreql error from visual basic Dear Sirs, when I execute a function that returns an

[GENERAL] Setting up the postgres codebase in Eclipse

2008-07-28 Thread Abhirama Mallela
Hello I have searched for help in setting up the code in the eclipse IDE. but hardly found any. If someone who is using eclipse can give a brief HOW TO, it would be really great. Thanks, Abhirama

[GENERAL] Date index not used when selecting a date range

2008-07-28 Thread Poul Møller Hansen
I'm wondering why this index is not used for my query. This is the index: CREATE INDEX idx_stat_date_node_type ON public.stat USING btree (date, node, type); When quering an exact date, it is used explain SELECT * FROM public.stat WHERE node = '1010101010' AND date = '2008-01-01' Index

[GENERAL] Connecting to an existing transaction state.

2008-07-28 Thread Alex Gen
Hello, I’m in the process of creating a set of scripts for testing certain locking features in an application. What I would like to do: 1. Start a connection from machine-01 through the m01-s1.sql script. 2.While (1) is running, start another transaction on the same database from machine-02

Re: [GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Tom Lane
Craig Ringer [EMAIL PROTECTED] writes: Yi Zhao wrote: I don't konw why. It almost certainly means that you have a corrupt index. No, because that assert is nowhere near the index code. I think it's a garden-variety bug, but we need a reproducible test case to fix it.

[GENERAL] Fetch for Update

2008-07-28 Thread Bob Pawley
I haven't been able to find much information on Fetch for Update. Does 8.3 support this command?? If so, could someone please point out my error in the following? Bob BEGIN SELECT count (p_id.pid.process_id) INTO Proccount FROM p_id.p_id WHERE process_id = new.process_id; Declare

[GENERAL] should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread aravind chandu
Hello,     I installed postgresql on my sytem,I need to parse an xml file.When I am working on xpath() it is showing an error that function is notfound and i tried almost all xml functions in postgresql but it is giving me the same result.why so ? should I have to install any xml

Re: [GENERAL] Fetch for Update

2008-07-28 Thread justin
Bob Pawley wrote: I haven't been able to find much information on Fetch for Update. Does 8.3 support this command?? If so, could someone please point out my error in the following? Bob BEGIN SELECT count (p_id.pid.process_id) INTO Proccount FROM p_id.p_id WHERE process_id =

Re: [GENERAL] should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread Joshua D. Drake
On Mon, 2008-07-28 at 09:25 -0700, aravind chandu wrote: Hello, I installed postgresql on my sytem,I need to parse an xml file.When I am working on xpath() it is showing an error that function is notfound and i tried almost all xml functions in postgresql but it is giving me the

Re: [GENERAL] Fetch for Update

2008-07-28 Thread Christophe
On Jul 28, 2008, at 9:16 AM, Bob Pawley wrote: I haven't been able to find much information on Fetch for Update. Does 8.3 support this command?? Postgres doesn't have an explicit FETCH FOR UDPATE. You can either create the cursor with SELECT FOR UPDATE, or UPDATE the row in the cursor

[GENERAL] Clone a database to other machine

2008-07-28 Thread Garg, Manjit
Hi All, I'm stuck to an issue while cloning the pgsql database, can you please help, or give any docs to help out. Query - Trying to have same database on two seprate linux servers. One will be used to upport Applications and other will be used for Report generation only. Want to keep both

[GENERAL] errors while working on xml functions in postgresql

2008-07-28 Thread aravind chandu
Hello,     I installed postgresql on my sytem,I need to parse an xml file.When I am working on xpath() it is showing an error that function is notfound and i tried almost all xml functions in postgresql but it is giving me the same result.why so ? should I have to install any xml

Re: [GENERAL] Clone a database to other machine

2008-07-28 Thread Francisco Reyes
On 12:44 pm 07/28/08 Garg, Manjit [EMAIL PROTECTED] wrote: I'm stuck to an issue while cloning the pgsql database, can you please help, or give any docs to help out. What is the issue? Query - Trying to have same database on two seprate linux servers. Have you been able to pg_dump from

Re: [GENERAL] Date index not used when selecting a date range

2008-07-28 Thread Francisco Reyes
On 9:09 am 07/28/08 Poul Møller Hansen [EMAIL PROTECTED] wrote: But when selecting a date range I get this explain SELECT * FROM public.stat WHERE node = '1010101010' AND (date = '2008-06-30'::date AND date = '2008-01-01'::date) Bitmap Heap Scan on stat (cost=710.14..179319.44 rows=39174

Re: [GENERAL] should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread Raymond O'Donnell
On 28/07/2008 17:25, aravind chandu wrote: I installed postgresql on my sytem,I need to parse an xml file.When I am working on xpath() it is showing an error that function is notfound and i tried almost all xml functions in postgresql but it is giving me the same result.why so ?

Re: [GENERAL] should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread Joshua D. Drake
On Mon, 2008-07-28 at 18:36 +0100, Raymond O'Donnell wrote: On 28/07/2008 17:25, aravind chandu wrote: I installed postgresql on my sytem,I need to parse an xml file.When I am working on xpath() it is showing an error that function is notfound and i tried almost all xml

Re: [GENERAL] errors while working on xml functions in postgresql

2008-07-28 Thread Tom Lane
aravind chandu [EMAIL PROTECTED] writes: I installed postgresql on my sytem,I need to parse an xml file.When I am working on xpath() it is showing an error that function is notfound and i tried almost all xml functions in postgresql but it is giving me the same result.why so ? Are you reading

[GENERAL] Re: should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread Stephane Bortzmeyer
On Mon, Jul 28, 2008 at 06:36:48PM +0100, Raymond O'Donnell [EMAIL PROTECTED] wrote a message of 30 lines which said: Are you in a position to see whether this was done on your installation? Side question: is there any way (SELECT * FROM pg_compilation_options?) to retrieve this information

[GENERAL] Re: should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread Stephane Bortzmeyer
On Mon, Jul 28, 2008 at 06:47:43PM +0100, Stephane Bortzmeyer [EMAIL PROTECTED] wrote a message of 19 lines which said: Side question: is there any way (SELECT * FROM pg_compilation_options?) to retrieve this information from an already installed PostgreSQL? I scanned the documentation for

Re: [GENERAL] Getting data from Xml to Postgresql database

2008-07-28 Thread Gwyneth Morrison
aravind chandu wrote: Hi, I have some data in XML format and i need to upload in postgresql database using stored procedure. Can someone tell me the step by step procedure of the same as i will be doing it for the first time. Thank You, Avin. I have offered a python

Re: [GENERAL] Re: should i need to install xml library in postgresql inorder to work on xml file?

2008-07-28 Thread Andrew Sullivan
On Mon, Jul 28, 2008 at 06:47:43PM +0100, Stephane Bortzmeyer wrote: Side question: is there any way (SELECT * FROM pg_compilation_options?) to retrieve this information from an already installed PostgreSQL? I scanned the documentation for more than five pg_config. I think it may be in a

[GENERAL] array_accum() and quoted content

2008-07-28 Thread Raymond C. Rodgers
Some time ago, I found the aggregate function array_accum() listed on the PostgreSQL web site on a page similar to http://www.postgresql.org/docs/8.2/static/xaggr.html , and implemented it in a database that hasn't seen much use. More recently, for a client, I again used the function but I'm

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread Tom Lane
Raymond C. Rodgers [EMAIL PROTECTED] writes: The only difference I can see is that the quotes don't appear when the values returned don't contain white space, and do when white space is present. That is per the definition of array output format:

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread Raymond C. Rodgers
Tom Lane wrote: Raymond C. Rodgers [EMAIL PROTECTED] writes: The only difference I can see is that the quotes don't appear when the values returned don't contain white space, and do when white space is present. That is per the definition of array output format:

[GENERAL] How to give input a file for a stored procedure

2008-07-28 Thread aravind chandu
Hi, I am writing a stored procedure where the input to it is a file.I did not have any idea of how to give input as a file for a stored procedure.could you please help me. Thank You, Avin.

[GENERAL] Must be table owner to truncate?

2008-07-28 Thread smiley2211
Hello all, I am trying to GRANT truncate permissions to a non-owner of table and it's not allowing me to: GRANT TRUNCATE ON stage01 TO jaime44; ERROR: unrecognized privilege type truncate How do I grant said permission? Thanks...Michelle. -- View this message in context:

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread Alvaro Herrera
Raymond C. Rodgers escribió: Drat, thanks. Other than array_accum() I've never used arrays in PostgreSQL, so I wasn't aware of that behavior. Why do you want to use array_accum() in the first place? Maybe there are better ways to do what you are using it for, that do not subject you to the

Re: [GENERAL] Must be table owner to truncate?

2008-07-28 Thread Tom Lane
smiley2211 [EMAIL PROTECTED] writes: GRANT TRUNCATE ON stage01 TO jaime44; ERROR: unrecognized privilege type truncate There is no such permission; where did you get the idea there was? regards, tom lane -- Sent via pgsql-general mailing list

Re: [GENERAL] Must be table owner to truncate?

2008-07-28 Thread Said Ramirez
According to the documentation, http://www.postgresql.org/docs/current/interactive/sql-truncate.html , only the owner can truncate a table. Which means the non-owner must either log in/ switch roles as the owner, or they can just run a DELETE. -Said smiley2211 wrote: Hello all, I am

[GENERAL] oscon booth report!

2008-07-28 Thread gabrielle
The Pg booth at OSCON this year was a success. We had quite a few volunteers for booth duty! We talked to a *lot* of people, sold some shirts, and Michael B taught us to make balloon animals. More details will be posted to -advocacy. Many, many thanks to everyone who helped make the Pg booth a

Re: [GENERAL] Must be table owner to truncate?

2008-07-28 Thread smiley2211
Unfortunately, I found the command via google...I later checked the documentation... http://www.postgresql.org/docs/8.1/static/sql-truncate.html Thanks...Michelle Tom Lane-2 wrote: smiley2211 [EMAIL PROTECTED] writes: GRANT TRUNCATE ON stage01 TO jaime44; ERROR: unrecognized privilege

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread Raymond C. Rodgers
Alvaro Herrera wrote: Raymond C. Rodgers escribió: Drat, thanks. Other than array_accum() I've never used arrays in PostgreSQL, so I wasn't aware of that behavior. Why do you want to use array_accum() in the first place? Maybe there are better ways to do what you are using it for,

[GENERAL] Creating a comprehensive search that queries multiple tables

2008-07-28 Thread Ryan Wallace
Hi all, I am attempting to build an application which returns a list of items where some piece of information associated with the item matches the entered text. My database is set up in the following way: CREATE TABLE public.items( id int4 NOT NULL DEFAULT

Re: [GENERAL] Clone a database to other machine

2008-07-28 Thread Francisco Reyes
On 1:32 pm 07/28/08 Garg, Manjit [EMAIL PROTECTED] wrote: But, actually I want to keep both the Databse in Sync. I want clone db to get the data from Master in certain intervals. Sounds like you are looking for replication. Check

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread Alvaro Herrera
Raymond C. Rodgers escribió: The query in which I'm using array_accum() is building a list of companies and the associated publishers for each. For example: SELECT c.company_id, c.company_name, array_accum(p.publisher_name) AS publishers FROM company_table c LEFT JOIN

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread Raymond C. Rodgers
Alvaro Herrera wrote: Raymond C. Rodgers escribió: The query in which I'm using array_accum() is building a list of companies and the associated publishers for each. For example: SELECT c.company_id, c.company_name, array_accum(p.publisher_name) AS publishers FROM company_table c LEFT

Re: [GENERAL] array_accum() and quoted content

2008-07-28 Thread David Fetter
On Mon, Jul 28, 2008 at 04:11:26PM -0400, Raymond C. Rodgers wrote: Alvaro Herrera wrote: Raymond C. Rodgers escribió: Drat, thanks. Other than array_accum() I've never used arrays in PostgreSQL, so I wasn't aware of that behavior. Why do you want to use array_accum() in the

Re: [GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Yi Zhao
yes, I thinks it is unrelated with index, beacause the problem is still exist after reindex. I try to change the work memory or shared memory, it's no use:( regards, Yi On Mon, 2008-07-28 at 11:10 -0400, Tom Lane wrote: Craig Ringer [EMAIL PROTECTED] writes: Yi Zhao wrote: I don't konw

Re: [GENERAL] why my postgresql auto crashed???

2008-07-28 Thread Alvaro Herrera
Yi Zhao wrote: yes, I thinks it is unrelated with index, beacause the problem is still exist after reindex. I try to change the work memory or shared memory, it's no use:( Of course not. Please post the schema of involved tables, and enough data in them to be able to reproduce the problem.

[GENERAL] why can't I load pgxml.sql

2008-07-28 Thread Yi Zhao
1. ./configure --with-libxml --with-libxslt 2. makemake install (successful) 3. test=# \i /usr/local/pgsql/share/contrib/pgxml.sql error appearance: SET psql:/usr/local/pgsql/share/contrib/pgxml.sql:10: ERROR: could not load library /usr/local/pgsql/lib/pgxml.so: /usr/lib/libxml2.so.2: undefined

[GENERAL] a SQL query question

2008-07-28 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a table of the form aid pid nmol - --- --- 123 34 245 3445 323 100 478 12 545 14 645 200 7null null In general, aid is unique, pid and nmol are non-unique. What I'm trying to do is to

Re: [GENERAL] why can't I load pgxml.sql

2008-07-28 Thread Tom Lane
Yi Zhao [EMAIL PROTECTED] writes: 1. ./configure --with-libxml --with-libxslt 2. makemake install (successful) 3. test=# \i /usr/local/pgsql/share/contrib/pgxml.sql error appearance: SET psql:/usr/local/pgsql/share/contrib/pgxml.sql:10: ERROR: could not load library

Re: [GENERAL] a SQL query question

2008-07-28 Thread Klint Gore
Rajarshi Guha wrote: What I'm trying to do is to select those rows where pid is not null, grouped by pid. From within each group I'd like to select the row that has the maximum value of nmol. Distinct on should do the job for you. select distinct on (pid) aid, pid, nmol from

Re: [GENERAL] a SQL query question

2008-07-28 Thread brian
Rajarshi Guha wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a table of the form aid pid nmol - --- --- 123 34 245 3445 323 100 478 12 545 14 645 200 7null null In general, aid is unique, pid and nmol are non-unique. What I'm

Re: [GENERAL] why can't I load pgxml.sql

2008-07-28 Thread Yi Zhao
my version is 8.3.3: I found that it's part of the server. is it said that I should build postgresql with libxml again?? On Mon, 2008-07-28 at 23:00 -0400, Tom Lane wrote: Yi Zhao [EMAIL PROTECTED] writes: 1. ./configure --with-libxml --with-libxslt 2. makemake install (successful) 3.

Re: [GENERAL] a SQL query question

2008-07-28 Thread Adam Rich
Hi, I have a table of the form aid pid nmol - --- --- 123 34 245 3445 323 100 478 12 545 14 645 200 7null null In general, aid is unique, pid and nmol are non-unique. What I'm trying to do is to select those rows where pid is not

Re: [GENERAL] a SQL query question

2008-07-28 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jul 28, 2008, at 10:18 PM, Rajarshi Guha wrote: aid pid nmol - --- --- 323 100 245 3445 478 12 I can easily do the first step, but am struggling to make the SQL for the second step. Any pointers would be appreciated

Re: [GENERAL] why can't I load pgxml.sql

2008-07-28 Thread Tom Lane
Yi Zhao [EMAIL PROTECTED] writes: my version is 8.3.3: I kinda doubt that, actually, because you should not have been getting function not found errors in 8.3. An 8.3 server built without XML support should react more like this: regression=# select xpath('foo','bar'); ERROR: unsupported XML

Re: [GENERAL] Clone a database to other machine

2008-07-28 Thread Lennin Caro
you can use slony-i http://slony.info/ --- On Mon, 7/28/08, Garg, Manjit [EMAIL PROTECTED] wrote: From: Garg, Manjit [EMAIL PROTECTED] Subject: [GENERAL] Clone a database to other machine To: pgsql-general@postgresql.org Date: Monday, July 28, 2008, 4:44 PM Hi All, I'm stuck to an

Re: [GENERAL] why can't I load pgxml.sql

2008-07-28 Thread Klint Gore
Yi Zhao wrote: my version is 8.3.3: I found that it's part of the server. is it said that I should build postgresql with libxml again?? googling gzopen64 throws up a whole lot of hits - most of them were debian/ubuntu and boiled down to some problem with versions of libz.so klint. --