[GENERAL] Toast datum

2011-05-16 Thread Nick Raj
Hi, #define DatumGetNDBOX(x)((NDBOX*)DatumGetPointer(x)) #define PG_GETARG_NDBOX(x)DatumGetNDBOX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) Now i have to define #define NDBOXGetDatum(x) ()PointerGetDatum(x) Is there any need to replace this ?? with some toastable thing or is it

Re: [GENERAL] Role for CSV import

2011-05-16 Thread Tarlika Elisabeth Schmitz
On Sun, 15 May 2011 20:05:04 +0200 Cédric Villemain cedric.villemain.deb...@gmail.com wrote: 2011/5/15 Rob Sargent robjsarg...@gmail.com: Tarlika Elisabeth Schmitz wrote: I have a database that will be populated solely by CSV import. There are several CSV file formats, all

[GENERAL] arguments are not toastable

2011-05-16 Thread Nick Raj
Hi, I have defined some function and also used NDBOX structure that having variable length. typedef struct NDBOX { int32vl_len_;/* varlena length */ unsigned int dim; doublex[1]; } NDBOX; When i called my function, it gives NDBOX to be null On debugging, i

[GENERAL] Remove Duplicate Words from a field

2011-05-16 Thread Sukuchha Shrestha
Dear All, I am new to Postgresql. I have a field with lots of dublicate words and i want to remove any dublicate word from that field. For example, if i have a field with a string one, one, two, two, three, how would i get one, two, three only ? Any help is much apprecieated ! Sukuchha

Re: [GENERAL] Remove Duplicate Words from a field

2011-05-16 Thread Raymond O'Donnell
On 16/05/2011 13:34, Sukuchha Shrestha wrote: Dear All, I am new to Postgresql. I have a field with lots of dublicate words and i want to remove any dublicate word from that field. For example, if i have a field with a string one, one, two, two, three, how would i get one, two, three only ?

Re: [GENERAL] Remove Duplicate Words from a field

2011-05-16 Thread Sim Zacks
I would use a plpython or plperl function In python you can split the word into a list and then get unique items and put it back in a string, for example. Sim On 05/16/2011 03:34 PM, Sukuchha Shrestha wrote: Dear All, I am new to Postgresql. I have a field with lots of dublicate words

[GENERAL] Postgre Installation Problem

2011-05-16 Thread Kalai R
Dear sir, We are trying to install the Postgre-Sql 9.0. In some Win-Xp systems, the postgre sql is installed working properly. But in some Win-XP systems, it was installed but the Service could not be started. In Win-Vista system, even the Service is not installed. When we analysis the

Re: [GENERAL] Remove Duplicate Words from a field

2011-05-16 Thread Pavel Stehule
Hello 2011/5/16 Sukuchha Shrestha sukuc...@yahoo.de: Dear All, I am new to Postgresql. I have a field with lots of  dublicate words and i want to remove any dublicate word from that field. For example, if i have a field with a string one, one, two, two, three, how would i get one, two,

Re: [GENERAL] Remove Duplicate Words from a field

2011-05-16 Thread Sukuchha Shrestha
Hi Pavel, Thanks for your code. I am using postgresql 8.3 so dont have unnest function in my postgresql. But i found equivalend code for unnest in internet. Afterwards i tried your code, and it worked !! Thanks for the help ! you saved me from being a dead man. Sukuchha

Re: [GENERAL] Remove Duplicate Words from a field

2011-05-16 Thread Pavel Stehule
2011/5/16 Sukuchha Shrestha sukuc...@yahoo.de: Hi Pavel, Thanks for your code. I am using postgresql 8.3 so dont have unnest function in my postgresql. But i found equivalend code for unnest in internet. Afterwards i tried your code, and it worked  !! Thanks for the help ! you saved me from

Re: [GENERAL] Query to return every 1st Sat of a month between two dates

2011-05-16 Thread David Johnston
Start with January 1st, 2011 Generate Series 0 ~ 200 Add (Series# * 7) Days to January 1st := CheckDate Filter where day(CheckDate) = 7 Filter where CheckDate = December 31st 2013 David J. From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of

Re: [GENERAL] How do we combine and return results from multiple queries in a loop?

2011-05-16 Thread Bernardo Telles
Hi John, Thanks for the quick response. I'll elaborate on the *actual* problem. Basically, I want to call: select * from partiesWithin(DAYTONA, FL, 5); The partiesWithin() function finds all zip codes (and zip_code centroids), then searches a 5 (or n) mile radius around those centroids for

Re: [GENERAL] How do we combine and return results from multiple queries in a loop?

2011-05-16 Thread David Johnston
Please read section “39.6.1. Returning From a Function” in the pl/pgsql section of the documentation (actually, you should read the entire section on pl/pgsql programming). “RETURN QUERY appends the results of executing a query to the function's result set.” [when used with RETURNING SETOF

Re: [GENERAL] Postgre Installation Problem

2011-05-16 Thread Scott Marlowe
On Mon, May 16, 2011 at 7:04 AM, Kalai R softlinne...@gmail.com wrote: Dear sir, We are trying to install the Postgre-Sql 9.0.  In some Win-Xp systems, the postgre sql is installed working properly.  But in some Win-XP systems, it was installed but the Service could not be started.  In

Re: [GENERAL] How do we combine and return results from multiple queries in a loop?

2011-05-16 Thread Bernardo Telles
Wow, you guys are some fast-acting dudes (and yes, I *am* an adult, but a kid at heart). David, yup, that's exactly the part of the documentation that I read, and that is confusing me, because when I try it at home, it's not working. In fact, the exact example that I'm showing in the first email

[GENERAL] Remove Modifiers on Table

2011-05-16 Thread Carlos Mennens
I created a modifier for auto incrementing my primary key as follows: records=# \d users Table public.users Column | Type | Modifiers +---+ id

Re: [GENERAL] Query to return every 1st Sat of a month between two dates

2011-05-16 Thread Osvaldo Kussama
2011/5/11 Alex - ainto...@hotmail.com: Hi, is there an easy way to return the date of every first Saturday of a month in a data range i.e. 2011-2013 Any help would be appreciated Thanks Alex Try: SELECT s.a::date+(6-(extract(dow from s.a)::int%7)) FROM

[GENERAL] Client-based EOFs triggering hung queries?

2011-05-16 Thread Christopher Opena
Hello all, First time poster here - probably a good sign since I've been running postgresql with zero issues for the last several years! At any rate, I've recently run into a strange issue. Client-based EOFs are nothing new to our application; people can sometimes close a connection for a

Re: [GENERAL] How do we combine and return results from multiple queries in a loop?

2011-05-16 Thread Pavel Stehule
Hello 2011/5/16 Bernardo Telles btel...@gmail.com: Wow, you guys are some fast-acting dudes (and yes, I am an adult, but a kid at heart). David, yup, that's exactly the part of the documentation that I read, and that is confusing me, because when I try it at home, it's not working. In fact,

Re: [GENERAL] Client-based EOFs triggering hung queries?

2011-05-16 Thread Tom Lane
Christopher Opena counterv...@gmail.com writes: Hello all, First time poster here - probably a good sign since I've been running postgresql with zero issues for the last several years! At any rate, I've recently run into a strange issue. Client-based EOFs are nothing new to our application;

Re: [GENERAL] Remove Modifiers on Table

2011-05-16 Thread Bosco Rama
Carlos Mennens wrote: I created a modifier for auto incrementing my primary key as follows: records=# \d users Table public.users Column | Type | Modifiers

Re: [GENERAL] Client-based EOFs triggering hung queries?

2011-05-16 Thread Christopher Opena
Thanks for the reply, Tom. I admit we were a bit rushed during the troubleshooting process; now that we know precisely how to identify these procs and deal with them, I imagine we'll grab more info next time before killing them, including a netstat view and a stack trace per your recommendation.

[GENERAL] Suppress INSERT x x messages

2011-05-16 Thread Gauthier, Dave
Hi: Is there a way to suppress the INSERT x x and DELETE y (etc...) messages in psql? Thanks in advance

Re: [GENERAL] Suppress INSERT x x messages

2011-05-16 Thread Vibhor Kumar
On May 17, 2011, at 3:17 AM, Gauthier, Dave wrote: Is there a way to suppress the INSERT x x and DELETE y (etc...) messages in psql? psql -q Thanks Regards, Vibhor Kumar EnterpriseDB Corporation The Enterprise PostgreSQL Company vibhor.ku...@enterprisedb.com

[GENERAL] find the greatest, pick it up and group by

2011-05-16 Thread Ivan Sergio Borgonovo
I've a table like: CREATE TABLE ordiniitem ( idordine numeric(18,0) NOT NULL, grupposped smallint, idart numeric(18,0) NOT NULL, qevasa integer, qfuoricat integer, qinris integer, qnonpub integer, qann integer, qord integer, qpren integer, qrichpag integer, qinriass

Re: [GENERAL] COPY complaining about unquoted carriage return found in data... in a quoted field

2011-05-16 Thread Ivan Sergio Borgonovo
On Tue, 10 May 2011 15:59:07 +0200 Ivan Sergio Borgonovo m...@webthatworks.it wrote: Sorry for the noise. The csv was automatically generated. The code was right but during generation there was some problem with the box generating it (php segfaulting) and there were some unclosed quotes in a much

Re: [GENERAL] find the greatest, pick it up and group by

2011-05-16 Thread David Johnston
When asking for help on non-trivial SELECT queries it really helps to tell us the version of PG you are using so that responders know what functionality you can and cannot use. In this case specifically, whether WINDOW (and maybe WITH) clauses available? David J. -Original Message-

Re: [GENERAL] find the greatest, pick it up and group by

2011-05-16 Thread Ivan Sergio Borgonovo
On Mon, 16 May 2011 20:05:45 -0400 David Johnston pol...@yahoo.com wrote: When asking for help on non-trivial SELECT queries it really helps to tell us the version of PG you are using so that responders know what functionality you can and cannot use. In this case specifically, whether WINDOW

Re: [GENERAL] How do we combine and return results from multiple queries in a loop?

2011-05-16 Thread Bernardo Telles
Hi Pavel, I'm running 8.4 On Mon, May 16, 2011 at 3:58 PM, Pavel Stehule pavel.steh...@gmail.comwrote: Hello 2011/5/16 Bernardo Telles btel...@gmail.com: Wow, you guys are some fast-acting dudes (and yes, I am an adult, but a kid at heart). David, yup, that's exactly the part of the

[GENERAL] Granting privileges on all tables,sequences , views, procedures

2011-05-16 Thread Adarsh Sharma
Dear all, Today I grant a user all privileges to all tables in a database by grant all privileges on svo_data_social to neha ; grant all privileges on svo_phrases to neha ; .. . . . ... Now i find it very uncomfort to grant privileges one by one table. Is there a

[GENERAL] Memcached for Database server

2011-05-16 Thread Adarsh Sharma
Dear all, I need to research on Memcache in the next few days. What I want to know is it worth to have memcahed enable in our Mysql/ Postgres Production Servers. We have databases from 20 to 230 GB and it's not the OLTP just a simple OLAP where data is fetched and stored in some meaningful

Re: [GENERAL] Memcached for Database server

2011-05-16 Thread Rick Genter
On May 16, 2011, at 10:09 PM, Adarsh Sharma wrote: Dear all, I need to research on Memcache in the next few days. What I want to know is it worth to have memcahed enable in our Mysql/ Postgres Production Servers. We have databases from 20 to 230 GB and it's not the OLTP just a simple

Re: [GENERAL] Memcached for Database server

2011-05-16 Thread Adarsh Sharma
Rick Genter wrote: On May 16, 2011, at 10:09 PM, Adarsh Sharma wrote: Dear all, I need to research on Memcache in the next few days. What I want to know is it worth to have memcahed enable in our Mysql/ Postgres Production Servers. We have databases from 20 to 230 GB and it's not the

Re: [GENERAL] Memcached for Database server

2011-05-16 Thread Satoshi Nagayasu
Hi, 2011/05/17 14:31, Adarsh Sharma wrote: Rick Genter wrote: On May 16, 2011, at 10:09 PM, Adarsh Sharma wrote: Dear all, I need to research on Memcache in the next few days. What I want to know is it worth to have memcahed enable in our Mysql/ Postgres Production Servers. We have

Re: [GENERAL] Memcached for Database server

2011-05-16 Thread Rick Genter
On May 16, 2011, at 10:31 PM, Adarsh Sharma wrote: Rick Genter wrote: On May 16, 2011, at 10:09 PM, Adarsh Sharma wrote: Dear all, I need to research on Memcache in the next few days. What I want to know is it worth to have memcahed enable in our Mysql/ Postgres Production