Re: [GENERAL] table / query as a prameter for PL/pgSQL function

2011-08-08 Thread Ondrej Ivanič
Hi, 2011/8/9 Merlin Moncure : > You have a few of different methods for passing sets between functions. I do not want to pass data between functions. The ideal solution should look like this: select * from my_map_func() > 1) refcursor as David noted.  reasonably fast. however, I find the > 'FETC

Re: [GENERAL] Update with ORDER BY and LIMIT

2011-08-08 Thread David Johnston
> > 8.X in this context means "8 point something, but I can't recall which > something". Could be 8.2, 8.3 or 8.4. Thus, in effect, asking those > replying to restrict themselves to 8 series features, as opposed to 9 > series features. > There are a lot of features added between 8.0 and 8.4; W

Re: [GENERAL] upgrade from 8.3 to 8.4

2011-08-08 Thread John R Pierce
On 08/08/11 4:11 PM, Claire Chang wrote: I am going to upgrade our PostgresSQL server from 8.3 to 8.4. Is there any application code change required? I did some google searches and can't find any. to what David already said, I will add this observation... 8.4 is pickier about implied type

Re: [GENERAL] Update with ORDER BY and LIMIT

2011-08-08 Thread Paul M Foster
On Mon, Aug 08, 2011 at 05:34:14PM -0400, David Johnston wrote: > For whatever reason, the cust.lpmtamt and cust.lpmtdt are sometimes lacking > values and shouldn't be. I want to update the customer table to update these > values from the cashh table. I don't want to use an internal function. The

Re: [GENERAL] upgrade from 8.3 to 8.4

2011-08-08 Thread David Johnston
Your question is impossible to answer. Look here (and in the release docs for the point releases): http://www.postgresql.org/docs/8.4/static/release-8-4.html and then ask more specific questions if you are still concerned. Google is a good tool if you know how to write a good query (did yo

[GENERAL] upgrade from 8.3 to 8.4

2011-08-08 Thread Claire Chang
I am going to upgrade our PostgresSQL server from 8.3 to 8.4. Is there any application code change required? I did some google searches and can't find any. thanks,Claire

Re: [GENERAL] Update with ORDER BY and LIMIT

2011-08-08 Thread David Johnston
For whatever reason, the cust.lpmtamt and cust.lpmtdt are sometimes lacking values and shouldn't be. I want to update the customer table to update these values from the cashh table. I don't want to use an internal function. The PG version is 8.X. -- No such ver

[GENERAL] Update with ORDER BY and LIMIT

2011-08-08 Thread Paul M Foster
Two tables: 1) cust (one record each customer) contains: a) lpmtdt (date = last payment date) b) lpmtamt (numeric = last payment amount) c) custno (varchar(6) = customer string) 2) cashh (one record each income/cash transaction) conta

Re: [GENERAL] Problem with planner

2011-08-08 Thread pasman pasmański
Try to change index: objects_endings_tsz_active(state,endings_tsz) where state='active'. 2011/8/8, hubert depesz lubaczewski : > Hi, > we have 8.3.11 installation on client site, with table, which looks like > this: > > $ \d objects > Table "public.obj

Re: [GENERAL] table / query as a prameter for PL/pgSQL function

2011-08-08 Thread Merlin Moncure
2011/8/7 Ondrej Ivanič : > Hi, > > It is possible to pass query result (or cursor?) as function > parameter? I need a function which emits zero or more rows per input > row (map function from map&reduce paradigm). Function returns record > (or array): (value1, value2, value3) > I've tried the follo

Re: [GENERAL] Problem with planner

2011-08-08 Thread hubert depesz lubaczewski
On Mon, Aug 08, 2011 at 12:51:40PM -0400, Tom Lane wrote: > hubert depesz lubaczewski writes: > > and we have a query: > > select count(*) from objects where state='active'::text and ending_tsz <= ( > > select now() - '1 day'::interval ); > > Try getting rid of the sub-select. There might have

Re: [GENERAL] Problem with planner

2011-08-08 Thread Tom Lane
hubert depesz lubaczewski writes: > and we have a query: > select count(*) from objects where state='active'::text and ending_tsz <= ( > select now() - '1 day'::interval ); Try getting rid of the sub-select. There might have been a reason to do it like that ten years ago, but these days it's a

[GENERAL] JDBC driver throwing error while connecting to the slave server for partitioned table

2011-08-08 Thread sameera vhora
We are facing below issue after creating slony replication of partitioning table in edb server 8.3. This issue persist only on slave one not the primary one. Below logs we found in tomcats. Error in postgresql driver initialization: com.edb.util.PSQLException: The connection attempt failed

[GENERAL] Problem with planner

2011-08-08 Thread hubert depesz lubaczewski
Hi, we have 8.3.11 installation on client site, with table, which looks like this: $ \d objects Table "public.objects" Column | Type | Modifiers ---

Re: [GENERAL] Query with rightmost function does not use index

2011-08-08 Thread Andres Freund
Hi, On Monday, August 08, 2011 15:40:20 - - wrote: > explain analyze select * from filter_item where filter_hash = MD5(''); > > QUERY PLAN > > ---

Re: [GENERAL] Russian Language Spam

2011-08-08 Thread Martin Gainty
they come from b*y&o(@n!.com so purchasing one of their domains and you'll get Russian Brides for sale preconfigured for that site! August is black August month for Russia..all bad things that could happen have happened to Russia in the month of August. http://www.theworld.org/2011/08/why-russia

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Albe Laurenz
Siva Palanisamy wrote: > However, I get the same list of errors as below. The weird thing is, it appears to be working fine. I > could not able to comprehend the error list! I don't have any clue about it! > > For your information, I don't think am running using the superuser account! But just seem

Re: [GENERAL] Query with rightmost function does not use index

2011-08-08 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of - - Sent: Monday, August 08, 2011 3:40 AM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Query with rightmost function does not use index Here are the EXPLAIN ANALYZE outputs: explain an

Re: [GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread David Johnston
Hi All, I was provided with a user account to access postgresql. I want to process some high-level operations that might need a superuser/admin privileged access. How to get to know the user account I was provided having what kind of privileges? It looks like I don't have super user account!

Re: [GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread Siva Palanisamy
Hi Achilleas, Thanks a lot for your reply. I got what I wanted now! I knew this question was very basic but I am completely new to PostgreSQL..!! Thanks and Regards, Siva. -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf

Re: [GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread Achilleas Mantzios
Στις Monday 08 August 2011 12:36:44 ο/η Siva Palanisamy έγραψε: > Hi All, > > I was provided with a user account to access postgresql. I want to process > some high-level operations that might need a superuser/admin privileged > access. How to get to know the user account I was provided having w

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Greg Williamson
Siva -- > > Thanks a lot for your reply. As usual Backup worked perfectly. When I tried > restore using the command you provided, I got the below list of errors! > Please help me > out on this. > > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error fro

Re: [GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread Simon Riggs
On Mon, Aug 8, 2011 at 10:36 AM, Siva Palanisamy wrote: > I was provided with a user account to access postgresql. I want to process > some high-level operations that might need a superuser/admin privileged > access. How to get to know the user account I was provided having what kind > of privile

[GENERAL] How to get to know the current user account is superuser or not?

2011-08-08 Thread Siva Palanisamy
Hi All, I was provided with a user account to access postgresql. I want to process some high-level operations that might need a superuser/admin privileged access. How to get to know the user account I was provided having what kind of privileges? It looks like I don't have super user account! An

Re: [GENERAL] Filling null values

2011-08-08 Thread Thomas Markus
hi, try this. If your table name is mytable: select a.homeid , a.city , coalesce(a.date, (select b.date from mytable b where b.homeid=a.homeid and b.date is not null order by b.prepost=a.prepost desc limit 1) ) as date , a.measurement , a.prepost from mytable a Th

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Siva Palanisamy
Hi Amitabh, I just added the -O option in the middle as detailed below. pg_restore -c -O -h localhost -U username -d db dumpfile.pg; However, I get the same list of errors as below. The weird thing is, it appears to be working fine. I could not able to comprehend the error list! I don't have a

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Amitabh Kant
Hi Siva Not sure if it would help, but try passing -O in your pg_restore command. Amitabh On Mon, Aug 8, 2011 at 2:04 PM, Siva Palanisamy wrote: > Hi John, > > Thanks a lot for your reply. As usual Backup worked perfectly. When I tried > restore using the command you provided, I got the below

Re: [GENERAL] Filling null values

2011-08-08 Thread Ben Carbery
Hmm, no-one seemed to mention the obvious - a pl/pgsql function, either triggered or run manually depending if you want to update on insert/update or on demand. On 7 August 2011 16:05, Sim Zacks wrote: > ** > On 08/05/2011 07:32 PM, jeffrey wrote: > > I have a table that looks like this: > > ho

Re: [GENERAL] postgres table have a large number of relpages and occupied a big memory size

2011-08-08 Thread Tomas Vondra
On 8 Srpen 2011, 8:02, Vivekkumar Pandey wrote: > Hi , > > I have version of PostgreSQL as given below:--- > >version > - > PostgreSQL 8.1.2 on i686-pc-linux-gnu, compi

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Siva Palanisamy
Hi John, Thanks a lot for your reply. As usual Backup worked perfectly. When I tried restore using the command you provided, I got the below list of errors! Please help me out on this. pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 14; 1

Re: [GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread John R Pierce
On 08/08/11 1:01 AM, Siva Palanisamy wrote: Hi All, I am also a newbie here! I need to backup a database and restore it into the target machine where the database may already present or might not. If it exists, I want the "restore" command to overwrite, otherwise, just create a new one. I

[GENERAL] Backup & Restore a database in PostgreSQL

2011-08-08 Thread Siva Palanisamy
Hi All, I am also a newbie here! I need to backup a database and restore it into the target machine where the database may already present or might not. If it exists, I want the "restore" command to overwrite, otherwise, just create a new one. I tried using the commands: (1) BACKUP: pg_dump -h

Re: [GENERAL] Query with rightmost function does not use index

2011-08-08 Thread - -
Here are the EXPLAIN ANALYZE outputs: explain analyze select * from filter_item where filter_hash = MD5(''); QUERY PLAN -

Re: [GENERAL] Granting Privileges in Postgres

2011-08-08 Thread Guillaume Lelarge
On Mon, 2011-08-08 at 11:42 +0530, Adarsh Sharma wrote: > Guillaume Lelarge wrote: > > On Mon, 2011-08-08 at 10:28 +0530, Adarsh Sharma wrote: > > > >> Dear all, > >> > >> Today I researched on giving privileges in Postgres databases. I have 4 > >> databases and near about 150 tables, 50-60 seq

Re: [GENERAL] Re: [TESTERS] FREE hosting platforms with PostgreSQL, Java SDK, Tomcat, ecc.?

2011-08-08 Thread Achilleas Mantzios
Just a thought, why don't you deploy your setup in your home computer, and make it accesible from the inet via your home router? Just make a software raid, get a nice UPS unit, try to harden your OS a little bit, and run your apps there. It could prove a nice free alternative until anything that