Re: [GENERAL] how to start a procedure after postgresql started.

2011-05-24 Thread jun yang
2011/5/24 Rick Genter : > > On May 23, 2011, at 9:46 PM, jun yang wrote: > >> thanks for the info,i am just not have such deep learn of pg internal, >> i am on user level,not hacker,so the mail is in pgsql-general,not >> hacker list. > > What you are asking to do is not a typical user function. It

[GENERAL] Returning Rows in Procedure

2011-05-24 Thread Adarsh Sharma
Dear all, I need to return the rows of a table which was also created in that procedure. I know it is very easy when the table is existed before and we can specify like this to return create function a(integer) returns setof exist_table as $$ But it gives error when the table is also creat

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Pavel Stehule
Hello you have to use a dynamic sql look on statement FOR r IN EXECUTE or RETURN QUERY EXECUTE Regards Pavel Stehule 2011/5/24 Adarsh Sharma : > Dear all, > > I need to return the rows of a table which was also created in that > procedure. > > I know it is very easy when the table is existed

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Adarsh Sharma
Pavel Stehule wrote: Hello you have to use a dynamic sql look on statement FOR r IN EXECUTE or RETURN QUERY EXECUTE Can u explain in the example, I find it difficult to understand . I think we have to specify return type while creating procedures. Thanks Regards Pavel Stehule 2011/5

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Pavel Stehule
Hello 2011/5/24 Adarsh Sharma : > Pavel Stehule wrote: >> >> Hello >> >> you have to use a dynamic sql >> >> look on statement >> >> FOR r IN EXECUTE >> or RETURN QUERY EXECUTE >> > > Can u explain in the example, I find it difficult to understand . > > I think we have to specify  return type whil

[GENERAL] Dumping schemas using pg_dump without extensions (9.1 Beta)

2011-05-24 Thread Adrian Schreyer
I am trying to backup a single schema only, without any other database objects such as extensions. pg_dump however always includes extensions, even with the --schema=schema option specified (see below for example). Is there a workaround for this? Cheers, Adrian -- -- TOC entry 20 (class 3079 OID

Re: [GENERAL] Trapping errors

2011-05-24 Thread Alban Hertroys
On 23 May 2011, at 22:08, Shane W wrote: > Hello list, > > I have a table with double precision columns and update > queries which multiply and divide these values. I am > wondering if it's possible to catch overflow and underflow > errors to set the column to 0 in the case of an underflow > and

Re: [GENERAL] strange behaviour in 9.0.2 / ERROR: 22003: value out of range: overflow

2011-05-24 Thread Alban Hertroys
On 23 May 2011, at 22:53, rudi wrote: > On 20 Mai, 22:55, rudi wrote: >> Hi all, >> >> I feel like I hit a bug in postgres 9.0.2 with a query like this >> (there's actually a quite complicated view hidden behind), however >> note >> the 'IN' selection contains two identical keys. When I execute

Re: [GENERAL] disable seqscan

2011-05-24 Thread Alban Hertroys
On 24 May 2011, at 8:22, Nick Raj wrote: > One think i am not able to understand is, if i use ndpoint_overlap method it > is going for seq. scan every time but if i use && operator it is using index > scan. Why it is so? > Why these is happening? Tom already explained that, but in short: Becaus

Re: [GENERAL] Postgres questions

2011-05-24 Thread Trenta sis
Hi Craig, First of all, thanks for you answer. That I need is to connect to another databse (Cache Intersystems) to use select from Postgres. I have tried to configure dbilink but is not working with this database, with sql server seems to work but with poor peroformance. About second question I'

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread Alban Hertroys
On 24 May 2011, at 10:08, Adarsh Sharma wrote: > Dear all, > > I need to return the rows of a table which was also created in that procedure. > > I know it is very easy when the table is existed before and we can specify > like this to return > > create function a(integer) returns setof exist_

Re: [GENERAL] how to start a procedure after postgresql started.

2011-05-24 Thread jun yang
2011/5/24 Craig Ringer : > On 24/05/11 12:46, jun yang wrote: > >> thanks for the info,i am just not have such deep learn of pg internal, >> i am on user level,not hacker,so the mail is in pgsql-general,not >> hacker list. > > Then you really, really, REALLY don't want to start a thread within the

Re: [GENERAL] Postgres questions

2011-05-24 Thread Craig Ringer
On 05/24/2011 05:15 PM, Trenta sis wrote: That I need is to connect to another databse (Cache Intersystems) to use select from Postgres. I have tried to configure dbilink but is not working with this database, with sql server seems to work but with poor peroformance. You really need to be spec

[GENERAL] PostgreSQL 9.01 error database help

2011-05-24 Thread tuanhoanganh
I am running PostgreSQL 9.01 on windows 2008, RAID 10 with 4 disk. Yesterday, one of 4 disks RAID 10 error and I copy data directory to USB. Today, When I start postgresql i have error log 2011-05-24 17:20:01 ICT LOG: database system was shut down at 2011-05-24 02:40:49 ICT 2011-05-24 17:20:01 I

[GENERAL] postgres crash - illegal instruction

2011-05-24 Thread Jiří Pavlovský
Hi, I'v run into the following today: 2893LOG: server process (PID 24519) was terminated by signal 4: Illegal instruction Is this an error in postgres? I'm running 8.4.2 - yes, I should update. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] postgres crash - illegal instruction

2011-05-24 Thread Pavel Stehule
Hello Dne 24. května 2011 12:21 Jiří Pavlovský napsal(a): > Hi, > > I'v run into the following today: > >  2893LOG:  server process (PID 24519) was terminated by signal 4: Illegal > instruction > > Is this an error in postgres? > > I'm running 8.4.2 - yes, I should update. > what is operation sy

Re: [GENERAL] postgres crash - illegal instruction

2011-05-24 Thread Jiří Pavlovský
On 24.5.2011 12:40, Pavel Stehule wrote: Hello Dne 24. května 2011 12:21 Jiří Pavlovský napsal(a): Hi, I'v run into the following today: 2893LOG: server process (PID 24519) was terminated by signal 4: Illegal instruction Is this an error in postgres? I'm running 8.4.2 - yes, I should up

Re: [GENERAL] Error compiling sepgsql in PG9.1

2011-05-24 Thread Emanuel Calvo
2011/5/21 Devrim GÜNDÜZ : > On Sat, 2011-05-21 at 02:50 +0100, Kohei Kaigai wrote: >> As documentation said, it needs libselinux 2.0.93 or higher. >> This version supports selabel_lookup(3) for database object classes. > > AFAICS, we are not checking it during configure. It might be worth to > add

Re: [GENERAL] Returning Rows in Procedure

2011-05-24 Thread David Johnston
Create function a(int) Returns TABLE(col1 text) As $$ ... $$ Language 'plpgsql' On May 24, 2011, at 4:08, Adarsh Sharma wrote: > Dear all, > > I need to return the rows of a table which was also created in that procedure. > > I know it is very easy when the table is existed before and we c

Re: [GENERAL] Error compiling sepgsql in PG9.1

2011-05-24 Thread Kohei Kaigai
> 2011/5/21 Devrim GÜNDÜZ : > > On Sat, 2011-05-21 at 02:50 +0100, Kohei Kaigai wrote: > >> As documentation said, it needs libselinux 2.0.93 or higher. > >> This version supports selabel_lookup(3) for database object classes. > > > > AFAICS, we are not checking it during configure. It might be wor

Re: [GENERAL] Error compiling sepgsql in PG9.1

2011-05-24 Thread Kohei Kaigai
I noticed that selinux_sepgsql_context_path(3) was also got merged at libselinux-2.0.83. So, we could check correctness of library versions using existence of this function. Does this patch expectedly abort the configure script on older libselinux installation? I'm not available to setup Ubuntu

Re: [GENERAL] postgres crash - illegal instruction

2011-05-24 Thread Vick Khera
2011/5/24 Jiří Pavlovský : > I'v run into the following today: > >  2893LOG:  server process (PID 24519) was terminated by signal 4: Illegal > instruction > > Is this an error in postgres? > I'll tend to suspect hardware error, specifically memory corruption, or on-disk corruption of the binary.

[GENERAL] Views permision -- please help and suggestion

2011-05-24 Thread salah jubeh
I have two views A and B such that A depend on B. Both of them has the same permissions. when I excute SELECT * FROM A; ERROR: permission denied for relation B ** Error ** ERROR: permission denied for relation B SQL state: 42501 However, I can do SELECT * FROM B; H

Re: [GENERAL] PostgreSQL 9.01 error database help

2011-05-24 Thread Tom Lane
tuanhoanganh writes: > I am running PostgreSQL 9.01 on windows 2008, RAID 10 with 4 disk. > Yesterday, one of 4 disks RAID 10 error and I copy data directory to > USB. > Today, When I start postgresql i have error log > 2011-05-24 17:20:01 ICT LOG: database system was shut down at > 2011-05-24

Re: [GENERAL] Views permision -- please help and suggestion

2011-05-24 Thread Adrian Klaver
On Tuesday, May 24, 2011 6:50:38 am salah jubeh wrote: > I have two views A and B such that A depend on B. Both of them has the same > permissions. What are the permissions? > > > when I excute > > SELECT * FROM A; Who are you executing the above as? > > ERROR: permission denied for relat

[GENERAL] Postgresql CBT

2011-05-24 Thread sade_in
Hi, Id like to familiarize with postgresql and looking for a decent CBT but not able to find it. Could someone help pls? Sent from my iPhone -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-gener

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Scott Marlowe
On Tue, May 24, 2011 at 12:05 AM, wrote: > Hi, > > Id like to familiarize with postgresql and looking for a decent CBT but not > able to find it. Could someone help pls? CBT? Please define. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscrip

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Markus Wanner
On 05/24/2011 08:05 AM, sade...@yahoo.com wrote: > Id like to familiarize with postgresql and looking for a decent CBT but not > able to find it. Could someone help pls? And CBT is? (First hit on Google reads "Cognitive behavioral therapy", but I somehow doubt that's what you are interested in..

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Vick Khera
On Tue, May 24, 2011 at 10:33 AM, Scott Marlowe wrote: >> Id like to familiarize with postgresql and looking for a decent CBT but not >> able to find it. Could someone help pls? > > CBT?  Please define. > my guess is computer based training. -- Sent via pgsql-general mailing list (pgsql-gener

Re: [GENERAL] Error compiling sepgsql in PG9.1

2011-05-24 Thread Emanuel Calvo
2011/5/24 Kohei Kaigai : > I noticed that selinux_sepgsql_context_path(3) was also got merged at > libselinux-2.0.83. > So, we could check correctness of library versions using existence of this > function. > > Does this patch expectedly abort the configure script on older libselinux > installat

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Adrian Klaver
On Tuesday, May 24, 2011 7:35:02 am Markus Wanner wrote: > On 05/24/2011 08:05 AM, sade...@yahoo.com wrote: > > Id like to familiarize with postgresql and looking for a decent CBT but > > not able to find it. Could someone help pls? > > And CBT is? (First hit on Google reads "Cognitive behavioral

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Scott Marlowe
On Tue, May 24, 2011 at 8:36 AM, Vick Khera wrote: > On Tue, May 24, 2011 at 10:33 AM, Scott Marlowe > wrote: >>> Id like to familiarize with postgresql and looking for a decent CBT but not >>> able to find it. Could someone help pls? >> >> CBT?  Please define. >> > > > my guess is computer bas

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Reid Thompson
On 05/24/2011 10:49 AM, Scott Marlowe wrote: Oh good. My first response from google, with safe search turned off, was much more distressing... in other news, google trends for cbt just jumped -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscri

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread sade_in
Hi, Yes. Computer based training. Thanks Sent from my iPhone On 25/05/2011, at 0:38, Adrian Klaver wrote: > On Tuesday, May 24, 2011 7:35:02 am Markus Wanner wrote: >> On 05/24/2011 08:05 AM, sade...@yahoo.com wrote: >>> Id like to familiarize with postgresql and looking for a decent CBT but

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread fork
yahoo.com> writes: > > Hi, > > Yes. Computer based training. A psql prompt and the excellent postgresql documentation? (Sorry to be flip, but typing in examples and fixing mistakes and tweaking input was how I learned... Hopefully one of the consulting guys on the list will come back with

Re: [GENERAL] Views permision -- please help and suggestion

2011-05-24 Thread salah jubeh
Hello Adrian, I have changed the permission of one table where view B depend on and my problem is over. Still; the whole issue is confusing me. Regards From: Adrian Klaver To: pgsql-general@postgresql.org Cc: salah jubeh Sent: Tue, May 24, 2011 4:13:38 PM

Re: [GENERAL] Views permision -- please help and suggestion

2011-05-24 Thread Adrian Klaver
On 05/24/2011 10:04 AM, salah jubeh wrote: Hello Adrian, I have changed the permission of one table where view B depend on and my problem is over. Still; the whole issue is confusing me. See here for explanation: http://www.postgresql.org/docs/9.0/interactive/sql-createview.html "Access to tab

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Reid Thompson
On 05/24/2011 01:02 PM, fork wrote: A psql prompt and the excellent postgresql documentation? if you're concerned about mucking something up, download a postgresql livecd -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.po

Re: [GENERAL] Error compiling sepgsql in PG9.1

2011-05-24 Thread Kohei Kaigai
The attached patch enables to abort configure script when we run it with '--with-selinux' option, but libselinux is older than minimum requirement to SE-PostgreSQL. As the documentation said, it needs libselinux-2.0.93 at least, because this or later version support selabel_lookup(3) for databas

Re: [HACKERS] [GENERAL] Error compiling sepgsql in PG9.1

2011-05-24 Thread Robert Haas
2011/5/24 Kohei Kaigai : > The attached patch enables to abort configure script when we run it with > '--with-selinux' > option, but libselinux is older than minimum requirement to SE-PostgreSQL. > > As the documentation said, it needs libselinux-2.0.93 at least, because this > or later > version

[GENERAL] Postgres Triggers instead of requiring a field - fire when field not included

2011-05-24 Thread Kevin Traster
Hello, In Postgres 9.0, trying to prevent a recursive trigger by adding a column "notrigger". Psuedo code: create trigger before_update_holdings_table BEFORE UPDATE ON holdings FOR EACH ROW when (new.notrigger is not given) EXECUTE PROCEDURE before_update_holdings(); I see in the docs, I can do

Re: [GENERAL] Values larger than 1/3 of a buffer page cannot be indexed (hstore)

2011-05-24 Thread Tom Lane
Stefan Keller writes: > Hi Tom, hi all > Thanks, Tom, for your tipps. You answered 2011/5/1: >> (...), and there's no point in having the >> index column contents be the entire tags value (which is what's leading >> to the failure). Consider >> >> create index planet_osm_point_amenity on planet_

[GENERAL] Preventing OOM kills

2011-05-24 Thread Yang Zhang
PG tends to be picked on by the Linux OOM killer, so lately we've been forcing the OOM killer to kill other processes first with this script: while true; do for i in `pgrep postgres`; do echo -17 > /proc/$i/oom_adj done sleep 60 done Is there a Better Way? Thanks in advance. -- Sent

Re: [GENERAL] Preventing OOM kills

2011-05-24 Thread Andrej
On 25 May 2011 12:32, Yang Zhang wrote: > PG tends to be picked on by the Linux OOM killer, so lately we've been > forcing the OOM killer to kill other processes first with this script: > > while true; do >  for i in `pgrep postgres`; do >    echo -17 > /proc/$i/oom_adj >  done >  sleep 60 > done

Re: [GENERAL] Preventing OOM kills

2011-05-24 Thread Scott Marlowe
On Tue, May 24, 2011 at 6:50 PM, Andrej wrote: > On 25 May 2011 12:32, Yang Zhang wrote: >> PG tends to be picked on by the Linux OOM killer, so lately we've been >> forcing the OOM killer to kill other processes first with this script: >> >> while true; do >>  for i in `pgrep postgres`; do >>  

Re: [GENERAL] Preventing OOM kills

2011-05-24 Thread Devrim GÜNDÜZ
On Tue, 2011-05-24 at 17:32 -0700, Yang Zhang wrote: > PG tends to be picked on by the Linux OOM killer, so lately we've been > forcing the OOM killer to kill other processes first with this script: > > while true; do > for i in `pgrep postgres`; do > echo -17 > /proc/$i/oom_adj > done >

Re: [GENERAL] Preventing OOM kills

2011-05-24 Thread John R Pierce
On 05/24/11 5:50 PM, Andrej wrote: Add more RAM? Look at tunables for other processes on the machine? At the end of the day making the kernel shoot anything out of despair shouldn't be the done thing. somehow, 'real' unix has neither a OOMkiller nor does it flat out die under heavy loads, it

[GENERAL] unable to restore. pg_restore: implied data-only restore

2011-05-24 Thread Tim Uckun
I am trying to backup one database and restore it into a new schema in another database. Database1 has the tables in the public schema database2 has some tables in the public schema but their names will clash so the database needs to be stored in a different schema. I back up like this. /usr/bin/

Re: [GENERAL] Preventing OOM kills

2011-05-24 Thread Scott Marlowe
On Tue, May 24, 2011 at 7:01 PM, John R Pierce wrote: > On 05/24/11 5:50 PM, Andrej wrote: >> >> Add more RAM?  Look at tunables for other processes on >> the machine?  At the end of the day making the kernel shoot >> anything out of despair shouldn't be the done thing. > > somehow, 'real' unix ha

Re: [GENERAL] unable to restore. pg_restore: implied data-only restore

2011-05-24 Thread Tom Lane
Tim Uckun writes: > I am trying to backup one database and restore it into a new schema in > another database. Database1 has the tables in the public schema > database2 has some tables in the public schema but their names will > clash so the database needs to be stored in a different schema. Ther

Re: [GENERAL] unable to restore. pg_restore: implied data-only restore

2011-05-24 Thread Tim Uckun
> > There is no support for that built into pg_dump.  You could try: That's too bad. > > * dumping to a text script and doing search-and-replace for the schema > name on the script file. I did a dump without privileges or owners so I was thinking I could just replace the SET search_path = publi

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Greg Smith
On 05/24/2011 10:49 AM, Scott Marlowe wrote: On Tue, May 24, 2011 at 8:36 AM, Vick Khera wrote: On Tue, May 24, 2011 at 10:33 AM, Scott Marlowe wrote: Id like to familiarize with postgresql and looking for a decent CBT but not able to find it. Could someone help pls? CBT

Re: [GENERAL] unable to restore. pg_restore: implied data-only restore

2011-05-24 Thread Tom Lane
Tim Uckun writes: >> There is no support for that built into pg_dump. You could try: >> * dumping to a text script and doing search-and-replace for the schema >> name on the script file. > I did a dump without privileges or owners so I was thinking I could > just replace the > SET search_path =

Re: [GENERAL] Postgresql CBT

2011-05-24 Thread Greg Smith
On 05/24/2011 02:05 AM, sade...@yahoo.com wrote: Id like to familiarize with postgresql and looking for a decent CBT but not able to find it. Most PostgreSQL training happens in one of the following ways: -Self-learning using the manual or one of the PostgreSQL books -In-person training at sh