Re: [GENERAL] downloading and installing postgreSQL

2007-10-17 Thread Erik Jones
none of the Postgres lists are appropriate places for top-posting (I moved your response to the bottom). Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit

Re: [GENERAL] [OT] xkcd - A webcomic of romance, sarcasm, math, and language

2007-10-12 Thread Erik Jones
On Oct 12, 2007, at 2:40 PM, John D. Burger wrote: DB-related humor: http://xkcd.com/327/ Yes, there have been many great xkcd comics, but that one should go down in history. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma

Re: [GENERAL] replicating to a stopped server

2007-10-12 Thread Erik Jones
. Are you restricted to keep that second server in that special run- level? If not, I'd consider using pg_standby with WAL archiving to keep your failover server at most a handful of minutes behind. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.

[GENERAL] max_*, shared_buffers, and shared memory

2007-10-12 Thread Erik Jones
ffers" but the comment in the config for max_connections mentions raising shared_buffers to accommodate more. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visi

Re: [GENERAL] Postgres 8.2.5 compilation problem on OpenSolaris/Solaris

2007-10-11 Thread Erik Jones
se in shared libraries (small model). Permits references to, at most, 2**11 unique external symbols. So, with x86 architectures, -KPIC only works with the small model whereas you've defined the medium model. My bet is that you need to do away with the -KPIC flag. Erik Jones Software

Re: [GENERAL] XMIN semantic at peril ?

2007-10-11 Thread Erik Jones
ainly not a scenario you should dismiss as not credible because of timescales. If the query is always based on a primary key + XMIN, and since vacuum is the only thing that sets FrozenTransactionId, would it be unsane to change the update to - update row with "... where pk=... and XMIN I

Re: [GENERAL] 8.2.4 selects make applications wait indefinitely

2007-10-10 Thread Erik Jones
he 8.2.5 to fix this issue. Am I thinking right? Would appreciate any other suggestions. Thank you very much in advance. Reimer Are all of these remote connections from the same machine? Did you upgrade your client postgres libraries on your remote machine(s) as well? Erik Jones S

Re: [GENERAL] <> ALL( ... ) and <> ANY ( ... ) didn't behave as expected

2007-10-10 Thread Erik Jones
eir children is not a boy." So, for a parent with both a boy and a girl, the boy is not a girl and the girl is not a boy. You could replace the <> ANY with a simple IN as then it would be "Give me all parents who have both a boy and a girl." Erik Jones Software Deve

Re: [GENERAL] disjoint union types

2007-10-10 Thread Erik Jones
FROM shapes shape_id 1 area 78.5398 This works to store the area of the shape, but doesn't allow me to work with work with more complicated structures. I'll try and think up a better example and send it along to the list when I can describe it. Erik Jones Software Devel

Re: [GENERAL] Generating subtotal reports direct from SQL

2007-10-09 Thread Erik Jones
amount FROM (SELECT ID, code, amount FROM table_name UNION SELECT null, code, sum(amount) FROM table_name GROUP BY code) t ORDER BY code, test1_id Note that I didn't test that Erik Jones Software Developer | Emma® [EMAI

Re: [GENERAL] Solutions for listening on multiple ports?

2007-10-09 Thread Erik Jones
refer to not resort to kernel-level netfilter trickery to accomplish this, if possible. You can separate listen addresses with commas: listen_address = '127.0.0.1,192.168.0.1' AFAIK, you only get one port per cluster. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 o

Re: [GENERAL] disjoint union types

2007-10-09 Thread Erik Jones
orks, but it's sometimes a bit of a headache turning things around so they fit this structure. Are there standard solutions to this that work better? You could use after triggers on your circle and shape tables to automatically make the insert into shapes for you. Erik Jones Sof

Re: [GENERAL] Foreign Key for PHP serialized data - possible?

2007-10-08 Thread Erik Jones
the problem you're trying to solve, not the serialization issue you're having above. I recommend changing your schema. I, also, agree. The "problem" you're trying to avoid with having separate tables for colors, kinds, etc. is exactly what a relational data

Re: [GENERAL] Partitioned tables, rules, triggers

2007-10-05 Thread Erik Jones
stgres Day and OSCON just a couple of months ago I couldn't really ask my company to cover another trip to the same place so soon. But, there's always PGCon next May! Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emm

Re: [GENERAL] Generating TRUNCATE orders

2007-10-03 Thread Erik Jones
c.relkind IN ('r' ) AND nc.nspname = 'my_schema' ORDER BY relname Or, just: SELECT 'TRUNCATE ' || schemaname || '.' || tablename ';' FROM pg_tables WHERE schemname='my_schema' ORDER BY tablename; Erik Jones Software Developer | Emma® [EMAIL

Re: [GENERAL] pg_cancel_backend() does not work with buzz queries

2007-10-03 Thread Erik Jones
least some idea of what these processes are (or, are not) doing, run an strace (or your OS's equivalent) on the process before killing it. Let us know what you see there. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma he

Re: [GENERAL] datestyle question

2007-10-02 Thread Erik Jones
r of date fields. Here is the code, in case anyone need it. I'm glad you got something working. However, out of morbid curiousity I have to ask: why did you use C for that when you could have done it with at most a three line script or even one line directly from the shell? Erik Jon

Re: [GENERAL] Upgrading PG

2007-10-01 Thread Erik Jones
do a dump/ restore using the new version's pg_dump and pg_restore apps. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http://www.m

Re: [GENERAL] datestyle question

2007-09-26 Thread Erik Jones
use, the particular field name could be used but I think that would probably work a little differently on the backend although not being involved with the backend I'm no expert. Just a random idea anyway. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.29

Re: [GENERAL] datestyle question

2007-09-26 Thread Erik Jones
1.c The simplest thing I can think of in your case would be to do a little bit of text processing on that field before inserting it. If you simply insert dashes between the different fields so that you have DD-MM-YYY then you can do SET DateStyle TO 'DMY'; and then your copy

Re: [GENERAL] A few basic troubleshooting questions

2007-09-25 Thread Erik Jones
ty. 4) How do I determine in general if the db has a memory bottleneck vs CPU bottleneck vs I/O bottleneck? I know about pg_statio, just not sure how to guage where the db is the most constrained. You will need OS tools to handle those metrics. Look into vmstat and ipcs for memory, i

Re: [GENERAL] pg_dumping large objects

2007-09-24 Thread Erik Jones
chanism only handles up to 1GB values. So, they are not specialized versions of any other data type, they are their own, separate data type. http://www.postgresql.org/docs/8.2/interactive/largeobjects.html Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.58

Re: [GENERAL] Return t/f on existence of a join

2007-09-21 Thread Erik Jones
ate a query that returned a TRUE/FALSE column that checks if there is a 'baz' record for a specified 'bar_id' in all 'foo_id's in one query? I hope this isn't too muddy. I think part of my problem is I am having trouble even visualizing my question... T

Re: [GENERAL] Migrating from 32 bit to 64 bit binaries

2007-09-21 Thread Erik Jones
On Sep 21, 2007, at 12:02 PM, Alvaro Herrera wrote: Erik Jones wrote: Just a quick question. Are there any issues or incompatibilities that I should be aware of if I want to build out 64 bit binaries to run on a db that's previously been run by 32 bit binaries? Obviously yo

Re: [GENERAL] Migrating from 32 bit to 64 bit binaries

2007-09-21 Thread Erik Jones
On Sep 21, 2007, at 11:59 AM, Joshua D. Drake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Erik Jones wrote: Just a quick question. Are there any issues or incompatibilities that I should be aware of if I want to build out 64 bit binaries to run on a db that's previously

[GENERAL] Migrating from 32 bit to 64 bit binaries

2007-09-21 Thread Erik Jones
Just a quick question. Are there any issues or incompatibilities that I should be aware of if I want to build out 64 bit binaries to run on a db that's previously been run by 32 bit binaries? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292

Re: [GENERAL] autovacuum

2007-09-20 Thread Erik Jones
nk it should take so long... Why does everyone leave of the IO subsystem? It's almost as if many people don't realize that disks exist ... I have disks? You ARE have disks ;) Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.

Re: [GENERAL] For index bloat: VACUUM ANALYZE vs REINDEX/CLUSTER

2007-09-19 Thread Erik Jones
On Sep 19, 2007, at 11:00 AM, Richard Broersma Jr wrote: --- Erik Jones <[EMAIL PROTECTED]> wrote: Also, note that once we have HOT... I am not sure what the acronym "HOT" stands for. Does it have something to do with MVCC? Heap Only Tuple. Here's a link to the

Re: [GENERAL] For index bloat: VACUUM ANALYZE vs REINDEX/CLUSTER

2007-09-19 Thread Erik Jones
t. Also, note that once we have HOT, figuring out fill factor for indexes will be a whole different ball game. Currently, an update to any tuple in a table, results in a new index entry. With hot, index entries will only happen if the indexed column is changed in the update. Erik Jones

Re: [GENERAL] For index bloat: VACUUM ANALYZE vs REINDEX/CLUSTER

2007-09-19 Thread Erik Jones
ble/ index sees a lot of updates. For my example where each tuple sees only one update, the index default fill factor of 90% is probably fine. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywher

Re: [GENERAL] ON INSERT => execute AWK/SH/EXE?

2007-09-18 Thread Erik Jones
, thanks for telling. Thanks for reading, any help is appreciated. You could use a trigger function in an untrusted procedural language such as plperlu or plpythonu to do that. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps

Re: [GENERAL] postgres catalog files problem

2007-09-17 Thread Erik Jones
g files if i do that? Josh If you can successfully drop those tables, then yes. Given that this is just a test database, if you have any issues doing that, I'd scrap the whole database. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.07

Re: [GENERAL] postgres catalog files problem

2007-09-17 Thread Erik Jones
in pg_depend (as well as others) so that when you try to access that table it isn't finding the related, dependant objects. Others may know more, but I don't know enough to help you get your catalogs back in order past restoring from a backup. Also, if I were you I'd

Re: [GENERAL] postgres catalog files problem

2007-09-17 Thread Erik Jones
Have you had any other kind of abnormal performance issues (other errors, system crashes, etc...)? The more info you give, the better help you can receive. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everyw

Re: [GENERAL] Inserting a timestamp in a "timestamp" column.

2007-09-14 Thread Erik Jones
mp into (i.e. in the format returned by Perl's or PHP's time()). I know of SQL NOW(), but I want to insert a "cooked" timestamp from the outside most efficiently. How? Thanks. ---(end of broadcast)--- TIP 2: Don

Re: [GENERAL] su: adduser: command not found mac osx

2007-09-14 Thread Erik Jones
ing, is there anyone out there using bash on mac os who knows how to fix this? Thanks, Jason ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq Erik Jones Software Developer

Re: [GENERAL] Inherited FK Indexing

2007-09-14 Thread Erik Jones
rpose? Is it possible to have FK that spans into child tables? I'm assuming you just left out an INHERITS clause or ALTER TABLE statement to add the inheritance? Anyways, the answer to your question is no, you'll need to create any dependencies to child tables separately.

Re: [GENERAL] pg_standby observation

2007-09-13 Thread Erik Jones
On Sep 13, 2007, at 3:02 PM, Jeff Davis wrote: On Thu, 2007-09-13 at 14:05 -0500, Erik Jones wrote: If you include the -d option pg_standby will emit logging info on stderr so you can tack on something like 2>> logpath/standby.log. What it is lacking, however, is timestamps in the outpu

Re: [GENERAL] pg_standby observation

2007-09-13 Thread Erik Jones
g. What it is lacking, however, is timestamps in the output when it successfully recovers a WAL file. Was there something more ou were looking for? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere comm

Re: [GENERAL] Event-driven programming?

2007-09-12 Thread Erik Jones
level cache of data, is normally implemented at the application layer, often using something like memcached. However, if he can narrow his "events" down to specific tables, then he can use the LISTEN/NOTIFY mechanism with triggers on those tables to good effect. Erik Jones Softwar

Re: [GENERAL] an other provokative question??

2007-09-06 Thread Erik Jones
e. I'm curious, given that Postgres wasn't even an SQL-centric database when the original project ended, how much of the current Postgres code base still contains code from the original project before the incorporation of SQl rename to PostgreSQL? Erik Jones Software Developer | Em

Re: [GENERAL] dblink vs dbi-link (and errors compiling)

2007-09-06 Thread Erik Jones
[dblink.o] Error 1 In the src/contrib/dblink/ directory of the source tree you built postgres from just do make make install Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate

Re: [GENERAL] Obtaining random rows from a result set

2007-08-31 Thread Erik Jones
Hi, Why not generate a random number in your application and then: SELECT * FROM table_x WHERE condition = true OFFSET generated_random_number LIMIT xx Kaloyan Iliev That won't work without some kind of a priori knowledge of how many rows the query would return without the offset and

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

2007-08-31 Thread Erik Jones
ver's data directory involve, at some point, shutting down the db. Alternatively, if you're running out of space on the disk currently holding the data, you can add another drive in a new tablespace. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 61

Re: [GENERAL] Metadata

2007-08-30 Thread Erik Jones
what your looking for, type \df pg_get* in psql and you see a listing of available functions that'll give you just what you're looking for and are documented in Section 9.19 of the manual (http://www.postgresql.org/docs/8.2/interactive/functions- info.html). Erik Jones

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Erik Jones
un autovacuum so no problem with parallel vacuums. In addition, Solaris doesn't have overcommit. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us onli

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-28 Thread Erik Jones
coming from autovacuum, likely? Such was my original supposition given that the memory context output that preceded the actual error in my log included a line for "Autovacuum Context: ..." Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615

Re: [GENERAL] Tables dissapearing

2007-08-28 Thread Erik Jones
, we hope you find/fix the problem before things get really ugly) Will post about every relevant doings to this issue... Thanks! -- /me remembers Pete Rose. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations

Re: [GENERAL] naming a primary key possible?

2007-08-27 Thread Erik Jones
RAINT pkey_table_short_form_name PRIMARY KEY (a,b,c) That's not really clear from the top of the CREATE TABLE docs but there's an example at the bottom that shows it. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizat

Re: [GENERAL] Tables dissapearing

2007-08-27 Thread Erik Jones
On Aug 27, 2007, at 7:57 PM, Kamil Srot wrote: Tom Lane wrote: Kamil Srot <[EMAIL PROTECTED]> writes: Erik Jones wrote: Have you verified that the table's files are still on disk after it's "disappeared"? Do not have any idea how to do it... I wasn't able t

Re: [GENERAL] String Escaping in Pattern Matching

2007-08-27 Thread Erik Jones
x27; FOR '#') I get NULL inserted but no WARNING's. A point if the right direction would be appreciated. Try INSERT INTO ... VALUES(SUBSTRING(usernumber FROM E'^\\+?1?(.*)')); Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888

Re: [GENERAL] Tables dissapearing

2007-08-27 Thread Erik Jones
) this has happened. What kind of monitoring do you have set up on your DBs? Have you verified that the table's files are still on disk after it's "disappeared"? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Em

Re: [GENERAL] Tables dissapearing

2007-08-27 Thread Erik Jones
tom lane Also, in your original post you mentioned a "proprietal CMS system". Is this proprietary to your company or one that you've purchased? The fact that the same table going on multiple dbs all being run by that CMS system certainly makes it worthy of suspicion. Erik

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-27 Thread Erik Jones
ing through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organiza

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-27 Thread Erik Jones
12MB. The X4600 runs with 64-bit Dual Opterons. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http://www.myemma.com --

Re: [GENERAL] SQL Diff ?

2007-08-26 Thread Erik Jones
t; before that commit or you'll get duplicate key errors immediately. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http

Re: [GENERAL] [PERFORM] Partioning tsearch2 a table into chunks and accessing via views

2007-08-25 Thread Erik Jones
On Aug 25, 2007, at 2:58 PM, Erik Jones wrote: On Aug 24, 2007, at 7:41 PM, Benjamin Arai wrote: Hi, I have an application which loads millions of NEW documents each month into a PostgreSQL tsearch2 table. I have the initial version completed and searching performance is great but my

Re: [GENERAL] [PERFORM] Partioning tsearch2 a table into chunks and accessing via views

2007-08-25 Thread Erik Jones
reate a table from which all of your partitioned tables inherit. Partition in such a way that you can use constraint exclusion and then you can treat the parent table like the view you were suggesting. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292

Re: [GENERAL] Add Column BEFORE/AFTER another column

2007-08-24 Thread Erik Jones
On Aug 24, 2007, at 4:18 PM, Matthew wrote: Hey Bill, It does not. Bummer. To get your columns in a specific order, specify the column names in that order in your SELECT statement. The SQL standard doesn't provide for any other way to guarantee column order, and neither does

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-24 Thread Erik Jones
ur logs for errors so if anything else comes up I'll be sure to share. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http://www.myemma.com

Re: [GENERAL] Out of Memory - 8.2.4

2007-08-24 Thread Erik Jones
ed Postmaster: 24576 total in 2 blocks; 20264 free (155 chunks); 4312 used ErrorContext: 8192 total in 1 blocks; 8176 free (4 chunks); 16 used 2007-08-08 20:21:05 CDT 3716 :ERROR: out of memory 2007-08-08 20:21:05 CDT 3716 :DETAIL: Failed on request of size 268435452. Erik Jones Softw

Re: [GENERAL] Argument type list

2007-08-23 Thread Erik Jones
On Aug 23, 2007, at 1:27 PM, Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: On Aug 23, 2007, at 11:56 AM, Gustavo Tonini wrote: I want to create a function that receive a list argument and filter data with IN operator. Example: CREATE OR REPLACE FUNCTION public.ffoo(list so

Re: [GENERAL] Apache + PHP + Postgres Interaction

2007-08-23 Thread Erik Jones
o do: reuse existing connections. In our tests, we saw a 2x speed improvement over connect(). Again, I understand that pgpool will do even better ... We were just talking about this less than two weeks ago: http:// archives.postgresql.org/pgsql-general/2007-08/msg00660.php Erik Jones So

Re: [GENERAL] Argument type list

2007-08-23 Thread Erik Jones
OR REPLACE FUNCTION public.ffoo(list sometype[]) RETURNS VOID AS $$ BEGIN execute 'select * from foo where foo_column::text in (' || array_to_string(list, ',') || ');'; END; $$ LANGUAGE plpgsql; Note that if foo_column is already a text type you don't need

Re: [GENERAL] PostgreSQL vs Firebird feature comparison finished

2007-08-23 Thread Erik Jones
the FB BLOB support. Actually, Postgres's large object facility allows storage of binary data up to 2GB in size. http://www.postgresql.org/docs/8.2/ interactive/largeobjects.html Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax)

Re: [GENERAL] SELECT ... FOR UPDATE performance costs? alternatives?

2007-08-16 Thread Erik Jones
On Aug 15, 2007, at 9:21 PM, D. Dante Lorenso wrote: Erik Jones wrote: On Aug 15, 2007, at 2:39 PM, [EMAIL PROTECTED] wrote: Erik Jones wrote: On Aug 15, 2007, at 1:09 PM, D. Dante Lorenso wrote: ...to ensure that only one server is processing the queue item, so inside PGSQL, use SELECT

Re: [GENERAL] SELECT ... FOR UPDATE performance costs? alternatives?

2007-08-15 Thread Erik Jones
On Aug 15, 2007, at 2:39 PM, [EMAIL PROTECTED] wrote: Erik Jones wrote: On Aug 15, 2007, at 1:09 PM, D. Dante Lorenso wrote: ...to ensure that only one server is processing the queue item, so inside PGSQL, use SELECT ... FOR UPDATE to lock the row... When my server is under severe load

Re: [GENERAL] SELECT ... FOR UPDATE performance costs? alternatives?

2007-08-15 Thread Erik Jones
Thoughts? SELECT ... FOR UPDATE should only be locking the rows returned by your the select statement, in this case the one row. You can check what locks exist on a table (and their type) with the pg_locks system view. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.

Re: [GENERAL] is this trigger safe and efective? - locking (caching via triiggers)

2007-08-15 Thread Erik Jones
On Aug 15, 2007, at 11:14 AM, Pavel Stehule wrote: 2007/8/15, Erik Jones <[EMAIL PROTECTED]>: On Aug 15, 2007, at 4:57 AM, Pavel Stehule wrote: I write sample about triggers and i have question. is my solution correct and exists better solution? Regards Pavel Stehule DROP SCHEMA saf

Re: [GENERAL] Yet Another COUNT(*)...WHERE...question

2007-08-15 Thread Erik Jones
imize for those. Also, in many cases for reporting apps, 10 minutes is not long at all. If you have reports that you can't make happen faster, schedule and automate them. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps orga

Re: [GENERAL] is this trigger safe and efective? - locking (caching via triiggers)

2007-08-15 Thread Erik Jones
p that table, aggregate the updates to the cache table, then delete the interim entries just processed. Oh yeah, you could simplify that function a lot by simply initializing your cache table with a row for each category with sum_val = 0. Then it's all updates and you don't need t

Re: [GENERAL] non superuser creating flat files

2007-08-13 Thread Erik Jones
h you're writing for which ever user whose permissions the trigger function is executed as. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style.

Re: [GENERAL] Persistent connections in PHP

2007-08-13 Thread Erik Jones
.). Unless you know all of the potential caveats associated with php's persisent postgres connections and have a use case that fits them, don't use them. If you need something to pool connections, look at pgpool. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595

Re: [GENERAL] Reordering columns, will this ever be simple?

2007-08-09 Thread Erik Jones
On Aug 9, 2007, at 1:14 PM, Greg Smith wrote: On Thu, 9 Aug 2007, Erik Jones wrote: Perhaps we could have a nice, friendly discussion on using surrogate primary keys v. string based keys? Or, I think the body of the "nulls are bad" dead horse is collecting flies if anyone wan

Re: [GENERAL] Reordering columns, will this ever be simple?

2007-08-09 Thread Erik Jones
dead horse is collecting flies if anyone wants to take a swing at it... I'll stop now. :-) Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at ht

Re: [GENERAL] Move database from Solaris to Windows

2007-08-01 Thread Erik Jones
ur dump was in the same encoding as the database you created on your Windows server? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. V

Re: [GENERAL] deferred check constraints

2007-07-16 Thread Erik Jones
hink I need a nice clear concise explanation of how the magic of a relational database transactions are done. I'll go see if I can find one. If anyone has a pointer to one, that will help me the most right now. The postgres docs are great: http://www.postgresql.org/docs/8.2/ int

Re: [GENERAL] Database corruption: finding the bad block

2007-07-12 Thread Erik Jones
you can't know for sure in what state the replica is, and that is actually harder to investigate than the master, as you can execute no SQL on the replica). Anyway, that's it... it looks the problem is gone, and the DB will be moved to another box to postgres 8.2.4 via slony. I

Re: [GENERAL] Count(*) throws error

2007-07-11 Thread Erik Jones
SELECT COUNT(*) INTO no_rows FROM tbl_concurrent; Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at http://www.myemma.com -

Re: [GENERAL] recovery_target_time ignored or recovery always recovers to end of WAL

2007-07-03 Thread Erik Jones
ich you can then bring up in recovery mode and have it play up until a transaction id you specify. The main point here is that PITR requires and, is run on, a base backup. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organi

Re: [GENERAL] Standby servers and incrementally updated backups

2007-06-29 Thread Erik Jones
On Jun 29, 2007, at 10:15 AM, Jim Nasby wrote: On Jun 25, 2007, at 4:54 PM, Erik Jones wrote: On Jun 25, 2007, at 4:40 PM, Simon Riggs wrote: On Mon, 2007-06-25 at 16:00 -0500, Erik Jones wrote: On Jun 25, 2007, at 3:40 PM, Simon Riggs wrote: If I'm correct, then for large data

Re: [GENERAL] COPY to/from non-local file

2007-06-27 Thread Erik Jones
suggestions? Thanks Jaime The way we usually handle situations similar to this is to use network mounts of directories that are visible from both servers using, say, nfs. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps orga

Re: [GENERAL] Standby servers and incrementally updated backups

2007-06-25 Thread Erik Jones
On Jun 25, 2007, at 4:40 PM, Simon Riggs wrote: On Mon, 2007-06-25 at 16:00 -0500, Erik Jones wrote: On Jun 25, 2007, at 3:40 PM, Simon Riggs wrote: If I'm correct, then for large databases wherein it can take hours to take a base backup, is there anything to be gained by

Re: [GENERAL] Standby servers and incrementally updated backups

2007-06-25 Thread Erik Jones
On Jun 25, 2007, at 3:40 PM, Simon Riggs wrote: On Mon, 2007-06-25 at 13:42 -0500, Erik Jones wrote: It is my understanding that once a standby server has reached the point where it is often waiting for wal files to replay, it is pretty much caught up to the primary server, with the

Re: [GENERAL] yet another simple SQL question

2007-06-25 Thread Erik Jones
e the following: firstname --- John Mark Jennifer Thanks again for all of your help today. Everything you guys have been sending has produced successful results. Try something along the lines of: SELECT substring(firstname from '^(\w*)\W') from table_name; Erik

[GENERAL] Standby servers and incrementally updated backups

2007-06-25 Thread Erik Jones
x27;m correct, then for large databases wherein it can take hours to take a base backup, is there anything to be gained by using incrementally updated backups? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations every

Re: [GENERAL] How determine a Views dependents

2007-06-22 Thread Erik Jones
just look through it with PGAdmin. In an organized way, how can I find out what those dependents are? If I need to use pg_depend, I could use some help in how to do that. Thanks! Have you looked at the output of \d in psql? Erik Jones Software Developer | Emma® [EMAIL PROT

Re: [GENERAL] Can I backup/restore a database in a sql script?

2007-06-22 Thread Erik Jones
se with a lot of careful work it may be possible. See the chapter on Backup and Restore in the manual for the details of how PITR works (http://www.postgresql.org/docs/8.2/interactive/ backup.html). Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.

Re: [GENERAL] ORDER BY with exception

2007-06-22 Thread Erik Jones
ults of select queries are relations representing relationships between data in other relations so they can themselves be used in select queries (as well as updates, deletes and, as of 8.2, insert and copy statements). Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.

Re: [GENERAL] Recovery/Restore and Roll Forward Question.

2007-06-21 Thread Erik Jones
directio on. We only at the beginning of a lot of systems migrations and restructuring so now that we have some new avenues and room to experiment, I'll try to post our results in a couple weeks. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888

Re: [GENERAL] Large Database \d: ERROR: cache lookup failed for relation ...

2007-06-07 Thread Erik Jones
plan on bringing the database down for a REINDEX SYSTEM. Is there anything else anyone can think of that we can do to narrow down where the actual corruption is or how to fix it? -- Erik Jones [EMAIL PROTECTED]

Re: [GENERAL] Large Database \d: ERROR: cache lookup failed for relation ...

2007-06-05 Thread Erik Jones
uding those tables, restore that on a separate machine and see if these errors crop up there anywhere. Is there anything else anyone can think of that we can do to narrow down where the actual corruption is or how to fix it? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.59

Re: [GENERAL] shut down one database?

2007-06-01 Thread Erik Jones
related to that db. Sometimes I have some connection I'd like to close... set datallowconn to false in pg_database; does it shut down the already existing ones? No, it does not kill already existing connections to the given database. Erik Jones Software Developer | Emma® [EMAIL PROTE

Re: [GENERAL] Autovacuum keeps vacuuming a table disabled in pg_autovacuum

2007-06-01 Thread Erik Jones
e are quite a few changed files after REL8_1_9. How would reindexing a table imply hours of downtime? Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us onlin

Re: [GENERAL] why postgresql over other RDBMS

2007-05-25 Thread Erik Jones
On May 25, 2007, at 11:36 AM, Chris Browne wrote: [EMAIL PROTECTED] (Erik Jones) writes: On May 24, 2007, at 5:21 PM, Chris Browne wrote: Jan Wieck had a proposal to a similar effect, namely to give some way to get one connection to duplicate the state of another one. This would permit

Re: [GENERAL] why postgresql over other RDBMS

2007-05-25 Thread Erik Jones
use and I've been planning on extending it to a vacuum strategy. So, I will add my support into someone building this kind of support into pg_dump/restore. Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organi

Re: [GENERAL] why postgresql over other RDBMS

2007-05-24 Thread Erik Jones
On May 24, 2007, at 4:39 AM, Richard Huxton wrote: - unpronounceable name post-gres-queue-el Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate & market in style. Visit us online at

Re: [GENERAL] problem with a conditional statement

2007-05-09 Thread Erik Jones
ar GROUP BY month) AS avgsol ON (s.month = avgsol.month)". Then I get an error about CASE types real and record cannot be matched. Any final ideas? The "AVG(par)" should've been aliased. "AVG(par) as par" would work. As is, the column name returned is just "av

Re: [GENERAL] In theory question

2007-05-09 Thread Erik Jones
that pdf. How does implementing a memcached system with table triggers qualify as outside the database? erik jones <[EMAIL PROTECTED]> software developer 615-296-0838 emma(r) ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] IF function?

2007-05-01 Thread Erik Jones
x27;s not true") It has CASE, as in CASE foo WHEN true THEN 'It''s true' ELSE 'It''s not true' END; Or, for simple binary conditions like that: CASE WHEN foo is TRUE THEN "it's true" ELSE "it's not true" END erik j

<    1   2   3   4   5   >