Re: [GENERAL] PHP and PostgreSQL boolean data type

2010-02-11 Thread Torsten Zühlsdorff
Thom Brown schrieb: A long-standing problem we've had with PostgreSQL queries in PHP is that the returned data for boolean columns is the string 'f' instead of the native boolean value of false. This problem is solved since nearly 5 years with PDO. You can use an abstraction like DDDBL (see

Re: [GENERAL] xpath

2010-02-11 Thread MOLINA BRAVO FELIPE DE JESUS
try to cast to xml xml_payload::xml El mié, 10-02-2010 a las 12:39 +0300, Allan Kamau escribió: As advised by Peter, Below is an example (including the ddl and dml statements), it _drops_ and creates a table called simple_table and a sequence called simple_table_seq both in the public

Re: [GENERAL] Multiple buffer cache?

2010-02-11 Thread Alexei Vladishev
Greg, Let's look at this from an application developer perspective. Suppose my application has a few hundreds of tables. I know _very_well_ how the tables are used. I'd like to tune PostgreSQL so that it would respect how the application works in order to get best possible performance. My

Re: [GENERAL] Multiple buffer cache?

2010-02-11 Thread Alexei Vladishev
Greg, Alexei Vladishev wrote: Is there a way of configuring PostgreSQL so that one specific table would use, say, 4GB of buffer cache while other tables would use the rest? It sounds like you're looking for what other databases call pinning. It's not supported in PostgreSQL right now, and

Re: [GENERAL] Multiple buffer cache?

2010-02-11 Thread Alexei Vladishev
Bret, And then, even if the support is there, you'd need to outline exactly how you're planning on pushing this button. Specifically, what's your usage pattern that would make this a win for you? Let me explain. I have a very busy application generating thousands of SQLs per second.

[GENERAL] Help Join Tables

2010-02-11 Thread BlackMage
Hey, I'm having some trouble trying to join tables because I'm trying to join data in a column to a column name. An example looks like this: Table 1: field_names(varchar 255) | field_title(varchar 255) name_field | User Name interest_field | User Interest number_field | User Number Table 2:

Re: [Pgsqlrpms-hackers] [GENERAL] weird bug in rebuilding RPMs

2010-02-11 Thread Devrim GÜNDÜZ
On Mon, 2010-02-08 at 10:33 -0500, Tom Lane wrote: But having said that, I don't get the point of trying to build a nonstandard installation from the RPM. That seems more or less antithetical to most of the design concepts of RPM-based distros; and it certainly seems pretty silly if your

[GENERAL] Cache lookup failed for relation message in PG 8.3.7

2010-02-11 Thread Keaton Adams
Any ideas why we would be receiving this cache lookup failed message? PostgreSQL 8.3.7 64 bit, RHEL 5 64 bit OS Linux hostname.net 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux 2010-02-07 08:05:36 MSTERROR: cache lookup failed for relation 391262678

[GENERAL] error migrating database from 8.4 to 8.3

2010-02-11 Thread Marc Lustig
Due to a server issue we needed a reinstallation of Ubuntu along with a downgrade to Ubuntu Hardy. So this is what we did: - copied all from /var/lib/postgresql/8.4/main/ to the new server /var/lib/postgresql/8.3/main/ - edited /var/lib/postgresql/8.3/main/postmaster.opts to correct the path

[GENERAL] trouble with unique constraint

2010-02-11 Thread Khin, Gerald
The following SQL leads to a unique constraint violation error message (PostgreSQL 8.4.1). create table test (val integer); create unique index test_uni on test(val); insert into test (val) values (1); insert into test (val) values (2); insert into test (val) values (3);

[GENERAL] migrating data from 8.4 to 8.3

2010-02-11 Thread Marc Lustig
Hi, can we safely put the data from /var/lib/postgresql/8.4/main/ of server x to /var/lib/postgresql/8.3/main/ of server y, considering that the new target machine is running 8.3 whereas the old one ran 8.4 ? Rgards Marc -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] problems maintaining boolean columns in a large table

2010-02-11 Thread Timo Klecker
Hi Ben, could you post your trigger function? When you need to rebuild the index, you could disable the trigger setting the flag if the article is modified. This could speed up your UPDATE. Mit freundlichen Grüßen Timo Klecker -Ursprüngliche Nachricht- Von:

[GENERAL] recovering fs-data from previous installation

2010-02-11 Thread Marc Lustig
I managed to install again postgresql-8.4 from hardy-backports. Now the installation is identical with the previous one. With the fresh database, the server starts up fine. Now I copied all from the backup to /usr/lib/postgresql/8.4 /var/lib/postgresql/8.4 The the startup fails like this: *

[GENERAL] Manipulating Large Object datatype in Postgresql

2010-02-11 Thread Sharmila Jothirajah
Hi, We have tables with data type CLOb and BLOBs (in oracle). This needs o be migrated to Postgresql. What data types can be used for this. I've done some resaerch/search in this and found that (correct me if Im wrong) 1. For CLObs the equivalent are TEXT and OID(lob). But streaming(thro' jdbc)

[GENERAL] migrating data from 8.4 to 8.3

2010-02-11 Thread Marc Lustig
Hi, can we safely put the data from /var/lib/postgresql/8.4/main/ of server x to /var/lib/postgresql/8.3/main/ of server y, considering that the new target machine is running 8.3 whereas the old one ran 8.4 ? Rgards Marc -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

[GENERAL] Fwd: [pgadmin-support] a quick question

2010-02-11 Thread Farrer, Rhys
Hi, I was told to email you about this question... Cheers, Rhys Begin forwarded message: From: Guillaume Lelarge guilla...@lelarge.infomailto:guilla...@lelarge.info Date: 8 February 2010 10:41:57 GMT To: Farrer, Rhys r.farre...@imperial.ac.ukmailto:r.farre...@imperial.ac.uk Cc:

[GENERAL] weird bug in rebuilding RPMs

2010-02-11 Thread kz win
Hello, I'm a long time user and I had always installed postgres by compiling from source. I recently moved to a new environment where everything is installed as rpm and plus I need to install a newer postgres for testing while keeping the existing version in place. That leads me to repackage

Re: [GENERAL] Warning when selecting column from pg_stat_user_tables.

2010-02-11 Thread Greg Smith
Chris Barnes wrote: I have this error when selecting from the pg_stat_user_tables. I restarted postgres and the error went away. Has anyone else seen this error? [postg...@preventdb02 londiste]$ cat /data/pgsql/data/pg_log/postgresql-Tue.log WARNING: pgstat wait timeout There have been

Re: [GENERAL] migrating data from 8.4 to 8.3

2010-02-11 Thread Thomas Kellerer
Marc Lustig, 08.02.2010 11:36: Hi, can we safely put the data from /var/lib/postgresql/8.4/main/ of server x to /var/lib/postgresql/8.3/main/ of server y, considering that the new target machine is running 8.3 whereas the old one ran 8.4 ? No, a dump restore is required (as stated in the

Re: [GENERAL] trouble with unique constraint

2010-02-11 Thread A. Kretschmer
In response to Khin, Gerald : The following SQL leads to a unique constraint violation error message (PostgreSQL 8.4.1). create table test (val integer); create unique index test_uni on test(val); insert into test (val) values (1); insert into test (val) values

Re: [GENERAL] migrating data from 8.4 to 8.3

2010-02-11 Thread A. Kretschmer
In response to Marc Lustig : Hi, can we safely put the data from /var/lib/postgresql/8.4/main/ of server x to /var/lib/postgresql/8.3/main/ of server y, considering that the new target machine is running 8.3 whereas the old one ran 8.4 ? No! Make a regular Backup und restore that Backup.

Re: [GENERAL] migrating data from 8.4 to 8.3

2010-02-11 Thread A. Kretschmer
In response to Thomas Kellerer : Marc Lustig, 08.02.2010 11:36: Hi, can we safely put the data from /var/lib/postgresql/8.4/main/ of server x to /var/lib/postgresql/8.3/main/ of server y, considering that the new target machine is running 8.3 whereas the old one ran 8.4 ? No, a dump

Re: [GENERAL] migrating data from 8.4 to 8.3

2010-02-11 Thread Thomas Kellerer
A. Kretschmer, 11.02.2010 09:42: In response to Thomas Kellerer : Marc Lustig, 08.02.2010 11:36: Hi, can we safely put the data from /var/lib/postgresql/8.4/main/ of server x to /var/lib/postgresql/8.3/main/ of server y, considering that the new target machine is running 8.3 whereas the old

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread Albe Laurenz
u235sentinel wrote: I have a strange problem we noticed the other day with triggers. We're running 8.3.3 on Solaris 10 (intel) and have a feed that comes in regularly to populate a table we're working on. The feed works just fine inserting rows however the following trigger stops the

[GENERAL] PostgreSQL Installation

2010-02-11 Thread db . subscriptions
Hi, Please why is it that we must register at EnterpriseDB and register each Windows installation of postgreSQL these days? At times, I need to install on a server that is not on the internet and have had to bear the pain of configuring a server for internet before I can install

Re: [GENERAL] PostgreSQL Installation

2010-02-11 Thread Dave Page
On Thu, Feb 11, 2010 at 11:00 AM, db.subscripti...@shepherdhill.biz wrote: Hi, Please why is it that we must register at EnterpriseDB and register each Windows installation of postgreSQL these days? There is no requirement to register to use or download PostgreSQL. -- Dave Page

Re: [GENERAL] PostgreSQL Installation

2010-02-11 Thread A. Kretschmer
In response to db.subscripti...@shepherdhill.biz : Hi, Please why is it that we must register at EnterpriseDB and register each Windows installation of postgreSQL these days? That's not true. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -

Re: [GENERAL] PostgreSQL Installation

2010-02-11 Thread Ashesh Vashi
You can always download PostgreSQL installer for any supported platform without any registration from http://www.enterprisedb.com/products/pgdownload.do. On Thu, Feb 11, 2010 at 4:30 PM, db.subscripti...@shepherdhill.biz wrote: Hi, Please why is it that we must register at EnterpriseDB and

Re: [GENERAL] PostgreSQL Installation

2010-02-11 Thread db . subscriptions
Thanks. I think I mistook postgres for postgres-plus. Quoting Ashesh Vashi ashesh.va...@enterprisedb.com: You can always download PostgreSQL installer for any supported platform without any registration from http://www.enterprisedb.com/products/pgdownload.do. On Thu, Feb 11, 2010 at 4:30

[GENERAL] COPY FROM wish list

2010-02-11 Thread Marc Mamin
Hello, Looking at the TODO List, I feel that only some aspects of the COPY FROM command are adressed. Could a discussion trigger some activity on this topic :o) ? Best regards, Marc Mamin Here my wish list: COPY tablename [ ( column [, ...] ) ] FROM { 'filename' | STDIN } [ [ WITH

[GENERAL] Inserting exported bytea value

2010-02-11 Thread seiliki
I am trying to build SQL commands that insert values exported from a bytea column. Output facilities do not escape single quotes for bytea column. As such, the built INSERT SQL can be invalid because single quotes can appear in values. For example, the built (invalid) INSERT SQL command can

Re: [GENERAL] Inserting exported bytea value

2010-02-11 Thread Pavel Stehule
Hello why you don't use PQescapeBytea function ? http://www.postgresql.org/docs/8.4/interactive/libpq-exec.html#LIBPQ-EXEC-ESCAPE-BYTEA Regards Pavel Stehule 2010/2/11 seil...@so-net.net.tw: I am trying to build SQL commands that insert values exported from a bytea column.  Output

[GENERAL] Handling Numeric Datums in C

2010-02-11 Thread Alban Hertroys
Hey all, I'm working on some server-side C code that involves a few calculations on a numeric value. The calculation is along the lines of: (numeric) result = (numeric) value * ((int) base ^ (int) power); What's the usual approach to write functions like these? This is how far I got:

[GENERAL] Fwd: Handling Numeric Datums in C

2010-02-11 Thread Alban Hertroys
I guess it'd be useful to mention what types the different fields are, doh! Begin forwarded message: Hey all, I'm working on some server-side C code that involves a few calculations on a numeric value. The calculation is along the lines of: (numeric) result = (numeric) value *

[GENERAL] trouble with unique constraint

2010-02-11 Thread Khin, Gerald
The following SQL leads to a unique constraint violation error message (PostgreSQL 8.4.1). create table test (val integer); create unique index test_uni on test(val); insert into test (val) values (1); insert into test (val) values (2); insert into test (val) values (3);

Re: [GENERAL] problems maintaining boolean columns in a large table

2010-02-11 Thread Ben Campbell
Timo Klecker wrote: could you post your trigger function? When you need to rebuild the index, you could disable the trigger setting the flag if the article is modified. This could speed up your UPDATE. Embarrassingly, when I checked, I found that I'd never gotten around to writing that

Re: [GENERAL] windows7 login- user account

2010-02-11 Thread Justin Graf
On 2/10/2010 7:15 PM, paul e wrote: Before Installed postgresql Windows7 went straight to my user account. Now when it boots I have to go to a selection page where I choose between my user account and a postgresql user account. Is there any way to bypass this so it boots directly to my user

Re: [GENERAL] Problem with pg_compresslog'd archives

2010-02-11 Thread Karl Denninger
Will this come through as a commit on the pgfoundry codebase? I've subscribed looking for it The last edit, if I read the release notes and tracebacks on the codebase correctly, goes back to the early part of 2009 - which strongly implies that there are a **LOT** of people out there that

Re: [GENERAL] trouble with unique constraint

2010-02-11 Thread A. Kretschmer
In response to Khin, Gerald : The following SQL leads to a unique constraint violation error message You have already got the answer ... for the same question from you. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: - Header) GnuPG: 0x31720C99, 1006

Re: [GENERAL] Large Objects: Sizeof and Deleting Unlinked LOs

2010-02-11 Thread Harald Fuchs
In article 4b72aeb3.4000...@selestial.com, Howard Cole howardn...@selestial.com writes: Is there an SQL function to determine the size of a large object? I'm using a pgsql helper function for that: CREATE FUNCTION lo_size(oid oid) RETURNS integer LANGUAGE plpgsql AS $$ DECLARE

Re: [GENERAL] error migrating database from 8.4 to 8.3

2010-02-11 Thread Filip Rembiałkowski
2010/2/8 Marc Lustig m...@marclustig.com Due to a server issue we needed a reinstallation of Ubuntu along with a downgrade to Ubuntu Hardy. So this is what we did: - copied all from /var/lib/postgresql/8.4/main/ to the new server /var/lib/postgresql/8.3/main/ - edited

Re: [GENERAL] problems maintaining boolean columns in a large table

2010-02-11 Thread Filip Rembiałkowski
2010/2/10 Ben Campbell b...@scumways.com I settled on: CREATE TABLE needs_indexing ( article_id integer REFERENCES article(id) PRIMARY KEY ); The primary key-ness enforces uniqueness, and any time I want to add an article to the queue I just make sure I do a DELETE before the INSERT.

Re: [GENERAL] problems maintaining boolean columns in a large table

2010-02-11 Thread Timo Klecker
Hi Ben, you can check weather one of your indexes is used within the Query by simply using EXPLAIN ANALYZE. EXPLAIN ANALYZE SELECT * from journo WHERE id IN (SELECT journo_id FROM journo_attr WHERE article_id=$AnyExistingIdHere$); Maybe you have another trigger on the journo table, that is

Re: [GENERAL] Problem with pg_compresslog'd archives

2010-02-11 Thread Koichi Suzuki
I understand the situation. I'll upload the improved code ASAP. -- Koichi Suzuki 2010/2/11 Karl Denninger k...@denninger.net: Will this come through as a commit on the pgfoundry codebase?  I've subscribed looking for it The last edit, if I read the release notes and

[GENERAL] Bug on pg_lesslog

2010-02-11 Thread Koichi Suzuki
Dear Folks; A very serious bug was reported on pg_lesslog. So far, I found it's a bug in pg_compresslog. Please do not use pg_compresslog and pg_decompresslog until improved version is uploaded. I strongly advise to take base backup of your database. I apologize for inconvenience. I'll

Re: [GENERAL] recovering fs-data from previous installation

2010-02-11 Thread Adrian Klaver
On Monday 08 February 2010 7:11:28 am Marc Lustig wrote: I managed to install again postgresql-8.4 from hardy-backports. Now the installation is identical with the previous one. With the fresh database, the server starts up fine. Now I copied all from the backup to /usr/lib/postgresql/8.4

Re: [GENERAL] Extending SQL in C using VARIABLE length type

2010-02-11 Thread Tom Lane
Carsten Kropf ckro...@fh-hof.de writes: Thanks a lot so far. I adopted my structures and am now storing two fields (v_len_ and dimensions) and the storage is now working properly. If I now would try to combine two of these points to a range (like cube) including an upper and a lower bound

Re: [GENERAL] Cache lookup failed for relation message in PG 8.3.7

2010-02-11 Thread Tom Lane
Keaton Adams keaton_ad...@mcafee.com writes: Any ideas why we would be receiving this cache lookup failed message? PostgreSQL 8.3.7 64 bit, RHEL 5 64 bit OS [ query applying pg_table_is_visible() to most of pg_class ] Is it repeatable, or just something that shows up occasionally with

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread Adrian Klaver
On Thursday 11 February 2010 1:57:39 am Albe Laurenz wrote: u235sentinel wrote: I have a strange problem we noticed the other day with triggers. We're running 8.3.3 on Solaris 10 (intel) and have a feed that comes in regularly to populate a table we're working on. The feed works just

Re: [GENERAL] Versions RSS page is missing version(s)

2010-02-11 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 No, but I imagine we still would encourage people to run the latest revision of it. Come this time next year, I hope that we'll tell people on 7.4.2 to Do we really, officially, care? Well, yes, we certainly should. Just because a branch

Re: [GENERAL] Extending SQL in C using VARIABLE length type

2010-02-11 Thread Carsten Kropf
Thanks for this hint, I already got it to work in the meantime. My approach now (based on the fact, that PointND is indeed a variable length type) is to have the following structure: struct Range { int vl_len_; struct PointND limits[1]; }; whereas now vl_len_ stores the total size

Re: [GENERAL] Searching a DB index.. possible?

2010-02-11 Thread Moe
Bump On Fri, Feb 5, 2010 at 5:48 PM, Moe mohamed5432154...@gmail.com wrote: I am trying to figure out how I can introduce full text search tips... tips meaning, like if you start typing Mer .. then a box with a couple of words underneath comes up, with *Mercedes, Mercury *and so on :P I am

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread Igor Neyman
-Original Message- From: u235sentinel [mailto:u235senti...@gmail.com] Sent: Wednesday, February 10, 2010 11:15 PM To: pgsql-general@postgresql.org Subject: Postgres Triggers issue I have a strange problem we noticed the other day with triggers. We're running 8.3.3 on Solaris

Re: [GENERAL] Searching a DB index.. possible?

2010-02-11 Thread Richard Huxton
On 05/02/10 15:48, Moe wrote: I am trying to figure out how I can introduce full text search tips... tips meaning, like if you start typing Mer .. then a box with a couple of words underneath comes up, with *Mercedes, Mercury *and so on :P I am thinking that the word suggestions needs to come

[GENERAL] pg_dump superflous warning message

2010-02-11 Thread Bill Moran
If I do: pg_dump -a --disable-triggers I get a warning message: pg_dump: NOTICE: there are circular foreign-key constraints among these table(s): pg_dump: directory pg_dump: You may not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.

Re: [GENERAL] Searching a DB index.. possible?

2010-02-11 Thread Moe
On Thu, Feb 11, 2010 at 6:56 PM, Richard Huxton d...@archonet.com wrote: On 05/02/10 15:48, Moe wrote: I am trying to figure out how I can introduce full text search tips... tips meaning, like if you start typing Mer .. then a box with a couple of words underneath comes up, with *Mercedes,

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread A. Kretschmer
In response to Igor Neyman : CREATE TRIGGER tafter AFTER INSERT OR UPDATE ON r.m_a FOR EACH ROW EXECUTE PROCEDURE r.m_t(); Trigger function for an insert/update trigger should return NEW, not NULL (OLD - for on delete trigger): It's an AFTER TRIGGER, so the RETURN-Value

Re: [GENERAL] Searching a DB index.. possible?

2010-02-11 Thread Richard Huxton
On 11/02/10 17:11, Moe wrote: You might want to summarize down to a separate (word,frequency) table. Particularly if you don't want stemming to interfere with your suggestions. Stemming is ok. That's fine. How would this normally be implemented? Should I go through my text word by word

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread Andreas Kretschmer
A. Kretschmer andreas.kretsch...@schollglas.com wrote: In response to Igor Neyman : CREATE TRIGGER tafter AFTER INSERT OR UPDATE ON r.m_a FOR EACH ROW EXECUTE PROCEDURE r.m_t(); Trigger function for an insert/update trigger should return NEW, not NULL (OLD - for

Re: [GENERAL] [HACKERS] Bug on pg_lesslog

2010-02-11 Thread Joshua D. Drake
On Thu, 2010-02-11 at 23:39 +0900, Koichi Suzuki wrote: Dear Folks; A very serious bug was reported on pg_lesslog. So far, I found it's a bug in pg_compresslog. Please do not use pg_compresslog and pg_decompresslog until improved version is uploaded. I strongly advise to take base

Re: [GENERAL] questions about a table's row estimates

2010-02-11 Thread Ben Chobot
On Feb 10, 2010, at 10:28 PM, Greg Smith wrote: Ben Chobot wrote: I'm looking at pg_stat_user_tables in 8.4.2, and I'm confused about n_live_tup. Shouldn't that be at least fairly close to (n_tup_ins - n_tup-del)? It doesn't seem to be, but I'm unclear why. Insert 2000 tuples. Delete

Re: [GENERAL] pg_dump superflous warning message

2010-02-11 Thread Scott Marlowe
On Thu, Feb 11, 2010 at 10:08 AM, Bill Moran wmo...@potentialtech.com wrote: If I do: pg_dump -a --disable-triggers I get a warning message: pg_dump: NOTICE: there are circular foreign-key constraints among these table(s): pg_dump:   directory pg_dump: You may not be able to restore the

Re: [GENERAL] [HACKERS] Bug on pg_lesslog

2010-02-11 Thread Karl Denninger
Joshua D. Drake wrote: On Thu, 2010-02-11 at 23:39 +0900, Koichi Suzuki wrote: Dear Folks; A very serious bug was reported on pg_lesslog. So far, I found it's a bug in pg_compresslog. Please do not use pg_compresslog and pg_decompresslog until improved version is uploaded. I

[GENERAL] Truncate and delete adds wal logs for slave to process.

2010-02-11 Thread Chris Barnes
I have a question regaring delete truncate versus a drop of the tables and recreating it. We have a database that gets recreated each week that is 31 GB in size. The way that it is currently being done is to truncate all of the tables. I would like to confirm. Because both

Re: [GENERAL] problems maintaining boolean columns in a large table

2010-02-11 Thread John R Pierce
Ben Campbell wrote: I _think_ the reason it takes so long is that postgresql doesn't modify rows in place - it creates an entry for the modified row and zaps the old one. So by touching _every_ row I'm basically forcing it to rebuild my whole database... I've got about 2 million rows in

Re: [GENERAL] questions about a table's row estimates

2010-02-11 Thread Tom Lane
Ben Chobot be...@silentmedia.com writes: And unfortunately, Tom, we're not resetting stats counters. :( Mph. Well, the other thing that comes to mind is that n_live_tup (and n_dead_tup) is typically updated by ANALYZE, but only to an estimate based on ANALYZE's partial sample of the table. If

Re: [GENERAL] pg_dump superflous warning message

2010-02-11 Thread Tom Lane
Bill Moran wmo...@potentialtech.com writes: If I do: pg_dump -a --disable-triggers I get a warning message: pg_dump: NOTICE: there are circular foreign-key constraints among these table(s): pg_dump: directory pg_dump: You may not be able to restore the dump without using

[GENERAL] help with SQL join

2010-02-11 Thread Neil Stlyz
Hello, I need help with the an advanced SQL JOIN. I think that I can get this accomplished with a LEFT JOIN... perhaps some of you may be able to offer guidance in this... I appreciate any suggestions you may have. Consider the following SQL statement: SELECT customerid, count(disctint

[GENERAL] subscribe

2010-02-11 Thread janandith jayawardena

[GENERAL] Bug on pg_lesslog

2010-02-11 Thread Koichi Suzuki
Dear Folks; A very serious bug was reported on pg_lesslog. So far, I found it's a bug in pg_compresslog. Please do not use pg_compresslog and pg_decompresslog until improved version is uploaded. I strongly advise to take base backup of your database. I apologize for inconvenience. I'll

Re: [GENERAL] Memory Usage and OpenBSD

2010-02-11 Thread Jeff Ross
Greg Smith wrote: Jeff Ross wrote: pgbench is run with this: pgbench -h varley.openvistas.net -U _postgresql -t 2 -c $SCALE pgbench with scale starting at 10 and then incrementing by 10. I call it three times for each scale. I've turned on logging to 'all' to try and help figure out

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread u235sentinel
Trigger function for an insert/update trigger should return NEW, not NULL (OLD - for on delete trigger): It's an AFTER TRIGGER, so the RETURN-Value ignored. According the doc: The return value of a BEFORE or AFTER statement-level trigger or an AFTER row-level trigger is always

[GENERAL] C function to create tsquery not working

2010-02-11 Thread Ivan Sergio Borgonovo
I'm still having trouble making this work: http://pgsql.privatepaste.com/14a6d3075e CREATE OR REPLACE FUNCTION tsvector_to_tsquery(IN tsv tsvector, op IN char(1), weights IN varchar(4), maxpos IN smallint ) RETURNS tsquery AS 'MODULE_PATHNAME' LANGUAGE C STRICT;

Re: [GENERAL] pg_dump superflous warning message

2010-02-11 Thread Bill Moran
In response to Scott Marlowe scott.marl...@gmail.com: On Thu, Feb 11, 2010 at 10:08 AM, Bill Moran wmo...@potentialtech.com wrote: If I do: pg_dump -a --disable-triggers I get a warning message: pg_dump: NOTICE: there are circular foreign-key constraints among these table(s):

Re: [GENERAL] help with SQL join

2010-02-11 Thread John R Pierce
Neil Stlyz wrote: Now... here is the problem I am having... the above SQL query is retrieving results from one table: sales I have another table called customers with a couple of fields (customerid, and customername are two of the fields). I want to join on the customerid in both tables to

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread Adrian Klaver
On 02/11/2010 11:08 AM, u235sentinel wrote: Trigger function for an insert/update trigger should return NEW, not NULL (OLD - for on delete trigger): It's an AFTER TRIGGER, so the RETURN-Value ignored. According the doc: The return value of a BEFORE or AFTER statement-level trigger or an

Re: [GENERAL] error migrating database from 8.4 to 8.3

2010-02-11 Thread Andrej
On 9 February 2010 02:55, Marc Lustig m...@marclustig.com wrote: Due to a server issue we needed a reinstallation of Ubuntu along with a downgrade to Ubuntu Hardy. So this is what we did: - copied all from /var/lib/postgresql/8.4/main/ to the new server /var/lib/postgresql/8.3/main/ -

Re: [GENERAL] error migrating database from 8.4 to 8.3

2010-02-11 Thread Scott Ribe
Export/import is the only option. Or upgrade PostgreSQL to 8.4 on the downgraded server. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] Deadlock Detected

2010-02-11 Thread David Kerr
Is there a setting that will give me a more verbose log message when a deadlock is detected? currently, i just get Error: Deadlock Detected but it doesn't tell me the tables involved. Thanks Dave -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Deadlock Detected

2010-02-11 Thread Vick Khera
On Thu, Feb 11, 2010 at 4:50 PM, David Kerr d...@mr-paradox.net wrote: currently, i just get Error: Deadlock Detected but it doesn't tell me the tables involved. Where do you see this? The postgres log file surely has more details. Also, what version etc. etc. -- Sent via pgsql-general

Re: [GENERAL] Truncate and delete adds wal logs for slave to process.

2010-02-11 Thread Greg Stark
On Thu, Feb 11, 2010 at 5:47 PM, Chris Barnes compuguruchrisbar...@hotmail.com wrote: Because both truncate and delete, I would think that this action would be put into the pg_log as a log file that can be rolled back. And, when complete, it would be shipped to the standby to be processed?

Re: [GENERAL] [HACKERS] Bug on pg_lesslog

2010-02-11 Thread Koichi Suzuki
Thank you very much for the advice. Yes I think it should go to announce. I will post a message. -- Koichi Suzuki 2010/2/12 Karl Denninger k...@denninger.net: Joshua D. Drake wrote: On Thu, 2010-02-11 at 23:39 +0900, Koichi Suzuki wrote: Dear Folks; A very serious bug was

[GENERAL] left join count

2010-02-11 Thread Greenhorn
Hi All, I'm trying to retrieve the count of notes associated for each transactions for table energy_transactions. But I seem to be getting (after the join) the sum of amount x count of notes. Can someone enlighten me with this problem? Here's the query that I am working with. select

Re: [GENERAL] left join count

2010-02-11 Thread Richard Huxton
On 11/02/10 22:53, Greenhorn wrote: But I seem to be getting (after the join) the sum of amount x count of notes. Can someone enlighten me with this problem? select energy_accounts_id, count(note) ,sum(case when t.fin_year = 2010 and t.fin_quarter = 1 then t.total_amount else 0

Re: [GENERAL] Truncate and delete adds wal logs for slave to process.

2010-02-11 Thread Alvaro Herrera
Chris Barnes wrote: Because both truncate and delete, I would think that this action would be put into the pg_log as a log file that can be rolled back. And, when complete, it would be shipped to the standby to be processed? You would be wrong -- truncate does not log the full data, only the

[GENERAL] Alter index .. set tablespace uses ACCESS EXCLUSIVE lock?

2010-02-11 Thread Francisco Reyes
The alter index page does not show the lock mode, but it seems it is an ACCESS EXCLUSIVE. Wouldn't an EXCLUSIVE lock be more appropriate and remove the index from planner consideration? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] Deadlock Detected

2010-02-11 Thread David Kerr
On Thu, Feb 11, 2010 at 05:01:37PM -0500, Vick Khera wrote: - On Thu, Feb 11, 2010 at 4:50 PM, David Kerr d...@mr-paradox.net wrote: - currently, i just get Error: Deadlock Detected but it doesn't tell me the tables involved. - - - Where do you see this? The postgres log file surely has more

Re: [GENERAL] left join count

2010-02-11 Thread Greenhorn
On 12 February 2010 10:28, Richard Huxton d...@archonet.com wrote: On 11/02/10 22:53, Greenhorn wrote: But I seem to be getting (after the join) the sum of amount x count of notes.  Can someone enlighten me with this problem? select   energy_accounts_id, count(note)   ,sum(case when

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread u235sentinel
Adrian Klaver wrote: Well that would depend on any number of factors. Without information on how the feed is being done or more detailed logs it is hard to say for sure. At a guess though, I would say it is because the 'feed' is being done wrapped in a transaction and when the trigger

[GENERAL] Postgres standard versus Postgres Plus Advanced Server

2010-02-11 Thread Robert James
Hi. I'm setting up a new workstation (Win7 64bit Quad Core 4GB) with Postgres, for development work, and trying to pick which version I should install. Most of the time, Postgres is dormant - I'm not using it all - but when I do use it, the load can be high, and I want maximum performance. Is

Re: [GENERAL] Postgres Triggers issue

2010-02-11 Thread u235sentinel
Adrian Klaver wrote: On Thursday 11 February 2010 1:57:39 am Albe Laurenz wrote: u235sentinel wrote: I have a strange problem we noticed the other day with triggers. We're running 8.3.3 on Solaris 10 (intel) and have a feed that comes in regularly to populate a table we're working on.

Re: [GENERAL] like any in reverse?

2010-02-11 Thread Tom Lane
Gauthier, Dave dave.gauth...@intel.com writes: I want to find all records where any element of lst like 'j%'. This does not work... select * from foo where 'j%' like any(lst); Intuitively, you'd think select * from foo where any(lst) like 'j%'; ... but that's a syntax error. Yeah, the

[GENERAL] like any in reverse?

2010-02-11 Thread Gauthier, Dave
Hi: create table foo (lst text[]); insert into foo (lst) values (array['jack','fred','jen','sue']); I want to find all records where any element of lst like 'j%'. This does not work... select * from foo where 'j%' like any(lst); Intuitively, you'd think select * from foo where any(lst)