Re: [GENERAL] Postgresql 9.0.1 Corrupted

2011-07-18 Thread Craig Ringer
On 18/07/11 12:36, AI Rumman wrote: > At first, when I tried to start the server after CENTOS repair What is "CENTOS repair" ? Do you mean that you ran a file system check (fsck) and told it to repair file system damage? If so, you probably had file system corruption that damaged your data. Che

Re: [GENERAL] Postgresql 9.0.1 Corrupted

2011-07-18 Thread Craig Ringer
Please reply to the mailing list, not just to me. Use the "reply all" button if your email program doesn't support reply-to-list. > Yes I have the backup of the point where the db was corrupted. But no > backup. Ouch. I hope your data isn't too important to you. If your data is vital to you, you

Re: [GENERAL] Table dublicates values

2011-07-18 Thread Adrian Klaver
On 07/18/2011 12:39 AM, Deniz Atak wrote: CC'ing the list. Rob, yes, I have EJB 3.0 for ORM. Do you know how to turn on sql logging? I couldn't find a resource about that up to now. Google + glassfish sql logging found this: http://www.java.net/node/700613 To turn on/up Postgres logging se

Re: [GENERAL] C function returns null values

2011-07-18 Thread Gregor Trefs
Thanks for your answer. I edited my code, but still get these random null values. What else can I do ? Regards -Ursprüngliche Nachricht- Von: Tom Lane [mailto:t...@sss.pgh.pa.us] Gesendet: Freitag, 15. Juli 2011 16:24 An: Gregor Trefs Cc: pgsql-general@postgresql.org Betreff: Re: [GENER

Re: [GENERAL] C function returns null values

2011-07-18 Thread Tom Lane
Gregor Trefs writes: > Thanks for your answer. I edited my code, but still get these random null > values. What else can I do ? Mph ... you're aware that you have to start a fresh session to load a new version of a .so into the backend? regards, tom lane -- Sent via pg

Re: [GENERAL] C function returns null values

2011-07-18 Thread Gregor Trefs
Well, yes. I wrote a little make file which takes care of this part (except restarting the session): INCLUDEDIRS += -I$(shell pg_config --includedir-server) LIBDIR = -L$(shell pg_config --libdir) LIBINSTALL = $(shell pg_config --pkglibdir) integrated_c.so: integrated_c.c Makefile

Re: [GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-18 Thread Bruce Momjian
Guillaume Lelarge wrote: > On Fri, 2011-07-01 at 18:30 +0200, Olivier LEVESQUE wrote: > > Guillaume, > > > > Thank you for your answer, > > > > > > >> Creating databases in the new cluster > > >> psql:/opt/pgsql/bin/pg_upgrade_dump_globals.sql:38: ERROR: directory > > >> "/pgqdata/pgserver01/da

Re: [GENERAL] Documentation issue

2011-07-18 Thread Bruce Momjian
salah jubeh wrote: > Hello, > > In http://www.postgresql.org/docs/8.4/static/xfunc-c.html, there is a missing > include to the utils/geo_decls.h which leads to compilation errors. i.e > #include > "utils/geo_decls.h" > needs to be added to the code. Uh, which function sample is missing it? --

Re: [GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-18 Thread Guillaume Lelarge
On Mon, 2011-07-18 at 16:32 -0400, Bruce Momjian wrote: > Guillaume Lelarge wrote: > > On Fri, 2011-07-01 at 18:30 +0200, Olivier LEVESQUE wrote: > > > Guillaume, > > > > > > Thank you for your answer, > > > > > > > > > >> Creating databases in the new cluster > > > >> psql:/opt/pgsql/bin/pg_upg

Re: [GENERAL] Documentation issue

2011-07-18 Thread salah jubeh
#include "postgres.h" #include #include "fmgr.h" /* by value */ PG_FUNCTION_INFO_V1(add_one); Datum add_one(PG_FUNCTION_ARGS) { int32 arg = PG_GETARG_INT32(0); Best Regard Eng. Salah Al Jubeh PalestinePolytechnic University College of Applied Science Computer Science P.O.

Re: [GENERAL] Documentation issue

2011-07-18 Thread Bruce Momjian
salah jubeh wrote: > #include "postgres.h" #include #include "fmgr.h" /* by value */ > PG_FUNCTION_INFO_V1(add_one); Datum add_one(PG_FUNCTION_ARGS) { int32 > arg > = PG_GETARG_INT32(0); Great, this was fixed in Postgres 9.0. You can see it here: http://www.postgresql.org/d

Re: [GENERAL] Documentation issue

2011-07-18 Thread salah jubeh
Hello Bruce, Indeed; However, it would be nice to update also the documentation in 8.4 it will not take a lot of effort -:) Best Regard Eng. Salah Al Jubeh PalestinePolytechnic University College of Applied Science Computer Science P.O. Box 198 Mobile:++97259369122 Tel:++9754680

Re: [GENERAL] Documentation issue

2011-07-18 Thread Bruce Momjian
salah jubeh wrote: > Hello Bruce, > > Indeed; However, it would be nice to update also the documentation in 8.4 it > will not take a lot of effort -:) Uh, we don't normally backpatch such things. Sorry. --- > > > Best

[GENERAL] Alarm function in PL/pgSQL

2011-07-18 Thread Jon Smark
Hi, Is it possible to set an alarm within a PL/pgSQL function? By "alarm" I mean a function which is invoked some defined time in the future, even after the original function has terminated and returned a value to the client. I want an invocation of function FOO to set a "state" column of a give

Re: [GENERAL] pg_upgrade does not translate tablespace location to new cluster

2011-07-18 Thread John R Pierce
On 07/18/11 1:59 PM, Guillaume Lelarge wrote: Guillaume, I agree with your analysis. > Thanks :) Can we please trim quotes on responses? We really don't need a regurgitation of the entire 40 preceding messages to say 'thanks', just the part that you are referencing will suffice. If yo

Re: [GENERAL] Alarm function in PL/pgSQL

2011-07-18 Thread Merlin Moncure
On Mon, Jul 18, 2011 at 4:38 PM, Jon Smark wrote: > Hi, > > Is it possible to set an alarm within a PL/pgSQL function?  By "alarm" > I mean a function which is invoked some defined time in the future, > even after the original function has terminated and returned a value > to the client. > > I wan

[GENERAL] How to sum monetary variables

2011-07-18 Thread Martín Marqués
I'm building a table (which is a report that has to be printed) with a bunch of items (up to 300 in some cases) that have unitary price (stored in a numeric(9,2) field), how many there are, and the total price for each item. At the end of the table there is a total of all the items. The app is run

Re: [GENERAL] How to sum monetary variables

2011-07-18 Thread Merlin Moncure
2011/7/18 Martín Marqués : > I'm building a table (which is a report that has to be printed) with a > bunch of items (up to 300 in some cases) that have unitary price > (stored in a numeric(9,2) field), how many there are, and the total > price for each item. At the end of the table there is a tota

[GENERAL] Database level read only user

2011-07-18 Thread Hans C. Poo
Hi, Today a client ask me for help to create a read only user for a postgresql 8.2 database, i ended up reading, copying and pasting and finally creating a function i'm sharing with the list: CREATE OR REPLACE FUNCTION db_grant(usuario text, privilegio text) RETURNS INTEGER AS $$ DECLARE db R

Re: [GENERAL] Alarm function in PL/pgSQL

2011-07-18 Thread Jon Smark
Hi, > I don't think this is really possible with postgres PLs generally. > Typically what you have to do is have a function that is called on an > interval that checks for alarms and runs them. Thanks for the prompt reply. Just to clarify: you are saying that the function that is called with a g

Re: [GENERAL] Alarm function in PL/pgSQL

2011-07-18 Thread Darren Duncan
Jon Smark wrote: I don't think this is really possible with postgres PLs generally. Typically what you have to do is have a function that is called on an interval that checks for alarms and runs them. Thanks for the prompt reply. Just to clarify: you are saying that the function that is called

[GENERAL] Another unexpected behaviour

2011-07-18 Thread Shianmiin
setup: drop table if exists t1; create table t1 (f1 int); create unique index uix_t1 on t1(f1) ; insert into t1(f1) values (1), (2), (3); select * from t1; f1 --- 1 2 3 test statement: update t1 set f1 = f1 + 1; In PostgreSQL I got, ERROR: duplicate key value violates unique c

[GENERAL] Programmer ( Postgres), Milwaukee - offsite-Remote - onsite

2011-07-18 Thread MS Rao
Programmer ( Postgres), Milwaukee - offsite-Remote - onsite We are looking for Postgres skilled programmer with the following skills: Skills: Strong in Postgres SQl , Set up of database, Linux RDBMS expert and strong in design Possible to work onsite /offsite - Remote Interested candidates please

Re: [GENERAL] How to sum monetary variables

2011-07-18 Thread Craig Ringer
On 19/07/2011 6:04 AM, Merlin Moncure wrote: I wouldn't even bother testing client implementations that are using floating point numbers to do the math -- they are going to be wrong. If you snoop around you should find math libraries that handle do a better job handling exact numbers for most p

Re: [GENERAL] Alarm function in PL/pgSQL

2011-07-18 Thread Craig Ringer
On 19/07/2011 6:35 AM, Jon Smark wrote: Thanks for the prompt reply. Just to clarify: you are saying that the function that is called with a given periodicity must be so from *outside* PG, ie, from the client application, right? I mean, there is no way strictly internal to PG to have a function

Re: [GENERAL] How to sum monetary variables

2011-07-18 Thread Chris Travers
2011/7/18 Merlin Moncure : > 2011/7/18 Martín Marqués : >> I'm building a table (which is a report that has to be printed) with a >> bunch of items (up to 300 in some cases) that have unitary price >> (stored in a numeric(9,2) field), how many there are, and the total >> price for each item. At the

Re: [GENERAL] How to sum monetary variables

2011-07-18 Thread Chris Travers
BTW, since this is numeric() I would trust the Pg backend before I would trust the client languages. Best Wishes, Chris Travers -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] [ANNOUNCE] PostgreSQL conference China 2011 Announced!

2011-07-18 Thread Tatsuo Ishii
Galy Lee, Congratulations to the huge success of CPUG 2011! The conference was extremely well organized and attenders were very enthusiastic to learn PostgreSQL. And food was very good of course:-) I hope the Chinese PostgreSQL community is growing up taking advantage of the conference. -- Tatsu