[GENERAL] Function Problems

2007-11-19 Thread Francis Waweru
Am creating a function that will be able to sort date from a table that is over 400,000 rows. I want to pass variables from a java application am running but I can't able to do so. Please help on how to pass a variable from an application to a function so that I can speed up my select queries.

Re: [GENERAL] Function Problems

2007-11-19 Thread Richard Huxton
Francis Waweru wrote: Am creating a function that will be able to sort date from a table that is over 400,000 rows. I want to pass variables from a java application am running but I can't able to do so. Please help on how to pass a variable from an application to a function so that I can speed

[GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Bebarta, Simanchala
Hi, Need immediate attention to my concern. While starting the postgreSQL service, i get the error message as Could not open process token error code-5 Appreciate if any one can help me out on this issue. Thanks Regards, Sima

Re: [GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Richard Huxton
Bebarta, Simanchala wrote: Need immediate attention to my concern. OK. While starting the postgreSQL service, i get the error message as Could not open process token error code-5 What version of PostgreSQL? What operating-system? Have you had any problems before this point? -- Richard

Re: [ADMIN] [GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Richard Huxton
Don't forget to cc: the list, other people will probably know more than me. Bebarta, Simanchala wrote: Hi, My postgreSQL 8.2.4 is installed on Windows server 2003 Enterprise Edition. OK. Thanks. 8.2.5 has been released, and you should consider upgrading soon. The Windows-related changes

Re: [ADMIN] [GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Bebarta, Simanchala
Yes, when I set the value to 1300 MB, everything goes fine. Any value higher than this value does not allow me to start the service. sima -Original Message- From: Richard Huxton [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 3:40 PM To: Bebarta, Simanchala Cc: PG-General

Re: [ADMIN] [GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Richard Huxton
Bebarta, Simanchala wrote: Does the problem go away when you put shared_buffers back to a lower number? Yes, when I set the value to 1300 MB, everything goes fine. Any value higher than this value does not allow me to start the service. It's quite possible that you can't go any higher (I

[GENERAL] Postgre and XML

2007-11-19 Thread x asasaxax
Hi, I´m interested in running xml with postgre. I use postgre version 8.2 and windows xp. I would like to know how can i enable the xml in the postgresql. Did you know if its secure to use this xml function of postgre in commercial applications? How much trustable its this module? Can

Re: [GENERAL] Composite types for composite primary/foreign keys?

2007-11-19 Thread Wolfgang Keller
Hello, and thanks for your reply. I'm sorry, but I'm apparently too dump to actually figure out myself whether this means that I can use a single composite type column as a primary / foreign key or whether not...? What have you actually tried? I wanted to simplify the schema and make it

Re: [GENERAL] Postgre and XML

2007-11-19 Thread Peter Eisentraut
Am Montag, 19. November 2007 schrieb x asasaxax: I´m interested in running xml with postgre. I use postgre version 8.2 and windows xp. I would like to know how can i enable the xml in the postgresql. That depends on what you want to do with it. XML is quite a broad topic. -- Peter

Re: [GENERAL] Composite types for composite primary/foreign keys?

2007-11-19 Thread Michael Glaesemann
On Nov 19, 2007, at 6:17 , Wolfgang Keller wrote: I wanted to simplify the schema and make it more readable for clueless morons like me. ;- Simplifying the schema is fine (and good!) as long as it exhibits the same behavior as the more complex one: often in the course of simplifying you

Re: [GENERAL] Calculation for Max_FSM_pages : Any rules of thumb?

2007-11-19 Thread Bill Moran
In response to Ow Mun Heng [EMAIL PROTECTED]: Even with the regular vacuuming and even a vacuum full ( on my test DB) I still see that perhaps something is wrong (from the below) (I got this gem from the mailling list archives) hmxmms= SELECT c.relname, c.reltuples::bigint as

[GENERAL] IP addresses

2007-11-19 Thread Tom Allison
I am planning on doing a LOT of work with ip addresses and thought that the inet data type would be a great place to start. But I'm not sure how this works in with accessing the addresses. In perl or ruby how is the value returned? Or should I stricly use host() and other functions to be

Re: [GENERAL] tsearch2 best practices

2007-11-19 Thread Ian Barwick
2007/11/18, Mag Gam [EMAIL PROTECTED]: Hi All, Planning to implement tsearch2 for my websitem and dbschema. I wanted to know if there is a Best practices guide I should be following. While reading about it, I noticed there were lot of 'gotchas' with this, such as back-up/restore, Slony 1

[GENERAL] convert custom datatype to array

2007-11-19 Thread Mike Charnoky
Our database schema was designed before postgresql supported arrays and contains a custom type which is basically a float4 array. I would like to clean things up and convert the custom datatype to float4[], as this would obviate the need for us to compile a custom shared object. We are hitting

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-19 Thread Michelle Konzack
Am 2007-11-07 10:03:24, schrieb Gauthier, Dave: Is there such a thing as a temporary, probably in-memory, version of a Postgres DB? Sort of like SQLite, only with the features/function of PG? A DB like this would exist inside of, and for the duration of, a script/program that created it,

[GENERAL] postgresql storage and performance questions

2007-11-19 Thread Josh Harrison
Hi, I have a few questions about the storage and performance 1. How do you estimate the table size in postgresql? For example if I have a table 'Dummy' with 1 varchar (40) 1 numeric(22,0) fields and 1000 rows, what is the tablesize estimate for this (including the row overhead etc)? How many

Re: [GENERAL] convert custom datatype to array

2007-11-19 Thread Alvaro Herrera
Mike Charnoky wrote: Our database schema was designed before postgresql supported arrays and contains a custom type which is basically a float4 array. I would like to clean things up and convert the custom datatype to float4[], as this would obviate the need for us to compile a custom shared

Re: [GENERAL] possible to create multivalued index from xpath() results in 8.3?

2007-11-19 Thread Tom Lane
Matt Magoffin [EMAIL PROTECTED] writes: 2) Even if I could have an xpath() result return an array with multiple values, like {value1,value2,value3} I wasn't able to define a GIN index against the xml[] type. Should this be possible? Dunno about your other questions, but the answer to this one

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-19 Thread Gauthier, Dave
Sounds like a lot of work. I don't want to do anything risky. And they probably won't give me a ramdisk anyway. Being able to run a small but full featured, purely in-memory DB (sort of like SQLite) would probably fit a niche that Postgres competitors don't address. So I guess this is just a

Re: [GENERAL] convert custom datatype to array

2007-11-19 Thread Mike Charnoky
OK, forgive my ignorance here, but the maintainer of our custom data type code is no longer with us and this is new territory for me. We do have a function which takes our custom data type and returns a cstring. Is there a pg function which converts a cstring to text type? This seems to be the

Re: [GENERAL] convert access sql to postgresql

2007-11-19 Thread Tom Hart
Shane Ambler wrote: Tom Hart wrote: Hey guys. I have a long piece of sql that I'm trying to take out of an existing Access db and modify to work with Postgresql. I've started trying to convert it, but I've come across a problem that I don't even know how to describe, let alone google. Here's

Re: [GENERAL] convert custom datatype to array

2007-11-19 Thread Alvaro Herrera
Mike Charnoky wrote: OK, forgive my ignorance here, but the maintainer of our custom data type code is no longer with us and this is new territory for me. We do have a function which takes our custom data type and returns a cstring. Is there a pg function which converts a cstring to text

[GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Dragan Matic
I have just found out that when comparing timestamp with time value where time value is represented in 24h format + AM/PM sign doesn't work always. for instance, the following query works in this format: select * from table where timestamp_column '11/19/2007 3:46:09 PM' and also in this

[GENERAL]

2007-11-19 Thread Josh Harrison
---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL]

2007-11-19 Thread Tom Hart
Reply from 127.0.0.1: bytes=32 time=51ms TTL=241 Josh Harrison wrote: ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/ ---(end of

[GENERAL] postgresql performance and storage questions

2007-11-19 Thread Josh Harrison
Hi, I have a few questions about the storage and performance 1. How do you estimate the table size in postgresql? For example if I have a table 'Dummy' with 1 varchar (3) 1 numeric(8,0) fields and 1000 rows, what is the tablesize estimate for this (including the row overhead etc)? How many pages

Re: [GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Andreas Kretschmer
Dragan Matic [EMAIL PROTECTED] schrieb: I have just found out that when comparing timestamp with time value where time value is represented in 24h format + AM/PM sign doesn't work always. for instance, the following query works in this format: select * from table where timestamp_column

Re: [GENERAL] IP addresses

2007-11-19 Thread Ian Barwick
2007/11/19, Tom Allison [EMAIL PROTECTED]: I am planning on doing a LOT of work with ip addresses and thought that the inet data type would be a great place to start. But I'm not sure how this works in with accessing the addresses. In perl or ruby how is the value returned? In Perl the

Re: [GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Sam Mason
On Mon, Nov 19, 2007 at 04:52:10PM +0100, Dragan Matic wrote: select * from table where timestamp_column '11/19/2007 15:46:09 PM' Maybe the to_timestamp() function would help you: SELECT to_timestamp('11/19/2007 15:46:09 PM','MM/DD/ HH24:MI:SS') - 2007-11-19 15:46:09+00 That just

[GENERAL] Postgresql storage question

2007-11-19 Thread Josh Harrison
Hi, I have a few questions about the storage and performance 1. How do you estimate the table size in postgresql? For example if I have a table 'Dummy' with 1 varchar (40) 1 numeric(22,0) fields and 1000 rows, what is the tablesize estimate for this (including the row overhead etc)? How many

Re: [GENERAL] convert custom datatype to array

2007-11-19 Thread Mike Charnoky
Thanks! That did the trick. For posterity, I was able to do the final conversion using: alter table mytable alter column mycolumn type float4[] using string_to_array(trim(both '[]' from textin(nbf4a_out(mycolumn))),',')::float4[]; Mike Alvaro Herrera wrote: Mike Charnoky wrote: OK, forgive

Re: [GENERAL] Substitute column in SELECT with static value? (Crosstab problem?)

2007-11-19 Thread Scott Marlowe
On Nov 19, 2007 1:34 AM, Stefan Schwarzer [EMAIL PROTECTED] wrote: Hi there, I run an aggregation on national statistics to retrieve regional values (for Africa, Europe, ...). Now, I want to have a global aggregation as well. The easiest thing for my PHP/HTML procedure would be to

Re: [ADMIN] [GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Scott Marlowe
On Nov 19, 2007 4:15 AM, Bebarta, Simanchala [EMAIL PROTECTED] wrote: Yes, when I set the value to 1300 MB, everything goes fine. Any value higher than this value does not allow me to start the service. Please don't top post. Anyway, are you sure that increasing shared_buffers that high is

Re: [GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Dragan Matic
Sam Mason wrote: On Mon, Nov 19, 2007 at 04:52:10PM +0100, Dragan Matic wrote: select * from table where timestamp_column '11/19/2007 15:46:09 PM' Maybe the to_timestamp() function would help you: SELECT to_timestamp('11/19/2007 15:46:09 PM','MM/DD/ HH24:MI:SS') -

Re: [GENERAL] Compressed Backup too big

2007-11-19 Thread Magnus Hagander
On Thu, 2007-11-15 at 20:35 +0200, Andrus wrote: PostgreSQL 8.2.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) Database size in disk returned by pg_database_size() is 210 MB Database compressesed backup file size is now 125 MB. This seems too much. I expect

Re: [GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Sam Mason
On Mon, Nov 19, 2007 at 06:03:36PM +0100, Dragan Matic wrote: Sam Mason wrote: On Mon, Nov 19, 2007 at 04:52:10PM +0100, Dragan Matic wrote: select * from table where timestamp_column '11/19/2007 15:46:09 PM' Maybe the to_timestamp() function would help you: SELECT

Re: [GENERAL] Timestamp comparison with string in some special cases

2007-11-19 Thread Tom Lane
Dragan Matic [EMAIL PROTECTED] writes: And isn't this: SELECT * from table where timestamp_column to_timestamp('11/19/2007 15:46:09 PM','MM/DD/ HH24:MI:SS') just doing the same thing that implicit string to timestamp conversion should have done in the first case? No. The entire

Re: [ADMIN] [GENERAL] Error while starting postgreSQL service

2007-11-19 Thread Magnus Hagander
On Mon, 2007-11-19 at 10:33 +, Richard Huxton wrote: Bebarta, Simanchala wrote: Does the problem go away when you put shared_buffers back to a lower number? Yes, when I set the value to 1300 MB, everything goes fine. Any value higher than this value does not allow me to start

[GENERAL] Postgres file structure doubt

2007-11-19 Thread mailtolouis2020-postgres
Hi everyone, Got a doubt in my setup, please correct me if I'm wrong. In my postgres setup, /usr/local/pgsql (where postgres install) /usr/local/pgsql/data (PGDATA) /database/pg/mydata (tablespace which use for all the table I create) /database/pg/myindex (index which use for all the table I

Re: [GENERAL] Postgres file structure doubt

2007-11-19 Thread Scott Marlowe
On Nov 19, 2007 11:24 AM, [EMAIL PROTECTED] wrote: Hi everyone, Got a doubt in my setup, please correct me if I'm wrong. In my postgres setup, /usr/local/pgsql (where postgres install) /usr/local/pgsql/data (PGDATA) /database/pg/mydata (tablespace which use for all the table I create)

Re: [GENERAL] Postgre and XML

2007-11-19 Thread Bruce Momjian
Peter Eisentraut wrote: Am Montag, 19. November 2007 schrieb x asasaxax: I?m interested in running xml with postgre. I use postgre version 8.2 and windows xp. I would like to know how can i enable the xml in the postgresql. That depends on what you want to do with it. XML is quite a

Re: [GENERAL] IP addresses

2007-11-19 Thread Harald Fuchs
In article [EMAIL PROTECTED], Tom Allison [EMAIL PROTECTED] writes: I am planning on doing a LOT of work with ip addresses and thought that the inet data type would be a great place to start. Forget inet. Check out http://pgfoundry.org/projects/ip4r/ and be happy.

Re: [GENERAL] Temporary, In-memory Postgres DB?

2007-11-19 Thread Guy Rouillier
Michelle Konzack wrote: I run an Opteron 140 with 8 GByte of memory and sometimes I have problems with too less memory... but unfortunatly I have not found a Singel-Opteron Mainboard which support more then 8 GByte of memory where I prefere to use 16-32 GByte... Tyan makes a server

[GENERAL] plpython and error catching

2007-11-19 Thread Sean Davis
What is the expected behavior of a construct like this: def insert_xml(elem): id=int(elem.findtext('PMID')) try: plpy.execute(plan,[unicode(ET.tostring(elem)),id]) except: plpy.execute(plan2,[unicode(ET.tostring(elem)),id]) id is a primary key on the table into which

Re: [GENERAL] postgresql storage and performance questions

2007-11-19 Thread Filip Rembiałkowski
2007/11/19, Josh Harrison [EMAIL PROTECTED]: Hi, I have a few questions about the storage and performance 1. How do you estimate the table size in postgresql? For example if I have a table 'Dummy' with 1 varchar (40) 1 numeric(22,0) fields and 1000 rows, what is the tablesize estimate for

Re: [GENERAL] postgresql storage and performance questions

2007-11-19 Thread Josh Harrison
Thanks Filip. I have 2 tables with 2 cols each( 1 numeric(8,0) and 1 varchar(3) ). In table1 both the cols are filled and in table2 the varchar colm is null So when I checked the tablesize for these two tables (using pg_relation_size) table1 - 57344 bytes (no null columns) table2 - 49152 bytes

Re: [GENERAL] possible to create multivalued index from xpath() results in 8.3?

2007-11-19 Thread Matt Magoffin
Matt Magoffin [EMAIL PROTECTED] writes: 2) Even if I could have an xpath() result return an array with multiple values, like {value1,value2,value3} I wasn't able to define a GIN index against the xml[] type. Should this be possible? Dunno about your other questions, but the answer to this

[GENERAL] Foreign keys and inheritance

2007-11-19 Thread Kynn Jones
I have two classes of objects, A and B, where B is just a special case of A. (I.e., to describe a B-type object I need to specify the same fields as for an A-type object, plus a whole bunch additional fields specific to B alone.) Furthermore, there's a third class T that is in a many-to-one

Re: [GENERAL] Foreign keys and inheritance

2007-11-19 Thread Jeff Davis
On Mon, 2007-11-19 at 14:36 -0500, Kynn Jones wrote: I have two classes of objects, A and B, where B is just a special case of A. (I.e., to describe a B-type object I need to specify the same fields as for an A-type object, plus a whole bunch additional fields specific to B alone.)

Re: [GENERAL] Foreign keys and inheritance

2007-11-19 Thread brian
Kynn Jones wrote: I have two classes of objects, A and B, where B is just a special case of A. (I.e., to describe a B-type object I need to specify the same fields as for an A-type object, plus a whole bunch additional fields specific to B alone.) Furthermore, there's a third class T that is

Re: [GENERAL] Foreign keys and inheritance

2007-11-19 Thread Alvaro Herrera
Kynn Jones escribió: I have two classes of objects, A and B, where B is just a special case of A. (I.e., to describe a B-type object I need to specify the same fields as for an A-type object, plus a whole bunch additional fields specific to B alone.) Furthermore, there's a third class T that

Re: [GENERAL] Postgre and XML

2007-11-19 Thread x asasaxax
I dont know how can i enable the xml in postgre. I´ve tried to do a xml search function but it seams that the postgre doesen´t recognized the function. How can I install and use the xml on the postgre? Thanks 2007/11/19, Bruce Momjian [EMAIL PROTECTED]: Peter Eisentraut wrote: Am Montag, 19.

[GENERAL] plpython array support

2007-11-19 Thread Sean Davis
Just a simple question--does plpythonu (8.3beta) have support for arrays? I don't see a specific mention of it in the docs, so I suppose not. Thanks, Sean ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ?

Re: [GENERAL] Postgre and XML

2007-11-19 Thread Alvaro Herrera
x asasaxax escribió: I dont know how can i enable the xml in postgre. I´ve tried to do a xml search function but it seams that the postgre doesen´t recognized the function. How can I install and use the xml on the postgre? What version of Postgres? In Postgres 8.2 and earlier, you need to

Re: [GENERAL] Postgre and XML

2007-11-19 Thread Thomas Kellerer
x asasaxax wrote on 19.11.2007 12:17: Hi, I´m interested in running xml with postgre. I use postgre version 8.2 and windows xp. I would like to know how can i enable the xml in the postgresql. Did you know if its secure to use this xml function of postgre in commercial applications? How

Re: [GENERAL] Foreign keys and inheritance

2007-11-19 Thread Jeff Davis
On Mon, 2007-11-19 at 17:19 -0300, Alvaro Herrera wrote: Kynn Jones escribió: I have two classes of objects, A and B, where B is just a special case of A. (I.e., to describe a B-type object I need to specify the same fields as for an A-type object, plus a whole bunch additional fields

Re: [GENERAL] Postgre and XML

2007-11-19 Thread Raymond O'Donnell
On 19/11/2007 21:44, Thomas Kellerer wrote: But I have no clue how you would enable the module after the installation has finished. I think you have to run an SQL script to enable the module. Ray. --- Raymond O'Donnell, Director

Re: [GENERAL] Postgre and XML

2007-11-19 Thread Raymond O'Donnell
On 19/11/2007 22:05, Raymond O'Donnell wrote: On 19/11/2007 21:44, Thomas Kellerer wrote: But I have no clue how you would enable the module after the installation has finished. I think you have to run an SQL script to enable the module. Sorry, that wasn't very helpful. :-) I should have

Re: [GENERAL] Need help with complicated SQL statement

2007-11-19 Thread Ted Byers
Thanks Shane, It works reasonably well. It gets the right answer, but I guess my data set is much larger than your test. Please consider the appended data. The first two SQL statements are directly comparable. My Left join is marginally simpler, as shown by EXPLAIN, and runs to completion in

[GENERAL] PostgreSQL Conference 08 East!

2007-11-19 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It's that time, after a wildly successful conference last October in Portland, Oregon we are now beginning to ramp up for the East Coast 08 conference! The current plan is to host a two day conference of Tutorials (new) and Talks on March 28th and

Re: [GENERAL] plpython array support

2007-11-19 Thread Jorge Godoy
Em Monday 19 November 2007 19:29:51 Sean Davis escreveu: Just a simple question--does plpythonu (8.3beta) have support for arrays? I don't see a specific mention of it in the docs, so I suppose not. Arrays work for a long time now. I've been using them since 8.1, for sure, but I think that

Re: [GENERAL] plpython and error catching

2007-11-19 Thread Adrian Klaver
On Monday 19 November 2007 10:37 am, Sean Davis wrote: What is the expected behavior of a construct like this: def insert_xml(elem): id=int(elem.findtext('PMID')) try: plpy.execute(plan,[unicode(ET.tostring(elem)),id]) except:

Re: [GENERAL] plpython array support

2007-11-19 Thread Sean Davis
On Nov 19, 2007 9:08 PM, Jorge Godoy [EMAIL PROTECTED] wrote: Em Monday 19 November 2007 19:29:51 Sean Davis escreveu: Just a simple question--does plpythonu (8.3beta) have support for arrays? I don't see a specific mention of it in the docs, so I suppose not. Arrays work for a long time

Re: [GENERAL] ERROR: invalid restriction selectivity: 224359728.000000

2007-11-19 Thread xeb
В сообщении от Sunday 18 November 2007 05:00:35 Scott Marlowe написал(а): On Nov 16, 2007 11:59 AM, [EMAIL PROTECTED] wrote: Hello! Process postmaster completly eat my proccessor for a long time and i see that message in logs. Does anybody know what does the subj means and why it occures

Re: [GENERAL] GIN: any ordering guarantees for the hits returned?

2007-11-19 Thread Alex Drobychev
David Fetter [EMAIL PROTECTED] wrote:On Fri, Nov 16, 2007 at 07:56:45PM -0800, adrobj wrote: Hello, I have a moderately large (~10-20GB) table: CREATE TABLE msgs ( msg varchar(2048), msg_tsv tsvector, posted timestamp ); CREATE INDEX msgs_i ON msgs USING gin(msg_tsv); The

Re: [GENERAL] postgresql storage and performance questions

2007-11-19 Thread Trevor Talbot
On 11/19/07, Josh Harrison [EMAIL PROTECTED] wrote: I have 2 tables with 2 cols each( 1 numeric(8,0) and 1 varchar(3) ). In table1 both the cols are filled and in table2 the varchar colm is null So when I checked the tablesize for these two tables (using pg_relation_size) table1 - 57344

[GENERAL] plpythonu under OS X 10.4 -- a brief HOWTO

2007-11-19 Thread Philip Semanchuk
Hi all, I just got plpythonu working under OS X, and I'm posting my HOWTO notes here in case I (or anyone else) needs them. The install was pretty straightforward for me once I'd Googled the proper magic commands. I'm on OS X Tiger (10.4.10) which comes with Python 2.3 installed by

Re: [GENERAL] Need help with complicated SQL statement

2007-11-19 Thread Shane Ambler
Ted Byers wrote: Thanks Shane, It works reasonably well. It gets the right answer, but I guess my data set is much larger than your test. What indexes have you got? Using this index on the sample I sent gets the response time to about 5ms (per stock_id) (as opposed to 900ms with these