[GENERAL] howto determine rows count to be returned by DECLARE ... SELECT ...

2009-07-06 Thread Konstantin Izmailov
Dear Community, I'm working on implementation of virtual grid using DECLARE... SELECT Advantage of virtual grid is that it loads only rows that a user is willing to see (with FETCH). However, it is not clear how to determine max rows count that the cursor can return. The count is necessary for

Re: [GENERAL] Documentation - PgAdmin

2009-07-06 Thread Dave Page
On Sun, Jul 5, 2009 at 9:00 PM, Guillaume Lelarge wrote: > If I remember well, the reason was the installer would be much bigger if we > still included it. And we would also have to carry the pgAdmin CHM, and the > Slony one, and the EnterpriseDB one and now the Greenplum one. And what about > tran

[GENERAL] Normalize INTERVAL ouput format in a db driver

2009-07-06 Thread Sebastien FLAESCH
Hi all, Just testing 8.4rc2 INTERVALs... According to the doc, INTERVAL output format is controlled by SET intervalstyle. I am writing an interface/driver and need a solution to fetch/convert interval values independently from the current format settings... I could force my driver to implicitl

[GENERAL] Passing a table to function

2009-07-06 Thread sqlguru
In SQL 2008, we could pass tables into stored procedures. CREATE TABLE members -- Only username is required ( mem_username VARCHAR(25) NOT NULL PRIMARY KEY, mem_email VARCHAR(255), mem_fname VARCHAR(25), mem_lname VARCHAR(25) ); CREATE TABLE TYPE member_table_type ( mem_

[GENERAL] COALESCE not filtering well.

2009-07-06 Thread Mohan Raj B
G'Day! I have issues with filtering the data based on the criteria. Please take a look at the way I use COALESCE especially the WHERE part of my function. The function is not returning me a filtered result. for example, if I try to execute the function as follows: SELECT * FROM sp_item(10,NULL

Re: [GENERAL] Postgres Plus Advanced Server and general Postgres compatibility?

2009-07-06 Thread Abbas
On Sun, Jul 5, 2009 at 4:49 PM, Andre Lopes wrote: > Hi, > > I have installed "Postgres Plus Advanced Server" in a developement machine. > TAt this time I don't know the production server envoirement. It is > problematic to use "Postgres Plus Advanced Server" as developement server? > Could I hav

Re: [GENERAL] Normalize INTERVAL ouput format in a db driver

2009-07-06 Thread Sebastien FLAESCH
Further, little libpq question: When using INTERVAL types, can I rely on PQfmod(), PQfsize() to determine the exact definition of the INTERVAL precision? => what YEAR/MONTH/DAY/HOUR/MINUTE/SECOND fields where used to create the column. I get different values for the type modifier, but how to i

Re: [GENERAL] COALESCE not filtering well.

2009-07-06 Thread Greg Stark
On Mon, Jul 6, 2009 at 6:37 AM, Mohan Raj B wrote: > CREATE OR REPLACE FUNCTION sp_item(itemid integer, itemname character > varying) >   WHERE ( ( COALESCE($1,0)=0 OR  itemid=$1) AND (COALESCE($2, '')='' OR > itemname LIKE '%'||$2||'%') ) LOOP itemid and itemname are your parameters, they're b

Re: [GENERAL] Postgres 8.3.7 Server Crash: failed to add item to the right sibling in index

2009-07-06 Thread Tom Lane
CM J writes: >I am running Postgres 8.3.7 on Windows 2003 with my java > application.Off late, the server crashes with the following trace: > *2009-07-01 14:47:07.250 ISTPANIC: failed to add item to the right sibling > in index "mevservices2_ndx"* Sounds like a data corruption problem .

Re: [GENERAL] Upgrading 8.3 to 8.4 on Windows.

2009-07-06 Thread Tguru
What I could suggest would be to use an ETL tool. There are open source tools available for free. Talend Open Studio is an open source ETL tool for data integration and migration experts. It's easy to learn for a non-technical user. What distinguishes Talend, when it comes to business users, is

Re: [GENERAL] Problem search on text arrays, using the overlaps (&&) operator

2009-07-06 Thread nha
Hello, Le 2/07/09 2:07, John Cheng a écrit : We use text[] on one of our tables. This text[] column allows us to search for records that matches a keyword in a set of keywords. For example, if we want to find records that has a keyword of "foo" or "bar", we can use the condition: keywords&&

[GENERAL] Feistel cipher, shorter string and hex to int

2009-07-06 Thread Ivan Sergio Borgonovo
On Sat, 02 May 2009 11:26:28 +0200 "Daniel Verite" wrote: > Note that it returns a bigint because we don't have unsigned > integers in PG. If you're OK with getting negative values, the > return type can be changed to int. > Otherwise if you need a positive result that fits in 32 bits, it's > po

[GENERAL] Windows installer for pg-8.4 confusion

2009-07-06 Thread Stuart McGraw
First, thanks to everyone who contributed to 8.4 -- the new features list looks great! In the past I have always installed the Windows binary installer from postgresql.org. For pg-8.4 I see that the download directory now has a pointer to the EnterpriseDB "one click" installer. Has the Enterpri

Re: [GENERAL] Windows installer for pg-8.4 confusion

2009-07-06 Thread Andreas Wenk
Stuart McGraw schrieb: > First, thanks to everyone who contributed > to 8.4 -- the new features list looks great! > > In the past I have always installed the > Windows binary installer from postgresql.org. > For pg-8.4 I see that the download directory > now has a pointer to the EnterpriseDB "one

[GENERAL] Performance problem with low correlation data

2009-07-06 Thread Scara Maccai
I have a problem with the method that PG uses to access my data. Data into testinsert is inserted every 15 minutes. ne_id varies from 1 to 2. CREATE TABLE testinsert ( ne_id integer NOT NULL, t timestamp without time zone NOT NULL, v integer[], CONSTRAINT testinsert_pk PRIMARY KEY

Re: [GENERAL] Windows installer for pg-8.4 confusion

2009-07-06 Thread Stuart McGraw
Andreas Wenk wrote: > Stuart McGraw schrieb: >> First, thanks to everyone who contributed >> to 8.4 -- the new features list looks great! >> >> In the past I have always installed the >> Windows binary installer from postgresql.org. >> For pg-8.4 I see that the download directory >> now has a poi

Re: [GENERAL] Windows installer for pg-8.4 confusion

2009-07-06 Thread Dave Page
2009/7/6 Stuart McGraw : >>> Has the EnterpriseDB installer now become the >>> "official" Windows distribution?  Or will the >>> standard pginstaller appear some time in the >>> future? No, it won't be produced in the future. It's been deprecated due to the high maintenance overhead and how diffic

Re: [GENERAL] Performance problem with low correlation data

2009-07-06 Thread Greg Stark
On Mon, Jul 6, 2009 at 6:32 PM, Scara Maccai wrote: > The "best" way to read the table would still be a nested loop, but a loop on > the > "t" values, not on the ne_id values, since data for the same timestamp is > "close". But that would be a different query -- there's no restrictions on the

[GENERAL] Added parameter for CREATE ROLE

2009-07-06 Thread Michael Gould
It would be nice if during create role we could have a parameter to set the number of days that a password is valid instead of just a timestamp. Best Regards -- Michael Gould, Managing Partner Intermodal Software Solutions, LLC 904.226.0978 904.592.5250 fax -- Sent via pgsql-general mailing

Re: [GENERAL] Added parameter for CREATE ROLE

2009-07-06 Thread Raymond O'Donnell
On 06/07/2009 19:32, Michael Gould wrote: > It would be nice if during create role we could have a parameter to set the > number of days that a password is valid instead of just a timestamp. Would (current_timestamp + interval '365 days') work? Dunno myself - just thinking out loud... :-) Ray.

[GENERAL] Schema search_path and $user

2009-07-06 Thread Postgres User
In the docs, I see repeated references to $user in the postgresql.conf schema search_path setting such as: search_path = '"$user",public' But I don't see any info on the meaning of '$user' here. Is $user some kind of variable within postgresql.conf that refers to the current user? Can it be r

Re: [GENERAL] Schema search_path and $user

2009-07-06 Thread Tom Lane
Postgres User writes: > In the docs, I see repeated references to $user in the postgresql.conf > schema search_path setting such as: > search_path = '"$user",public' > But I don't see any info on the meaning of '$user' here. I guess you didn't read the actual documentation of search_pat

Re: [GENERAL] Schema search_path and $user

2009-07-06 Thread Postgres User
Thanks for the link, I wasn't reading the right page(s) in the documentation. On Mon, Jul 6, 2009 at 12:19 PM, Tom Lane wrote: > Postgres User writes: >> In the docs, I see repeated references to $user in the postgresql.conf >> schema search_path setting such as: > >> search_path = '"$user",publi

[GENERAL] Out of memory error

2009-07-06 Thread Paul Smith
We have a query that's producing an "out of memory" error consistently. The detail of the error message is "Failed on request of size 16." We have 16 GB of RAM in our database server running 32-bit Debian lenny. Here's the query: INSERT INTO db_newsitemlocation (news_item_id, location_id) SELECT n

Re: [GENERAL] Windows installer for pg-8.4 confusion

2009-07-06 Thread Bruce Momjian
Stuart McGraw wrote: > First, thanks to everyone who contributed > to 8.4 -- the new features list looks great! > > In the past I have always installed the > Windows binary installer from postgresql.org. > For pg-8.4 I see that the download directory > now has a pointer to the EnterpriseDB "one

[GENERAL] Efficiently move data from one table to another, with FK constraints?

2009-07-06 Thread Rob W
I am using COPY to bulk load large volumes (i.e. multi GB range) of data to a staging table in a PostgreSQL 8.3. For performance, the staging table has no constraints, no primary key, etc. I want to move that data into the "real" tables, but need some advice on how to do that efficiently. Here

Re: [GENERAL] Out of memory error

2009-07-06 Thread Tom Lane
Paul Smith writes: > We have a query that's producing an "out of memory" error > consistently. The detail of the error message is "Failed on request of > size 16." We have 16 GB of RAM in our database server running 32-bit > Debian lenny. Here's the query: > ... > ExecutorState: 460390096 to

Re: [GENERAL] Out of memory error

2009-07-06 Thread Paul Smith
On Mon, Jul 6, 2009 at 3:34 PM, Tom Lane wrote: > Clearly a memory leak, but it's not so clear exactly what's causing it. > What's that intersects() function?  Can you put together a > self-contained test case? It's actually ST_Intersects from PostGIS (some of the PostGIS function names are still

[GENERAL] combine multiple row values in to one row

2009-07-06 Thread Lee Harr
Hi; I'm looking for a way to do this: # \d tbl Table "public.tbl" Column | Type | Modifiers +-+--- idn| integer | code | text| # SELECT * FROM tbl; idn | code -+-- 1 | A 2 | B 2 | C 3 | A 3 | C 3 | E (6 rows) # select idn,

Re: [GENERAL] Problem search on text arrays, using the overlaps (&&) operator

2009-07-06 Thread John Cheng
- "nha" wrote: > From: "nha" > To: "John Cheng" > Cc: pgsql-general@postgresql.org > Sent: Monday, July 6, 2009 9:12:22 AM GMT -08:00 US/Canada Pacific > Subject: Re: [GENERAL] Problem search on text arrays, using the overlaps (&&) > operator > > Hello, > > With your exhaustive example

Re: [GENERAL] combine multiple row values in to one row

2009-07-06 Thread Ivan Sergio Borgonovo
On Tue, 7 Jul 2009 01:59:35 +0430 Lee Harr wrote: > > Hi; > > I'm looking for a way to do this: > # select idn, magic() as codes FROM tbl; > idn | codes > -+-- >1 | A >2 | B, C >3 | A, C, E > (3 rows) > > > Right now, I use plpgsql functions, but each time I do it > I ha

Re: [GENERAL] Out of memory error

2009-07-06 Thread Paul Ramsey
If you are on PostGIS < 1.3.4 there are substantial memory leaks in intersects() for point/polygon cases. Upgrading to 1.3.6 is recommended. P On Mon, Jul 6, 2009 at 1:39 PM, Paul Smith wrote: > On Mon, Jul 6, 2009 at 3:34 PM, Tom Lane wrote: >> Clearly a memory leak, but it's not so clear exactl

Re: [GENERAL] Out of memory error

2009-07-06 Thread Paul Smith
On Mon, Jul 6, 2009 at 7:26 PM, Paul Ramsey wrote: > If you are on PostGIS < 1.3.4 there are substantial memory leaks in > intersects() for point/polygon cases. Upgrading to 1.3.6 is > recommended. Thank you, that fixed it. -- Paul Smith http://www.pauladamsmith.com/ -- Sent via pgsql-general