Re: [GENERAL] new rows based on existing rows

2012-05-02 Thread Alban Hertroys
On 3 May 2012, at 24:00, Tom Lane wrote: > Andy Chambers writes: >> So ideally, I'd like to be able to do > >> insert into foo (a,b,foo_date) >> select a,b,now() from foo old where >> returning oid, old.oid > >> ...but this doesn't work. It seems you only have access to the table >> bei

Re: [GENERAL] SQLSTATE XX000 Internal Error 7

2012-05-02 Thread Ben Madin
G'day Tom, On 03/05/2012, at 11:57 AM, Tom Lane wrote: > Ben Madin writes: >> SQLSTATE[XX000]: Internal error: 7 ERROR: could not open file >> "base/102979/430122_fsm": Invalid argument > > [ scratches head ... ] AFAICS the only documented reason for open() to > fail with EINVAL on OS X is

Re: [GENERAL] SQLSTATE XX000 Internal Error 7

2012-05-02 Thread Tom Lane
Ben Madin writes: > SQLSTATE[XX000]: Internal error: 7 ERROR: could not open file > "base/102979/430122_fsm": Invalid argument [ scratches head ... ] AFAICS the only documented reason for open() to fail with EINVAL on OS X is [EINVAL] The value of oflag is not valid. which is

[GENERAL] logging query result size?

2012-05-02 Thread Ben Chobot
I'm not seeing anything in the docs, but is there a way in 9.1 to log the size of the query result in the same way that we can log the duration of the query? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailp

Re: [GENERAL] spanish locale question

2012-05-02 Thread Tulio
Hi there, Let me expand the collate situation. I´m from Perú and I have turned everything in postgresql.conf as 'es_PE.UTF-8' even the default_text_search_config = 'pg_catalog.spanish'. Even my Ubuntu 12.04 works in English I have es_PE locale too. In Spanish vowels as "u" is equal as "ú" or even

Re: [GENERAL] postgresql log indicate too many execute S_2:COMMIT

2012-05-02 Thread leo xu
my postgres version is 9.1.2.my machine is dell R710.3000 sessions connect to database concurrently,then doing some insert,delete,update. your meaning my database bottleneck is disk io slowly.i use local disk.i know transaction log need to wirte to disk. thanks.i will monitor it. -

Re: [GENERAL] Is there away to output a time stamp in a specified time zone with the time zone indicator (e.g. EDT)

2012-05-02 Thread Adrian Klaver
On 05/02/2012 03:59 PM, Matrix Guy wrote: I'm referring to US time zones here. I'd like to output a time stamp field in a specified time zone. I'd also like to display the time zone (e.g. EDT) at the end. Ideally, this output needs to adjust the numeric portions of the stamp for standard time vs

[GENERAL] SQLSTATE XX000 Internal Error 7

2012-05-02 Thread Ben Madin
G'day all, I'm going to go slowly on this, but I am intermittently (as in sometimes the query works fine, sometimes it stops after 5 minutes and I get the message) receiving the error message below on a long running query that is populating a newly created table with a PostGIS Geometry column.

Re: [GENERAL] Advisory Locks and Prepared Transactions

2012-05-02 Thread Tom Lane
[ sorry for slow response ] Stephen Rees writes: > Code that works on Pg8.3 raises an error on Pg9.1, is this a bug? Yes, it sure looks that way. Somebody decided they could mark userlocks as transactional, which was probably a bad idea altogether, and certainly wasn't followed up on adequately

Re: [GENERAL] Limit the normal user to see system catalog or not??? And create privilege???

2012-05-02 Thread Bruce Momjian
On Wed, May 02, 2012 at 04:03:01PM -0700, Adrian Klaver wrote: > On 05/02/2012 11:42 AM, Bruce Momjian wrote: > > On Wed, Mar 28, 2012 at 01:54:58PM -0700, Adrian Klaver wrote: > >> On 03/28/2012 09:54 AM, leaf_yxj wrote: > >>> For oracle, the normal user can't see all the system catalog. but for >

Re: [GENERAL] Re: How to insert random character data into tables for testing purpose. THanks.

2012-05-02 Thread Bruce Momjian
On Wed, May 02, 2012 at 11:03:47AM -0700, leaf_yxj wrote: > Hi Andreas, > > Thanks a lot. > > I tried those following , they work. > > 1) insert into test values ( generate_series(1,1000), > md5(random()::text)); > > > 2) create table t_random as select s, md5(random()::text) from > ge

Re: [GENERAL] Limit the normal user to see system catalog or not??? And create privilege???

2012-05-02 Thread Adrian Klaver
On 05/02/2012 11:42 AM, Bruce Momjian wrote: > On Wed, Mar 28, 2012 at 01:54:58PM -0700, Adrian Klaver wrote: >> On 03/28/2012 09:54 AM, leaf_yxj wrote: >>> For oracle, the normal user can't see all the system catalog. but for >>> postgresql, it looks like all the user can see the system catalog.

[GENERAL] Is there away to output a time stamp in a specified time zone with the time zone indicator (e.g. EDT)

2012-05-02 Thread Matrix Guy
I'm referring to US time zones here.  I'd like to output a time stamp field in a specified time zone.  I'd also like to display the time zone (e.g. EDT) at the end.  Ideally, this output needs to adjust the numeric portions of the stamp for standard time vs daylight time and then display EST or

Re: [GENERAL] new rows based on existing rows

2012-05-02 Thread Tom Lane
Andy Chambers writes: > So ideally, I'd like to be able to do > insert into foo (a,b,foo_date) > select a,b,now() from foo old where > returning oid, old.oid > ...but this doesn't work. It seems you only have access to the table > being modified in a returning clause. Hm ... it is kin

[GENERAL] pqlib garbage collection

2012-05-02 Thread Alexander Reichstadt
Hi, regarding pqlib, from what I gather it is with garbage collection supported, yes? If so, is PQclear a left-over or still mandatory for avoiding leaks? Thanks Alex -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.pos

Re: [GENERAL] PLR Help

2012-05-02 Thread Daniel Cole
Joe, Thats IT Thanks so much. I can't believe I missed that but I have gone crazy trying to figure that out and all that time I was just missing the "/usr/lib/R/lib/" in the ld.so.conf . Once I put that in and ran ldconfig, all was happy. Thanks so much. side note.. I did spend a little

Re: [GENERAL] Difference between speed of 2 functions: SQL+STABLE and PLPGSQL+EXECUTE

2012-05-02 Thread Dmitry Koterov
Albe, thanks for detailed explaination. But it's quite strange that SQL+STABLE function does not recalculate the plan each time it is called. Because when I use a bunch of SQL+STABLE functions in e.g. a sub-select of a complex query, I see in the plan of this complex queries that function calls ar

Re: [GENERAL] psql latex and newlines

2012-05-02 Thread Bruce Momjian
On Tue, Apr 10, 2012 at 03:18:27PM +0200, Wim Bertels wrote: > On vr, 2012-03-30 at 16:25 +0200, Wim Bertels wrote: > > On do, 2012-03-15 at 16:34 -0300, Alvaro Herrera wrote: > > > Excerpts from Wim Bertels's message of jue feb 23 12:46:29 -0300 2012: > > > > > > > > the problem arises when u have

Re: [GENERAL] PLR Help

2012-05-02 Thread Joe Conway
On 05/02/2012 10:59 AM, Joe Conway wrote: > First, go find lib.R.so. Assuming it is in the above location, place ^-- oops, I meant libR.so Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Supp

Re: [GENERAL] PLR Help

2012-05-02 Thread Joe Conway
On 05/02/2012 03:01 AM, Daniel Cole wrote: > I finally got R to make after some help on this list, but now I am Does this imply you built R from source, or did you actually install R and R dev from deb packages? If you built R from source you need to use the correct configure switch to ensure the

Re: [GENERAL] Limit the normal user to see system catalog or not??? And create privilege???

2012-05-02 Thread Bruce Momjian
On Wed, Mar 28, 2012 at 01:54:58PM -0700, Adrian Klaver wrote: > On 03/28/2012 09:54 AM, leaf_yxj wrote: > >For oracle, the normal user can't see all the system catalog. but for > >postgresql, it looks like all the user can see the system catalog. Should > >we limit the user read privilege to syst

[GENERAL] Re: How to insert random character data into tables for testing purpose. THanks.

2012-05-02 Thread leaf_yxj
Hi Andreas, Thanks a lot. I tried those following , they work. 1) insert into test values ( generate_series(1,1000), md5(random()::text)); 2) create table t_random as select s, md5(random()::text) from generate_Series(1,5) s; Thanks. Regards. Grace -- View this message in context:

Re: [GENERAL] new rows based on existing rows

2012-05-02 Thread Chris Angelico
On Wed, May 2, 2012 at 10:52 PM, Andy Chambers wrote: > So ideally, I'd like to be able to do > > insert into foo (a,b,foo_date) >  select a,b,now() from foo old where >  returning oid, old.oid > > ...but this doesn't work.  It seems you only have access to the table > being modified in a ret

Re: [GENERAL] Which Java persistence library would you use with PostgreSQL?

2012-05-02 Thread Radosław Smogura
Hello, I suggest You to use Hibernate. Hibernate has many ways to optimize or fix some situations for particular database, if you allow to edits generated annotations for specific classes. In any case I suggest you to check usage of BLOB. PostgreSQL has two ways to handle this byte[] and large

Re: [GENERAL] How to insert random character data into tables for testing purpose. THanks.

2012-05-02 Thread Andreas Kretschmer
leaf_yxj wrote: > Hi Guys, I want to insert the random character data into tables for testing > purpose. > I created a table as follows : > > create table test ( id int, b char(100)); > > I need to insert 10 rows into this table. I know how to insert > generate_series into coloumn ID. But

[GENERAL] Removal of BSDi, BSD/OS port

2012-05-02 Thread Bruce Momjian
I assume there are no current users of the BSDi, BSD/OS port that are going to be upgrading to Postgres 9.2. Therefore, I propose removal of that port in Postgres 9.2. Any objections? -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.co

Re: [GENERAL] Uppercase to lowercase trigger?

2012-05-02 Thread Chris Angelico
On Wed, May 2, 2012 at 10:33 PM, Chrishelring wrote: > Hi, > > I´ve got some tables with column names in lowercase. Before updatering these > tables I want to add a trigger that can convert these lowercase to > uppercase, and when the tables are updates convert them back to lowercase.. Not entire

[GENERAL] How to insert random character data into tables for testing purpose. THanks.

2012-05-02 Thread leaf_yxj
Hi Guys, I want to insert the random character data into tables for testing purpose. I created a table as follows : create table test ( id int, b char(100)); I need to insert 10 rows into this table. I know how to insert generate_series into coloumn ID. But I don't how to insert the Random

[GENERAL] How to insert random character data into tables.

2012-05-02 Thread leaf_yxj
-- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-insert-random-character-data-into-tables-tp5680962.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes t

Re: [GENERAL] PLR Help

2012-05-02 Thread Steve Crawford
On 05/02/2012 05:01 AM, Daniel Cole wrote: Ubuntu 10.04, Lucid Everything below installed by apt-get: Postgres 9.1 Postgres 9.1 dev PostGis R-base R-base-Dev I have wanted to install the PLR via the postgresql-9.1.-plr package, but there doesn't seem to be one for 10.04. 9.1 is the standard v

Re: [GENERAL] How do I setup this Exclusion Constraint?

2012-05-02 Thread Misa Simic
Hi, I think yes... Just should add WHERE on the end of EXCLUDE... Sent from my Windows Phone From: bradford Sent: 02/05/2012 16:02 To: Misa Simic Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How do I setup this Exclusion Constraint? It works w/o that range datatype, which I had no id

Re: [GENERAL] How do I setup this Exclusion Constraint?

2012-05-02 Thread bradford
It works w/o that range datatype, which I had no idea existed in 9.2. Anyway, another question. I have col2 as a status of 'pending', 'approved', 'rejected', 'canceled'. I want to exclude overlaps for 'pending' and I want to exclude overlaps for 'approved'. All others can have overlaps. Is this

Re: [GENERAL] SQL functions not being inlined

2012-05-02 Thread Tom Lane
Evan Martin writes: > This worked... at first. I did some simple queries and they showed the > function being inlined (index scan on primary key, seq scan - no > function scan). Very happy with that, I tried changing some other > functions (that depend on these) and then found that the _asof fu

Re: [GENERAL] Significance of Postgres (version 9.1.1) Compilation parameters - Performance

2012-05-02 Thread Albe Laurenz
Jayashankar K B wrote: > Could anyone explain me the significance of the following compile time parameters ? > > 1. --disable-integer-datetimes > > 2. --disable-float4-byval > > 3. --disable-float8-byval > > > > Do they have any effect on performance of postgres w.r.t speed of dat

[GENERAL] new rows based on existing rows

2012-05-02 Thread Andy Chambers
Hi, I frequently have a need to insert new rows into a table that are based on existing rows but with small changes. This is easy using something like insert into foo (a,b,foo_date) select a,b,now() from foo old where returning oid However in the application layer, I need to know which

Re: [GENERAL] SQL functions not being inlined

2012-05-02 Thread Evan Martin
OK, it's now changed back again! I suspended the virtual machine in which PostgreSQL runs, later resumed it, did some unrelated queries (SELECT only) and then ran the exact same query as before. It now returns in 15 ms and uses the index. Here's the query plan: Index Scan using pk_thing_timesl

[GENERAL] Uppercase to lowercase trigger?

2012-05-02 Thread Chrishelring
Hi, I´ve got some tables with column names in lowercase. Before updatering these tables I want to add a trigger that can convert these lowercase to uppercase, and when the tables are updates convert them back to lowercase.. I´ve looked at several examples without any luck. Could someone put me in

[GENERAL] PLR Help

2012-05-02 Thread Daniel Cole
Ubuntu 10.04, Lucid Everything below installed by apt-get: Postgres 9.1 Postgres 9.1 dev PostGis R-base R-base-Dev I have wanted to install the PLR via the postgresql-9.1.-plr package, but there doesn't seem to be one for 10.04. I finally got R to make after some help on this list, but now I am

RE : [GENERAL] Postgres 8.x on Linux : how to use HugePages

2012-05-02 Thread STERBECQ Didier
Thanks Zoltan, I try it on Kernel Linux 2.6.18 ( RedHat 5.2) 64 bits, it works. I add that ulimit "memlock" (-l) had to be increased for the Postgres runner, up to the size of the shared memory required by Postgres. Didier Sterbecq. Mail : didier.sterb...@rapt.fr -Message d'origine-

Re: [GENERAL] Which Java persistence library would you use with PostgreSQL?

2012-05-02 Thread Sumit Raja
> value="jdbc:postgresql://localhost:5432/MySampleDb"/> > > If you add ";create=true" just as in the example above, it breaks the code > and you get this as a result: > > org.postgresql.util.PSQLException: FATAL: database "MySampleDb;create=true" > does not exist "create=true" is a Derby specific

Re: [GENERAL] Which Java persistence library would you use with PostgreSQL?

2012-05-02 Thread Bata Degen
To be more specific: When using Hibernate+Derby then in your persistence.xml there's a line like this: value="jdbc:derby://localhost:1527/MySampleDb;create=true"/> If you are using PostgreSQL the line would look like this: value="jdbc:postgresql://localhost:5432/MySampleDb"/> If you add ";c

[GENERAL] updating 6million rows, slowdown every 5minutes, manually doing checkpoints?

2012-05-02 Thread Gábor Farkas
hi, i have a table where i need to update 7million rows. i'm trying to do this without a downtime, but doesn't matter what i do, i get massive slowdowns every 5 minutes. details: the table's schema contains 6integers, 2timestamps, 1 varchar, and 1text. i added a new text-field (currently null), a

Re: [GENERAL] Postgres 8.x on Linux : how to use HugePages

2012-05-02 Thread Boszormenyi Zoltan
Hi, 2012-05-02 11:28 keltezéssel, STERBECQ Didier írta: We think of using Linux HugePages to isolate shared memory used by Postgres, hoping that we got more performance. I see some souce code samples for doing that, but I do not see any information about compatibility : Postgres 7.x, 8.x,

[GENERAL] Significance of Postgres (version 9.1.1) Compilation parameters - Performance

2012-05-02 Thread Jayashankar K B
Hi All, Could anyone explain me the significance of the following compile time parameters ? 1. --disable-integer-datetimes 2. --disable-float4-byval 3. --disable-float8-byval Do they have any effect on performance of postgres w.r.t speed of database insert/select, amount of CPU u

[GENERAL] Postgres 8.x on Linux : how to use HugePages

2012-05-02 Thread STERBECQ Didier
We think of using Linux HugePages to isolate shared memory used by Postgres, hoping that we got more performance. I see some souce code samples for doing that, but I do not see any information about compatibility : Postgres 7.x, 8.x, 9.x about recommandations Thanks by advance.