Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jeff Davis
re are just a lot of self joins. Those are going to be hard for PostgreSQL to optimize effectively. Looks like it's just the query that's hard to understand. You might do better just writing it yourself from scratch. Regards, Jeff Davis -- Sent via pgsql-general mailing list (p

Re: [GENERAL] Query sometimes takes down server

2009-01-16 Thread Jeff Davis
stgreSQL (and humans) can understand well enough to optimize. Regards, Jeff Davis -- 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] Query sometimes takes down server

2009-01-15 Thread Jeff Davis
if you say why you are joining so many tables, and what the numbers are for. Regards, Jeff Davis -- 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] Query sometimes takes down server

2009-01-15 Thread Jeff Davis
plan chosen when the query times out > as well? > There's a new module coming in 8.4 that makes this much easier. Right now, you have to run it yourself with EXPLAIN ANALYZE as above. Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?

2009-01-14 Thread Jeff Davis
ather than waiting for PostgreSQL to do another release. Regards, Jeff Davis -- 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] A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?

2009-01-14 Thread Jeff Davis
On Wed, 2009-01-14 at 13:35 -0800, Jeff Davis wrote: > I think the best solution is to make first-class interval types (for > time as well as other types). Those intervals can then have operators > like "contains" and "contained by" which would solve your problem. >

Re: [GENERAL] A better BETWEEN for DATEs, TIMEs and TIMESTAMPs?

2009-01-14 Thread Jeff Davis
s). Those intervals can then have operators like "contains" and "contained by" which would solve your problem. Additionally, it would allow lots of other interesting operations, like overlaps and intersects. Regards, Jeff Davis -- Sent via pgsql-general mailing li

Re: [GENERAL] Unexpected behavior from psql

2009-01-11 Thread Jeff Davis
play all objects that are visible in the current schema search path — this is equivalent to using the pattern *. To see all objects in the database, use the pattern *.*. " Perhaps it could be a little clearer in the short descriptions, do you have a suggestion? Regards, Jeff Davis

Re: [GENERAL] Unexpected behavior from psql

2009-01-11 Thread Jeff Davis
| foo_table | table | tjhart > (2 rows) This behavior seems consistent to me. If you type an unqualified name like: SELECT * FROM foo_table; You'll get the one from the first namespace listed in search_path. It makes sense for "\d" to display only the tables that can be seen

[GENERAL] ordered pg_dump

2008-11-10 Thread Jeff Davis
ore, but I couldn't find the thread, so I don't know what conclusion was reached. Regards, Jeff Davis -- 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] Storing questionnaire data

2008-10-23 Thread Jeff Davis
es. Perhaps more can be done, but usually questionnaires are either too unimportant to really dig in, or so important that designing a database around it is the obvious thing to do. Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] statement_timeout by host?

2008-10-21 Thread Jeff Davis
R foo SET statement_timeout='2s'; Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] postgresql on 64-bit windows

2008-10-16 Thread Jeff Davis
s a thread here about possibly supporting 64-bit postgresql on windows: http://archives.postgresql.org/pgsql-hackers/2008-07/msg00081.php Are there major issues holding that back or is it just a lack of demand? Is there still active work going on? Regards, Jeff Davis -- Sent via pgs

Re: [GENERAL] Why Does UPDATE Take So Long?

2008-09-30 Thread Jeff Davis
the case with UPDATE) a new index entry must be made in each index to point to the new row. Regards, Jeff Davis -- 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] Why Does UPDATE Take So Long?

2008-09-30 Thread Jeff Davis
xpensive. There are some optimizations in 8.3 for when the same tuple gets updated many times, but that won't help you in this case. Regards, Jeff Davis -- 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] on duplicate key

2008-09-25 Thread Jeff Davis
onality? I > must admit that it would be handy some times ;-) > Shouldn't this kind of question be added to the FAQ? Here's a starting place: http://archives.postgresql.org/pgsql-hackers/2008-04/msg01475.php You can find other threads about the status of the work by browsing the mailing

Re: [GENERAL] Returning NEW in an on-delete trigger

2008-09-18 Thread Jeff Davis
vent types, so we couldn't throw a syntax error for such a reference. > A runtime error for a use of the variable might be possible, but a quick > look at the code doesn't make it look easy. > Here's a doc patch that may clear up some of the confusion. Regards,

Re: [GENERAL] Returning NEW in an on-delete trigger

2008-09-18 Thread Jeff Davis
his have recorded an > error or warning somewhere? This is a feature, not a bug. Sometimes you don't want to delete a record, and returning NULL is the way to do that. Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

Re: [GENERAL] Can interval take a value from a field?

2008-09-09 Thread Jeff Davis
ERROR: invalid input syntax for type interval: "expiration_value" This error is saying that it is trying to convert the string 'expiration_value' to an interval. What you really want it to convert the string value held inside a variable named "expiration_value" to an in

Re: [GENERAL] Subqueries in Check() -- Still Intentionally Omitted?

2008-09-02 Thread Jeff Davis
On Tue, 2008-09-02 at 19:22 -0400, Tom Lane wrote: > Jeff Davis <[EMAIL PROTECTED]> writes: > > My question is not why don't we allow subqueries in CHECK, my question > > is why do we allow stable/volatile functions? > > Historically we've allowed it

Re: [GENERAL] Subqueries in Check() -- Still Intentionally Omitted?

2008-09-02 Thread Jeff Davis
MIT; s2=> COMMIT; -- wrong! The only solution is a big lock, or at least to somehow figure out what kind of locks might be required. Regards, Jeff Davis -- 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] Subqueries in Check() -- Still Intentionally Omitted?

2008-09-02 Thread Jeff Davis
ECK will be violated. >From an arbitrary subquery in a CHECK, it's hard to determine what kind of locking semantics might be necessary for inserting transactions. I think this is precisely what triggers are for. You define the error condition and the locking semantics in one procedure.

Re: [GENERAL] Subqueries in Check() -- Still Intentionally Omitted?

2008-09-02 Thread Jeff Davis
; 10) ); We'd need some big locks for that to actually be a true declaration. All of this can be solved with triggered procedures, where you can define the locks as needed. Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] strange explain analyze output

2008-08-28 Thread Jeff Davis
ed rows) than the HashAgg? It estimated exactly the same number as it estimated for the output of the HashAgg. Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] strange explain analyze output

2008-08-27 Thread Jeff Davis
should be identical. Regards, Jeff Davis => explain analyze select -> a, b, c_max -> from -> (select a, max(c) as c_max from t group by a) dummy1 -> natural join -> (select a, b from t) dummy2;

Re: [GENERAL] Custom sort

2008-08-14 Thread Jeff Davis
ort by any column, or arbitrary expression or function. Regards, Jeff Davis -- 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] pg_locks "at-a-glance" view

2008-06-19 Thread Jeff Davis
iew an accurate way to interpret pg_locks? Regards, Jeff Davis -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] pg_locks "at-a-glance" view

2008-06-18 Thread Jeff Davis
#x27;t find a function to determine if two lock modes conflict. The function is somewhat thrown together so it may have a few problems; I just included it so people can run the example view. Regards, Jeff Davis CREATE OR REPLACE VIEW query_lock_wait AS SELECT l1.pid AS pid, a1.

Re: [GENERAL] Database design: Temporal databases

2008-06-18 Thread Jeff Davis
ble by providing the period data type (which is indexable). Regards, Jeff Davis -- 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] IN vs EXISTS

2008-06-12 Thread Jeff Davis
s above) quite quickly. Do you have an explanation for the slow IN performance? Do you mean Postgres is slow with a value list or a subquery or both? Is it because the execution of a particular plan is slow, or does some good plan not exist in Postgres? Regards, Jeff Davi

Re: [GENERAL] functions, transactions, key violations

2008-06-04 Thread Jeff Davis
on) independently. The general way to implement a relation constraint is by using LOCK TABLE to prevent other concurrent sessions from interfering (as you suggest above). This obviously has very bad performance, which is why UNIQUE indexes provide another synchronization mechanism at the sub- transacti

Re: [GENERAL] functions, transactions, key violations

2008-06-04 Thread Jeff Davis
on could still insert something after the UPDATE but before the INSERT, so the unique constraint violation can still occur. Regards, Jeff Davis -- 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] bloom filter indexes?

2008-06-03 Thread Jeff Davis
considered storing the key in its own two-column table with a UNIQUE index and having the partitions reference it? Regards, Jeff Davis -- 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] Converting empty input strings to Nulls

2008-05-31 Thread Jeff Davis
n ... You can replace your table with a view and use rules to transform the updates and inserts. Regards, Jeff Davis -- 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] How to modify ENUM datatypes?

2008-04-28 Thread Jeff Davis
lly equal to a new B? Similar concerns apply to other changes in ENUMs, and for that matter, they apply to the FK design, as well. I would say the *actual* rating is the combination of the rating name, and the version of the standards under which it was rated. Regards, Jeff

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-22 Thread Jeff Davis
normalization that requires the use of surrogate keys. The approach suggested by Scott Marlowe is normalized as well as being quite natural and simple. I think often this is overlooked as being "too simple", but it's a quite good design in many cases. Regards, Jeff Davis

Re: [GENERAL] PostgreSQL Replication with read-only access to standby DB

2008-03-25 Thread Jeff Davis
ace to do this because of the ZFS copy-on-write implementation. Regards, Jeff Davis -- 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] "=" or ":=" ?

2008-02-28 Thread Jeff Davis
. > > Thank you for your answer. I suggest to add a note in documentation ;-) I think that it is undocumented on purpose. "=" in SQL is generally for testing equality, and having one operator mean two completely different things can be confusing. Therefore, ":="

Re: [GENERAL] Queries w/ "computed" table names? (eval in Pg?)

2008-02-22 Thread Jeff Davis
g on how you want to use it, you may need to make it a set- returning function (a.k.a. table function). Regards, Jeff Davis ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Mac ordering with locales

2008-02-21 Thread Jeff Davis
locale, e.g. en_US, supposed to have identical behavior on any platform for which it's available? If there is a standard of some kind, is apple violating it? Regards, Jeff Davis ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Strict-typing benefits/costs

2008-02-14 Thread Jeff Davis
tocast. A few comments: * Keys should not behave differently from non-keys in comparisons. * I think the distinction you're trying to make is the casting of literals versus the casting of variables. All of the examples you gave involved literals. * If it's making

Re: [GENERAL] "advanced" database design (long)

2008-02-12 Thread Jeff Davis
ifficulty of conceptualizing data structures > as EAV is one of the big strikes against it. The quoted citation evidences Agreed. It has many other strikes as well: for instance, it's difficult to form any kind of meaningful predicate for a relation in an EAV design. Regards, Jeff

Re: [GENERAL] Empty to NULL conversion - Ruby - Postgres ?

2008-02-11 Thread Jeff Davis
uot; module that you are using. This issue did exist, and was fixed, but perhaps you have one version behind or something. Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Is PG a moving target?

2008-02-11 Thread Jeff Davis
ible) to get the 8.2 behavior back just by adding/modifying casts. If not, couldn't we just publish those casts so people can be backwards compatible if they want? Regards, Jeff Davis ---(end of broadcast)--- TIP 3: Ha

Re: [GENERAL] Test text value as interval

2008-02-07 Thread Jeff Davis
th it: http://www.postgresql.org/docs/8.3/static/plpgsql-control- structures.html#PLPGSQL-ERROR-TRAPPING Although: why do you want to generate your own error? It seems like it would probably be about the same as the error produced by the casting failure. Regards, Jeff Davis --

Re: [GENERAL] Does has_table_privilege() have a case bug

2008-02-05 Thread Jeff Davis
t; > ERROR: relation "public.account_text_table" does not exist PostgreSQL folds to lower case unless you put the name in double-quotes. Try putting the table name in double-quotes. E.g.: select has_table_privilege('johnf', 'public."Account_T

Re: [GENERAL] Empty to NULL conversion - Ruby - Postgres ?

2008-02-05 Thread Jeff Davis
you have this problem still, send an email to the ruby-pg-general mailing list (or post in the forum, or email me directly). Regards, Jeff Davis ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Out of Memory errors while running pg_dump

2008-02-05 Thread Jeff Davis
v) unlimited > If you are using FreeBSD, is it possible you ran into the kern.maxdsiz kernel tunable? It can only be adjusted at boot, I think. Regards, Jeff Davis ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Count

2008-01-23 Thread Jeff Davis
; > I have attempted the Select count method but it seems that I need something > more. > > If anyone has any thoughts it would be much appreciated. 1. what did you do? 2. what did you see? 3. what did you expect? Regards, Jeff Davis ---(end of bro

Re: [GENERAL] (un)grouping question

2008-01-21 Thread Jeff Davis
omevalue + random() AS somevalue FROM mytable WHERE uid NOT IN (SELECT MIN(uid) FROM mytable GROUP by somevalue) Disclaimer: I haven't actually tested this query, but it looks about right. Regards, Jeff Davis ---(end of broadcast)

Re: [GENERAL] (un)grouping question

2008-01-21 Thread Jeff Davis
UP BY somevalue; Also consider just doing: SELECT DISTINCT somevalue FROM mytable; ...if you don't need uid in the result set. Regards, Jeff Davis ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] 8.3beta bug or feature?

2008-01-10 Thread Jeff Davis
of the application. I don't think there's any way around fixing the application. You can still use 8.2 with tsearch2 (which still work great) until the mapper is fixed. What is the name of the third-party product? Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Kernel kills postgres process - help need

2008-01-09 Thread Jeff Davis
me other linux configuration options that make invocation of OOM killer less likely. Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[GENERAL] functional dependency tool

2007-12-29 Thread Jeff Davis
Is there an existing tool that can infer the functional dependencies implied by the keys in an existing database? Or just compute the canonical cover of a set of functional dependencies? Regards, Jeff Davis ---(end of broadcast)--- TIP 5

Re: [GENERAL] postgres8.3beta encodding problem?

2007-12-17 Thread Jeff Davis
been adjusted to match." Regards, Jeff Davis ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] record-based log shipping

2007-12-06 Thread Jeff Davis
n't know exactly what you mean by "record-based log shipping", but perhaps you're looking for something like Slony-I, which can be found here: http://www.slony.info Regards, Jeff Davis ---(end of broadcast)--- TIP 5: don

Re: [GENERAL] postgresql table inheritance

2007-11-30 Thread Jeff Davis
franca between two different applications at the same time. > Link. > Did you intend to include a URL? > One man's impedance mismatch is another man's layer of abstraction or > "comms protocol" :). > Good point. Regards, Jeff Davis

Re: [GENERAL] postgresql table inheritance

2007-11-30 Thread Jeff Davis
d be renamed. I think that was the point of the slashdot post: it creates confusion to call two separate concepts by the same name. Regards, Jeff Davis ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] postgresql table inheritance

2007-11-30 Thread Jeff Davis
uot; by C.J. Date and Hugh Darwen discusses this topic in Appendix E, and a related topic in Appendix D. They also propose, in detail with a lot of analysis, how they think that type inheritance should work in the set of chapters on the Inheritance Model, or "IM". Regards

Re: [GENERAL] postgresql table inheritance

2007-11-30 Thread Jeff Davis
of the code), while data in a database needs to be consistent across long periods of time. So, a well-designed database will hold facts that have meaning in the real world and from which inferences can be made. Mapping application data structures (which contain context- sensitive information and

Re: [GENERAL] EAV or not to EAV?

2007-11-25 Thread Jeff Davis
those records where a certain field has changed. EAV will give you many problems down the line, and I don't think it will solve anything for you. Regards, Jeff Davis ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Foreign keys and inheritance

2007-11-19 Thread Jeff Davis
st using multiple tables (like the alternative that I suggested) is the difference between vertically partitioning and horizontally partitioning. Both seem like good choices to me. Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Foreign keys and inheritance

2007-11-19 Thread Jeff Davis
lational design that is very flexible and doesn't require the PostgreSQL-specific "INHERITANCE" feature. You don't need to use natrual joins of course, it was just easier for this example. Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Impact of table scan on shared buffers

2007-11-13 Thread Jeff Davis
/4 will have almost no impact on shared buffers. Regards, Jeff Davis ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message

Re: [GENERAL] Postgres table size

2007-11-13 Thread Jeff Davis
alculations show that you could save up to (47*3 + 8)*29384048 = 4378223152. So you might save up to 4GB with 8.3! It would be fairly easy for you to check for yourself exactly how much by downloading the beta. Regards, Jeff Davis ---(end of broadcast)---

Re: [GENERAL] php and postgres - too many queries too fast?

2007-11-05 Thread Jeff Davis
be that some of your fields contain NULLs. In SQL, NULL=NULL is _not_ true (more specifically, it is NULL). To see what I mean, do "SELECT 1 WHERE NULL=NULL", it will return 0 rows. Regards, Jeff Davis ---(end of broadcast)--- T

Re: [HACKERS] [GENERAL] WAL archiving idle database

2007-10-29 Thread Jeff Davis
On Mon, 2007-10-29 at 14:20 -0400, Tom Lane wrote: > Jeff Davis <[EMAIL PROTECTED]> writes: > > One minor thing: I think it's still dependent on locale though, because > > the output of pg_controldata is locale-dependent, right? It would work > > fine for me, b

Re: [HACKERS] [GENERAL] WAL archiving idle database

2007-10-29 Thread Jeff Davis
ine for me, but it would be nice if there was something that could be released that anyone could use, including non-english installations. Also, did you publish your pg_clearxlogtail program anywhere? I think that would be helpful to many people, but I don't see it on pgfoundry. Rega

Re: [HACKERS] [GENERAL] WAL archiving idle database

2007-10-26 Thread Jeff Davis
base would not advance that location at all, and I'm still trying to understand Tom's proposal well enough to know whether that would be true or not. If this doesn't get changed, I think we should archive every archive_timeout seconds, rather than MAX(archive_timeout,check

Re: [HACKERS] [GENERAL] WAL archiving idle database

2007-10-26 Thread Jeff Davis
On Fri, 2007-10-26 at 18:47 -0400, Tom Lane wrote: > Jeff Davis <[EMAIL PROTECTED]> writes: > > What's happening is that you have a checkpoint_timeout of 5 minutes, and > > that checkpoint must write a checkpoint record in the WAL, prompting the > > archiving. >

Re: [HACKERS] [GENERAL] WAL archiving idle database

2007-10-26 Thread Jeff Davis
whole > system is healthy gets a lot more complicated if we stop sending > empty WAL files. > > Could this at least be a configurable option? > A good point. Keep in mind that even in the current system, your configuration is variable based on the checkpoint_timeout setting. Reg

Re: [GENERAL] WAL archiving idle database

2007-10-26 Thread Jeff Davis
docs/current/static/runtime-config-wal.html "When this parameter is greater than zero, the server will switch to a new segment file whenever this many seconds have elapsed since the last segment file switch." Regards, Jeff Davis --

Re: [GENERAL] WAL archiving idle database

2007-10-26 Thread Jeff Davis
ty space in WAL segments, you might look at "pg_clearxlogtail" written by Kevin Grittner (search the archives or pgfoundry). This allows you to gzip the files to basically nothing. Regards, Jeff Davis ---(end of broadcast)--- TIP

Re: [GENERAL] It's time to support GRANT SELECT,UPDATE,...,...,... ON database.* to username

2007-10-02 Thread Jeff Davis
l is that we would lose users...) (2) it's good advocacy, i.e. not rude, insulting, demanding, or vulgar Regards, Jeff Davis ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] It's time to support GRANT SELECT,UPDATE,...,...,... ON database.* to username

2007-10-02 Thread Jeff Davis
ole that needs access to a group of tables that all happen to be within a schema. This isn't critical, but for people who use an ORM that don't want to think about the database, it's handy. That being said, I'm not volunteering to write it, especially not in response to a rude

Re: [GENERAL] Strange behavior of TRIGGER

2007-10-02 Thread Jeff Davis
tead is just rely on the unique index to report an error. If you don't want an error, you should catch the error in pl/pgsql as described here: http://www.postgresql.org/docs/current/static/plpgsql-control- structures.html#PLPGSQL-ERROR-TRAPPING That will perform better and allow you to disreg

Re: [GENERAL] DAGs and recursive queries

2007-09-28 Thread Jeff Davis
know that all its children also need to be > reparented as well. Aren't there still some update anomolies with any schema representing a DAG? Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] DAGs and recursive queries

2007-09-27 Thread Jeff Davis
am also interested in graphs and trees in relational databases. Can you recommend any good books? I particularly like CJ Date as an author, but I can't find anything by him that specifically addresses this topic. Also, how exactly is the database denormalized by using ltree? Regards, Je

Re: [GENERAL] SPI shared memory ?

2007-09-21 Thread Jeff Davis
s, do you actually want access to postgresql's shared structures, or do you just want your own area? Regards, Jeff Davis ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] Is this good spec for a PostgreSQL server?

2007-09-19 Thread Jeff Davis
hance of a power supply failure, even if you don't have two independent circuits. Oh, and if you're running linux make sure to use a safe setting for these settings: vm.oom-kill vm.overcommit_ratio vm.overcommit_memory The default is not very safe for postgresql*. If a java process

Re: [GENERAL] pg_standby observation

2007-09-16 Thread Jeff Davis
. > Touching a file doesn't really prove its working either. > Right. It's the best I have now, however, and should detect "most" error conditions. Regards, Jeff Davis ---(end of broadcast)--- TIP 1: if posting/rea

Re: [GENERAL] getting min/max of two values

2007-09-15 Thread Jeff Davis
On Sat, 2007-09-15 at 12:40 +0500, rihad wrote: > How can I efficiently return the minimum/maximum of two given > expressions? Like SELECT MYMIN(a+b-c,d+e*f). > SELECT LEAST(a+b-c,d+e*f); SELECT GREATEST(a+b-c,d+e*f); Regards, Jeff Davis ---(end of

Re: [GENERAL] pg_standby observation

2007-09-13 Thread Jeff Davis
ions about logging options, etc. Regards, Jeff Davis ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

[GENERAL] pg_standby observation

2007-09-13 Thread Jeff Davis
intercept the "restored log file ... from archive" messages. Regards, Jeff Davis ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Jeff Davis
ou want than you think. If you have a trigger that issues a "NOTIFY foo" for any INSERT/UPDATE/DELETE, it will only generate one notification per transaction, and only as part of a successful COMMIT. Then, your application can check for this notification periodically or perhap

Re: [GENERAL] Sthange things happen: SkyTools pgbouncer is NOT a balancer

2007-09-11 Thread Jeff Davis
name in the > config MUST be unique. > You might look at pgpool-II, that can load balance queries. Regards, Jeff Davis ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Alternative to drop index, load data, recreate index?

2007-09-10 Thread Jeff Davis
bles while the indexes are being created. That might help reduce your downtime window. Regards, Jeff Davis ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] audit sql queries

2007-09-10 Thread Jeff Davis
nd should also record the other information that you need. This strategy may perform better than using a set-returning function. Regards, Jeff Davis ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to

Re: [GENERAL] URGENT: Whole DB down ("no space left on device")

2007-08-31 Thread Jeff Davis
nd email us when a partition gets above > > 90% full. > > > > Wow, Nagois seems like a superb tool. Thanks for the recommendation! > You might also consider OpenNMS. Regards, Jeff Davis ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] auditing in postgresql

2007-08-31 Thread Jeff Davis
nction is only called once. It sounds like I may need to beware of future changes, however. What is the small extra price for large tables though? Thanks for the help! Regards, Jeff Davis ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/

Re: [GENERAL] auditing in postgresql

2007-08-31 Thread Jeff Davis
t calls, which would then not be audited. Regards, Jeff Davis ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] auditing in postgresql

2007-08-31 Thread Jeff Davis
view log_yadda as > select yadda > union all select null, null, null from log_func(); > Interesting idea, I hadn't thought of that. Not perfect, but interesting. The "returns query" might help reduce the penalty of using a SRF. Maybe I'l

Re: [GENERAL] auditing in postgresql

2007-08-30 Thread Jeff Davis
is for logging, not auditing. There's some overlap, but logging doesn't seem to do everything that I need directly. Regards, Jeff Davis ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] auditing in postgresql

2007-08-30 Thread Jeff Davis
to discussions, etc. Regards, Jeff Davis ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] How to use Integer array in where IN clause parameter

2007-08-16 Thread Jeff Davis
> > However it does not work. ANy suggestion? It looks like you want to use: WHERE d_base.id = ANY(integer_array) Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] MVCC cons

2007-08-15 Thread Jeff Davis
s that use simple locking strategies can simply update the > record in place. I think in some databases that use locking, an INSERT can actually block a SELECT, and vice-versa. So wouldn't that mean PostgreSQL MVCC is better for INSERT performance? Regards, Jeff Davis -

Re: [GENERAL] PGSQL internals

2007-08-06 Thread Jeff Davis
want to read the actual internal working sequentially. Where > can I find this information? The source code is the best place. It's very well-commented, and even if you don't read C you can understand a lot about the internals just by reading the comments. Re

Re: [GENERAL] new line in psotgres

2007-08-06 Thread Jeff Davis
st put the newline directly in the SQL: INSERT INTO mytable(myattr) VALUES('first line second line third line'); Regards, Jeff Davis ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] What do people like to monitor (or in other words, what might be nice in pgsnmpd)?

2007-08-03 Thread Jeff Davis
me relevant pgfoundry projects: http://pgfoundry.org/projects/nagiosplugins/ http://pgfoundry.org/projects/pgtools/ Regards, Jeff Davis ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] why is the LIMIT clause slowing down this SELECT?

2007-08-02 Thread Jeff Davis
ase there is no filter on "score" at all, "score" is just a sort order. A compound index should give you what you want. Regards, Jeff Davis ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore yo

<    1   2   3   4   5   6   7   >