Re: [GENERAL] Out of control query

2008-12-19 Thread Craig Ringer
Jason Long wrote: > For some reason the search gets out of control and consumes all CPU. > [snip] > What seems strange to me is that one one core of my Quad core x5472 is > 100%. The others show minimal usage. Consuming all of one CPU is quite normal if a query requires a lot of CPU-intensive wo

Re: [GENERAL] Out of control query

2008-12-19 Thread Joshua D. Drake
On Fri, 2008-12-19 at 16:20 -0600, Jason Long wrote: > I have an inventory system based on PostgreSQL 8.3.5, JBoss, > Hibernate.. > > I have a query builder that lets users filter data in a fairly complex > way. > > For some reason the search gets out of control and consumes all CPU. > > I

[GENERAL] Out of control query

2008-12-19 Thread Jason Long
I have an inventory system based on PostgreSQL 8.3.5, JBoss, Hibernate.. I have a query builder that lets users filter data in a fairly complex way. For some reason the search gets out of control and consumes all CPU. I set my statement timeout to 2 minutes and this keeps the system from

Re: [GENERAL] Question about inscrutable cast syntax

2008-12-19 Thread Tom Lane
Kevin Murphy writes: > lastupdated timestamp without time zone DEFAULT > ('now'::text)::timestamp(6) with time zone NOT NULL > For my personal edification, I'd like to understand what's going on with > that first one! It's what the PG grammar converts CURRENT_TIMESTAMP(6) into. (We really oug

[GENERAL] Question about inscrutable cast syntax

2008-12-19 Thread Kevin Murphy
Two versions of an application differ in the way a particular column is defined. OLD: lastupdated timestamp without time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL NEW: lastupdated timestamp without time zone DEFAULT now() NOT NULL I believe these are both the result

Re: [GENERAL] [PGSQL 8.3.5] How to handle FKs with partitioning?

2008-12-19 Thread Merlin Moncure
On Fri, Dec 19, 2008 at 6:04 AM, Reg Me Please wrote: > Hi all. > > I need to implement something very similar to temporal table partitioning as > described in the documentation at chapter 5.9. > > My issues come from the fact that I have other tables that references (FKs) to > the table(s) to be

Re: [GENERAL] REVOKE CONNECT doesn't work in 8.3.5

2008-12-19 Thread Zoltan Boszormenyi
Tom Lane írta: > Zoltan Boszormenyi writes: > >> I have "trust" entries in pg_hba.conf because my machine is closed. >> I added some PG users, and one of them was used in: >> > > >> REVOKE CONNECT ON DATABASE zozo FROM hs; >> > > >> However, user "hs" can happily connect to data

Re: [GENERAL] REVOKE CONNECT doesn't work in 8.3.5

2008-12-19 Thread Tom Lane
Zoltan Boszormenyi writes: > I have "trust" entries in pg_hba.conf because my machine is closed. > I added some PG users, and one of them was used in: > REVOKE CONNECT ON DATABASE zozo FROM hs; > However, user "hs" can happily connect to database "zozo" > despite the REVOKE. Unless you had prev

Re: [GENERAL] How are locks managed in PG?

2008-12-19 Thread Thomas Kellerer
Alvaro Herrera, 19.12.2008 13:49: We use an in-memory lock manager for table- and page-level locks. For shared tuple locks, they are spilled to disk on an ad-hoc storage system (pg_multixact) when there is more than one shared locker. (Exclusive locks and single locker shared locks are stored d

Re: [GENERAL] How are locks managed in PG?

2008-12-19 Thread Alvaro Herrera
Thomas Kellerer wrote: > Basically there are two solutions: a lock manager that stores a map > for each "item" locked and the corresponding lock. This solution > doesn't scale well, because the "management overhead" is linear to the > number of locks. This is one of the reasons why one should avoi

[GENERAL] REVOKE CONNECT doesn't work in 8.3.5

2008-12-19 Thread Zoltan Boszormenyi
Hi, It seems REVOKE CONNECT doesn't work as advertised. I have "trust" entries in pg_hba.conf because my machine is closed. I added some PG users, and one of them was used in: REVOKE CONNECT ON DATABASE zozo FROM hs; However, user "hs" can happily connect to database "zozo" despite the REVOKE. D

[GENERAL] [PGSQL 8.3.5] How to handle FKs with partitioning?

2008-12-19 Thread Reg Me Please
Hi all. I need to implement something very similar to temporal table partitioning as described in the documentation at chapter 5.9. My issues come from the fact that I have other tables that references (FKs) to the table(s) to be partitioned. Those references are enforced by means of DRI statem

Re: [GENERAL] create a 'range' of dates/numbers?

2008-12-19 Thread Erwin Moller
A. Kretschmer schreef: In response to Erwin Moller : Hi, Is it possible to create a range of dates or numbers inside a query without wrining in procedural language? I am looking for something that creates some kind of 'temp table' inside a query. eg: generate_Series(): test=# sele

Re: [GENERAL] create a 'range' of dates/numbers?

2008-12-19 Thread Thomas Markus
try function generateseries thomas Erwin Moller schrieb: Hi, Is it possible to create a range of dates or numbers inside a query without wrining in procedural language? I am looking for something that creates some kind of 'temp table' inside a query. eg: [wrong/fantasy syntax] SELECT (1 to

Re: [GENERAL] How are locks managed in PG?

2008-12-19 Thread Thomas Kellerer
Thanks for the answer. I know the concept of MVCC (and the chapter in the manual) and how locks are applied in PG. What I would like to know how a lock (if it is acquired e.g. by doing an update) is technically managed inside PG. Basically there are two solutions: a lock manager that stores

Re: [GENERAL] create a 'range' of dates/numbers?

2008-12-19 Thread A. Kretschmer
In response to Erwin Moller : > Hi, > > Is it possible to create a range of dates or numbers inside a query > without wrining in procedural language? > I am looking for something that creates some kind of 'temp table' inside > a query. > eg: generate_Series(): test=# select * from generate_Ser

Re: [GENERAL] create a 'range' of dates/numbers?

2008-12-19 Thread Raymond O'Donnell
On 19/12/2008 10:28, Erwin Moller wrote: > Is it possible to create a range of dates or numbers inside a query > without wrining in procedural language? > I am looking for something that creates some kind of 'temp table' inside > a query. Have a look at the generate_series() function in the manua

Re: [GENERAL] create a 'range' of dates/numbers?

2008-12-19 Thread Grzegorz Jaśkiewicz
generate_series() http://www.postgresql.org/docs/8.3/interactive/functions-srf.html select generate_series(1,3); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] create a 'range' of dates/numbers?

2008-12-19 Thread Erwin Moller
Hi, Is it possible to create a range of dates or numbers inside a query without wrining in procedural language? I am looking for something that creates some kind of 'temp table' inside a query. eg: [wrong/fantasy syntax] SELECT (1 to 3 step 1) as number; desired output: number 1 2 3 I have be

Re: [GENERAL] How are locks managed in PG?

2008-12-19 Thread Allan Kamau
Postgres by default uses the MVCC (Multiversion Concurrency Control, MVCC) for concurrency control. This is a large topic and may require more explanation than a simple email response would easily provide. The well written PostgreSQL documentation has good explanation on this topic (http://www.post

Re: [GENERAL] Hi iam the beginner

2008-12-19 Thread Richard Huxton
Scott Marlowe wrote: > On Mon, Dec 15, 2008 at 11:02 PM, sai srujan wrote: >> Hi >> This is srujan and I am beginner of postgresql 8.1 and I have >> just stopped using mysql and i would like to use the dump (.sql file) >> created in it. I would like transfer the databases in my

Re: [GENERAL] Error: Operator does not exist: "char"=integer

2008-12-19 Thread Aarni
On Friday 19 December 2008 01:29:06 you wrote: > Aarni writes: > > "ERROR: operator does not exist: character varying = integer at > > character 286 HINT: No operator matches the given name and argument > > type(s). You might need to add explicit type casts." > > > > Quick fix to sql statements

[GENERAL] How are locks managed in PG?

2008-12-19 Thread Thomas Kellerer
Hi, I have a question on how PG manages lock information. Does this go through a central "lock manager" that manages the information which row is locked by which transactioni. Or is the lock information stored directly within the data blocks (so no central "data structure" would be needed)