Re: [GENERAL] COPY problem on -- strings

2008-11-20 Thread Sabin Coanda
Is that the *first* error message you got? Yes it is. In fact I made a mistake in the first email, so instead: INSERT INTO A ( Col1, Col2 ) VALUES (2, '-- any text' ); please change with: INSERT INTO A ( Col1, Col2 ) VALUES (1, '-- any text' ); However I

Re: [GENERAL] Connecting to old 7.1 Database

2008-11-20 Thread Andy Greensted
After a trying a few different versions, 7.2.8 seems to compile OK and is happy connecting to a 7.1 server. Andy Andy Greensted wrote: Hi All, I need to connect to a version 7.1 PostgreSQL database. Unfortunately, I cannot get the 7.1.3 source to compile. configure gives this error:

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Albe Laurenz
WireSpot wrote: I'm trying to use prepared statements in an application and I'm running into this error: Query failed: prepared statement already exists. The reason is obvious. What I want to know is the best way to avoid getting this error. The client application sets statement names as

[GENERAL] Serial - last value

2008-11-20 Thread hendra kusuma
Hi there a little basic question here I usually use something like this in stored function to get the last value of a serial type column select last_value into ret from id_sequence return ret What i'm asking is, if many people run the same stored function at the same time will they get the

[GENERAL] row-level security (Dynamically rewrite queries)

2008-11-20 Thread Jonatan Evald Buus
Hi there, Is it possible to dynamically rewrite an SQL query for all operations (SELECT, INSERT, UPATE, DELETE etc.)? It seems that using RULES it's possible to replace one query with another, but can the actual query that was executed by retrieved so it can be dynamically modified? I.e. I'd like

[GENERAL] where in (select array)

2008-11-20 Thread Marcus Engene
Hi List, I have the might_like table that contains products a user might like if he likes the present one (item). CREATE TABLE might_like ( item INTEGER NOT NULL ,created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL ,child INTEGER

Re: [GENERAL] Scheduling backup via PgAgent

2008-11-20 Thread Dave Page
On Thu, Nov 20, 2008 at 5:41 AM, Abdul Rahman [EMAIL PROTECTED] wrote: Oh! I have got the mistake made by me. Actually I didn't start the PostgreSQL Scheduling Agent - pgAgent service. Now its working fine. I also have attached the complete document of my work for the sake of knowledge

Re: [GENERAL] row-level security (Dynamically rewrite queries)

2008-11-20 Thread Richard Huxton
Jonatan Evald Buus wrote: Essentially what I'd like to do is implement row-level security (what Oracle calls Virtual Private Database) but as far as I can find the last time this was discussed is several years ago and the general consensus ended up being use veil. Veil seems overly like an

Re: [GENERAL] where in (select array)

2008-11-20 Thread Grzegorz Jaśkiewicz
just as a little advice, I would actually use joins - for performance reasons. 'where in' seems to be rather slow, especially if you use it on large sets of data.

Re: [GENERAL] where in (select array)

2008-11-20 Thread Richard Huxton
Marcus Engene wrote: Hi List, I have the might_like table that contains products a user might like if he likes the present one (item). CREATE TABLE might_like ( item INTEGER NOT NULL ,created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL ,child

Re: [GENERAL] Serial - last value

2008-11-20 Thread Richard Huxton
hendra kusuma wrote: Hi there a little basic question here I usually use something like this in stored function to get the last value of a serial type column select last_value into ret from id_sequence return ret What i'm asking is, if many people run the same stored function at the

Re: [GENERAL] Using database to find file doublettes in my computer

2008-11-20 Thread Craig Ringer
Lothar Behrens wrote: I have expected a smaller amount of records due to the fact that for 4 files each available 2 times (sum = 8) I have 8 records in ECADFiles, but must have 4 in the above result. So for an average of 2 doubles I expected half the files from ECADFiles, because one is

Re: Res: Res: Res: [GENERAL] Archive files growth!!!

2008-11-20 Thread Craig Ringer
paulo matadr wrote: teste=# \d cliente_fone Table cadastro.cliente_fone Column |Type | Modifiers + -+ cfon_id|

Re: [GENERAL] PostgreSQL 8.4 download?

2008-11-20 Thread Craig Ringer
Scott Marlowe wrote: On Wed, Nov 19, 2008 at 6:28 AM, Josh Harrison [EMAIL PROTECTED] wrote: Hi Is version 8.4 available for download now ? If so can you direct me to he website? There's a daily snapshot available for download off the main dl tree. Go to the download page and look for the

Re: [GENERAL] COPY problem on -- strings

2008-11-20 Thread Richard Huxton
Sabin Coanda wrote: Hi, I have PostgreSQL 8.3.5, compiled by Visual C++ build 1400 on Windows OS. I try to use the COPY command to optimize the backup/restore performance, but I found a problem. I reproduce it below. I can't reproduce it here on 8.3 on linux. I backup the database

Re: [GENERAL] transaction_read_only effects on performance, actual meaning (was: How to reduce impact of a query)

2008-11-20 Thread Craig Ringer
Howard Cole wrote: You'll be pleased to know that changing the transaction to read only (SET TRANSACTION READ ONLY) as you suggested seemed to prevent the server from slowing to a halt. Actually, I'm mostly surprised by that. I primarily suggested issuing the command to ensure that if your

Re: [GENERAL] return MAX and when it happened

2008-11-20 Thread Sam Mason
On Wed, Nov 19, 2008 at 05:06:14PM -0600, Scara Maccai wrote: Sam Mason wrote: The custom aggregate sounds the most elegant, it's just annoying that it's so much fiddling to get it all working to start with Thanks. I think I wrote it, but there's something I don't get from the docs: do I

[GENERAL] Fetch query which triggered a rule

2008-11-20 Thread Jonatan Evald Buus
Greetings, Is it possible to fetch the query which triggered a rule? I.e. suppose I create the following rule: CREATE RULE MyRule AS ON Select TO MyTable_Tbl DO INSTEAD process_query($sql); Where $sql represents the query which triggered the rule. Appreciate the input Cheers Jona

[GENERAL] hidden errors calling a volatile function inside a stable function

2008-11-20 Thread Sabin Coanda
Hi, I have PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) on Windows OS , but I experienced the same problem on PostgreSQL 8.3.5, compiled by Visual C++ build 1400 too. I attach the demo database here, to be available to test according with the

Re: [GENERAL] where in (select array)

2008-11-20 Thread Marcus Engene
Richard Huxton wrote: Marcus Engene wrote: Hi List, I have the might_like table that contains products a user might like if he likes the present one (item). CREATE TABLE might_like ( item INTEGER NOT NULL ,created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP

Re: [GENERAL] date range query help

2008-11-20 Thread Sam Mason
On Thu, Nov 20, 2008 at 01:10:41PM +1100, novice wrote: select * from mobile_custodian; custodian_id | user_id | issue_date | return_date | mobile_no --+-++-+- 4 | Ben | 2008-10-11 | 2008-10-13 | 09455225998

[GENERAL] join with redundant results VS simpler join plus multiple selects

2008-11-20 Thread WireSpot
I have a schema with galleries, people and images. Each person has a bunch of private images. People can join any number of galleries and can publish any of their images to the galleries they join (or not). I'd like to retrieve a data set where for a given gallery id I get all the people AND all

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread WireSpot
On Thu, Nov 20, 2008 at 10:56, Albe Laurenz [EMAIL PROTECTED] wrote: Do you still need the old prepared statement? If not, you can simple DEALLOCATE it and then try the PREPARE again. Yes, I'd like to keep the old statements, that's part of the perks -- if a query will be repeated it will

Re: [GENERAL] transaction_read_only effects on performance, actual meaning (was: How to reduce impact of a query)

2008-11-20 Thread Ivan Sergio Borgonovo
On Thu, 20 Nov 2008 20:24:42 +0900 Craig Ringer [EMAIL PROTECTED] wrote: Howard Cole wrote: You'll be pleased to know that changing the transaction to read only (SET TRANSACTION READ ONLY) as you suggested seemed to prevent the server from slowing to a halt. Actually, I'm mostly

Re: [GENERAL] hidden errors calling a volatile function inside a stable function

2008-11-20 Thread Merlin Moncure
On Thu, Nov 20, 2008 at 6:21 AM, Sabin Coanda [EMAIL PROTECTED] wrote: Hi, I have PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) on Windows OS , but I experienced the same problem on PostgreSQL 8.3.5, compiled by Visual C++ build 1400 too. I attach

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Merlin Moncure
On Wed, Nov 19, 2008 at 2:42 PM, WireSpot [EMAIL PROTECTED] wrote: I'm trying to use prepared statements in an application and I'm running into this error: Query failed: prepared statement already exists. The reason is obvious. What I want to know is the best way to avoid getting this error.

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Albe Laurenz
Please, send your replies to the list as well. WireSpot wrote: Do you still need the old prepared statement? If not, you can simple DEALLOCATE it and then try the PREPARE again. Yes, I'd like to keep the old statements, that's part of the perks -- if a query will be repeated it will

Res: [GENERAL] Archive files growth!!!

2008-11-20 Thread paulo matadr
see results: oid | relname| reltype | reltuples | relpages | size_kb ---+--+-+---+--+- 16506 | cliente_fone | 16507 |341130 | 3345 | 26760 any configuration about wal_buffer x checkpoint_segments can help me?

Re: Res: [GENERAL] Archive files growth!!!

2008-11-20 Thread Craig Ringer
paulo matadr wrote: see results: oid | relname| reltype | reltuples | relpages | size_kb ---+--+-+---+--+- 16506 | cliente_fone | 16507 |341130 | 3345 | 26760 OK, so there is no TOAST table either. I am out of ideas.

Re: [GENERAL] hidden errors calling a volatile function inside a stable function

2008-11-20 Thread Craig Ringer
Merlin Moncure wrote: On Thu, Nov 20, 2008 at 6:21 AM, Sabin Coanda [EMAIL PROTECTED] wrote: Hi, I have PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) on Windows OS , but I experienced the same problem on PostgreSQL 8.3.5, compiled by Visual C++ build

Re: [GENERAL] join with redundant results VS simpler join plus multiple selects

2008-11-20 Thread Craig Ringer
WireSpot wrote: I have a schema with galleries, people and images. Each person has a bunch of private images. People can join any number of galleries and can publish any of their images to the galleries they join (or not). I'd like to retrieve a data set where for a given gallery id I get all

Re: [SQL] [GENERAL] date range query help

2008-11-20 Thread Frank Bax
novice wrote: 2008/11/20 Rodrigo E. De León Plicet [EMAIL PROTECTED]: On Wed, Nov 19, 2008 at 10:03 PM, novice [EMAIL PROTECTED] wrote: sorry I get nothing :( Of course not. None of the dates you gave in the example overlap. But it should still have the 1st entry with the name Ben? Am I

Re: [GENERAL] COPY problem on -- strings

2008-11-20 Thread Sabin Coanda
Sorry, my fault that I run the script in the query window of pgAdmin, not in the system console. I check it again in the system console and it works well. Thanks, Sabin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Alvaro Herrera
Merlin Moncure escribió: On Wed, Nov 19, 2008 at 2:42 PM, WireSpot [EMAIL PROTECTED] wrote: 3) Reading a list of all the currently defined prepared statements to see if the one I want is already prepared. I'm hoping some magic SELECT in pg's internal tables may do the trick. But I also

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread WireSpot
Merlin Moncure escribió: pg_prepared_statements (on recent versions of postgresql) Thank you, that's one of the things I wanted to know. On Thu, Nov 20, 2008 at 15:30, Alvaro Herrera [EMAIL PROTECTED] wrote: Merlin Moncure escribió: also, watch out for race conditions. What race

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Sam Mason
On Wed, Nov 19, 2008 at 09:42:33PM +0200, WireSpot wrote: I also imagined some workarounds in the code (PHP), such as defining a global/static hash table and registering statement names with it. But I'd like to know if there's a better way. Have you thought about using stored procedures

Re: [GENERAL] join with redundant results VS simpler join plus multiple selects

2008-11-20 Thread WireSpot
On Thu, Nov 20, 2008 at 15:05, Craig Ringer [EMAIL PROTECTED] wrote: That's probably going to be the case. PostgreSQL won't need to read the redundant info in from disk each time, and relative to the image data it's going to be pretty small. By doing it all in one join you're avoiding the

Re: [GENERAL] return MAX and when it happened

2008-11-20 Thread Scara Maccai
Sam Mason wrote: On Wed, Nov 19, 2008 at 05:06:14PM -0600, Scara Maccai wrote: I think I wrote it, but there's something I don't get from the docs: do I have to call get_call_result_type(fcinfo, NULL, tupdesc) I've always tried to stay away from C level extensions so far! How many

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread WireSpot
On Thu, Nov 20, 2008 at 15:45, Sam Mason [EMAIL PROTECTED] wrote: On Wed, Nov 19, 2008 at 09:42:33PM +0200, WireSpot wrote: I also imagined some workarounds in the code (PHP), such as defining a global/static hash table and registering statement names with it. But I'd like to know if there's a

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Alvaro Herrera
WireSpot escribió: I guess he means if connections are persistent, or if the same connection is being used at the same time from different parts of the application. I guess if connections are persistent, you could clear them before each usage with DISCARD (8.3 only) -- Alvaro Herrera

[GENERAL] on error logs the whole multiline script

2008-11-20 Thread Sabin Coanda
Hi, I have PostgreSQL 8.3.5, compiled by Visual C++ build 1400, and I found when I run a script and an error occurs, all the script content is logged. My previous postgres version PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special) logged just the function

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Sam Mason
On Thu, Nov 20, 2008 at 04:03:08PM +0200, WireSpot wrote: On Thu, Nov 20, 2008 at 15:45, Sam Mason [EMAIL PROTECTED] wrote: Have you thought about using stored procedures instead of prepared statements? No need to register them or keep track of that state. I'm not sure if it would work.

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread WireSpot
On Thu, Nov 20, 2008 at 16:07, Alvaro Herrera [EMAIL PROTECTED] wrote: I guess if connections are persistent, you could clear them before each usage with DISCARD (8.3 only) Again, I'd be losing the advantage of the already prepared statements. Basically, what it comes down it is I want to

[GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Brandon Metcalf
Here is an example of the caching problem I described yesterday in a post. I have the following tables: db= \d bmetcalf.foo1; Table bmetcalf.foo1 Column | Type | Modifiers ---+--+--- country | text | replicaID | text | host | text | replica

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Richard Huxton
Brandon Metcalf wrote: Here is an example of the caching problem I described yesterday in a post. I have the following tables: And here is the SQL for the function and trigger definitions: CREATE OR REPLACE FUNCTION bmetcalf.foo_func() RETURNS TRIGGER LANGUAGE plperlu AS $$

Re: [GENERAL] start/stop error message

2008-11-20 Thread Peter Eisentraut
David wrote: [EMAIL PROTECTED]:/etc/init.d$ sudo /etc/init.d/postgresql-8.2 start * Starting PostgreSQL 8.2 database server * Error: specified cluster does not exist [fail] and the same error when passing stop The cluster clearly

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Brandon Metcalf
d == [EMAIL PROTECTED] writes: d Brandon Metcalf wrote: d Here is an example of the caching problem I described yesterday in a d post. I have the following tables: d And here is the SQL for the function and trigger definitions: d dCREATE OR REPLACE FUNCTION bmetcalf.foo_func() d

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Richard Huxton
Brandon Metcalf wrote: Yep, it seems that's the problem. If I pass in $table and use a lexical variable defined inside do_delete(), the problem goes away. So, this is where my understanding of how triggers work lacks. For a given session, each execution of a trigger isn't completely

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Brandon Metcalf
d == [EMAIL PROTECTED] writes: d Brandon Metcalf wrote: d Yep, it seems that's the problem. If I pass in $table and use a d lexical variable defined inside do_delete(), the problem goes away. d So, this is where my understanding of how triggers work lacks. For a d given session, each

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Brandon Metcalf
b == [EMAIL PROTECTED] writes: b d == [EMAIL PROTECTED] writes: b d Brandon Metcalf wrote: b d Yep, it seems that's the problem. If I pass in $table and use a b d lexical variable defined inside do_delete(), the problem goes away. b d So, this is where my understanding of how

Re: [GENERAL] lesslog incorrect resource manager data checksum.

2008-11-20 Thread Jean-Christophe Arnu
Koichi-san, full_page_writes are written to be on by default in the global user configuration file (i.e. postgresql.conf). Query to the server showed that it is : show full_page_writes ; full_page_writes -- on I use the RPM version provided on pgfoundry. The main problem is

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Richard Huxton
Brandon Metcalf wrote: d == [EMAIL PROTECTED] writes: d Brandon Metcalf wrote: d Yep, it seems that's the problem. If I pass in $table and use a d lexical variable defined inside do_delete(), the problem goes away. d So, this is where my understanding of how triggers work lacks.

Re: [GENERAL] transaction_read_only effects on performance, actual meaning (was: How to reduce impact of a query)

2008-11-20 Thread Tom Lane
Craig Ringer [EMAIL PROTECTED] writes: I'm quite curious about why setting the transaction to readonly helped its performance. Could it be to do with setting hint bits or something along those lines, perhaps? Anyone? AFAIK that's actually a pessimization. Declaring the transaction READ ONLY

Re: List Ettiquette (perhaps Off Topic by now) was: Re: [GENERAL] Database access over the Internet...

2008-11-20 Thread Bruce Momjian
Scott Marlowe wrote: In my view, anything that causes people to check more closely about exactly where a reply is being sent is a good thing. Really? Really? I spend a fair bit of time on these lists helping people out. If I have to examine my reply-tos every time I'm done. I hit

Re: [GENERAL] date range query help

2008-11-20 Thread Tom Lane
Sam Mason [EMAIL PROTECTED] writes: I sometimes find it easier to store ranges like this with having the open ends at infinity. This is easier with timestamps as they have magic 'infinity' values in PG (both positive and negative). Values of date type don't have any special values like this

Re: [GENERAL] hidden errors calling a volatile function inside a stable function

2008-11-20 Thread Tom Lane
Craig Ringer [EMAIL PROTECTED] writes: Merlin Moncure wrote: On Thu, Nov 20, 2008 at 6:21 AM, Sabin Coanda [EMAIL PROTECTED] wrote: I found in a STABLE function, for instance TEST_0(), it is not allowed to use INSERT statement. Trying this will give me the error: ERROR: INSERT is not allowed

[GENERAL] Propose: enum with all registered table names?

2008-11-20 Thread Dmitry Koterov
Hello. Sometimes I want to save in a table reference to another table's name. E.g. I am creating an accounting system which (on triggers) logs which record is changed and in which table: CREATE TABLE log( tbl XXX, id INTEGER, blahblah ); Nowadays XXX may be: 1) Table name. But it is quite

Re: [GENERAL] Propose: enum with all registered table names?

2008-11-20 Thread Richard Huxton
Dmitry Koterov wrote: So it would be very useful if Postgres has a special, system ENUM (e.g. pg_catalog.table_names_enum) which holds names of all tables in the database (format: schema.table), and their elements are automatically renamed when a table is renamed. Too late :-) It's

Re: [GENERAL] compiling libpq.dll with Borland C++, is it possible?

2008-11-20 Thread Bruce Momjian
Tony Caduto wrote: Hi, I am trying to compile my own copy of libpq.dll using bcc32.exe, the docs say it is possible, but I get a error when it tries to compile dirent.c Has anyone been able to do this? Oh, that's a shame. We usually get feedback once per major release from Borland CC users

Re: [GENERAL] Propose: enum with all registered table names?

2008-11-20 Thread Alvaro Herrera
Dmitry Koterov wrote: CREATE TABLE log( tbl XXX, id INTEGER, blahblah ); Use type regclass. -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support -- Sent via pgsql-general mailing list

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread Daniel Verite
Albe Laurenz wrote: You'll have to find a way to pick or generate unique names for the prepared statements. You could check for name collisions and disambiguate with a suffix or something. By the way, why do the prepared statements require to be named at all? With other DBMS such as

Re: [GENERAL] Propose: enum with all registered table names?

2008-11-20 Thread Tom Lane
Richard Huxton [EMAIL PROTECTED] writes: It's regclass you're after I think. A fairly large problem with either regclass or a hypothetical system-maintained enum is that a table with such a column effectively has a data dependency on all the tables it mentions. Which pg_dump won't know about,

Re: [GENERAL] compiling libpq.dll with Borland C++, is it possible?

2008-11-20 Thread Alvaro Herrera
Tony Caduto wrote: Hi, I am trying to compile my own copy of libpq.dll using bcc32.exe, the docs say it is possible, but I get a error when it tries to compile dirent.c How hard would it be to set up a buildfarm member that exercises the Borland compiler? If it only compiles client code,

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Brandon Metcalf
d == [EMAIL PROTECTED] writes: d Brandon Metcalf wrote: d d == [EMAIL PROTECTED] writes: d d d Brandon Metcalf wrote: d d Yep, it seems that's the problem. If I pass in $table and use a d d lexical variable defined inside do_delete(), the problem goes away. d d So, this is

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Richard Huxton
Brandon Metcalf wrote: OK. I understand the Perl part of what is going on. What I don't understand is why $table in do_delete() hangs around. It seems this is more a characteristic of how triggers work in pgsql. At any rate, I appreciate the input since it provides me with a fix.

Re: [GENERAL] example of really weird caching (or whatever) problem

2008-11-20 Thread Brandon Metcalf
d == [EMAIL PROTECTED] writes: d Brandon Metcalf wrote: d d OK. I understand the Perl part of what is going on. What I don't d understand is why $table in do_delete() hangs around. It seems this d is more a characteristic of how triggers work in pgsql. At any rate, d I appreciate

Re: [GENERAL] join with redundant results VS simpler join plus multiple selects

2008-11-20 Thread Craig Ringer
WireSpot wrote: On Thu, Nov 20, 2008 at 15:05, Craig Ringer [EMAIL PROTECTED] wrote: That's probably going to be the case. PostgreSQL won't need to read the redundant info in from disk each time, and relative to the image data it's going to be pretty small. By doing it all in one join you're

[GENERAL] Sorting JTA survey results

2008-11-20 Thread wstrzalka
http://www.postgresqlcertification.org/jta/2008/results Having point 4 as an example: For how long have you been a PostgreSQL database administrator? Less than 1 year36 I wish.

[GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Josh Harrison
Hi, I tried the 8.4-devel version and the CTE (Common Table Expression -WITH RECURSIVE ) patch is working pretty good. I just have a question These are the queries their plan . The first query uses RECURSIVE keyword (and has a recursive and non-recursive term as CTE) while the second query uses

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Tom Lane
Josh Harrison [EMAIL PROTECTED] writes: My question is when I don't use the Recursive term does the optimizer just consider it as a subquery or does it work like Oracle's WITH CLAUSE (Subquery Factoring) ? Oracle's WITH CLAUSE boosts the performance of the queries. So does this do the same?

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Christophe
On Nov 20, 2008, at 1:21 PM, Tom Lane wrote: See the fine manual, for instance last para here: http://developer.postgresql.org/pgdocs/postgres/queries-with.html Fine manual indeed... this the best explanation of WITH RECURSIVE I've ever read. Kudos to the documentation writer(s). -- Sent

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Josh Harrison
Thanks Tom. This is wonderful On Thu, Nov 20, 2008 at 4:21 PM, Tom Lane [EMAIL PROTECTED] wrote: Josh Harrison [EMAIL PROTECTED] writes: My question is when I don't use the Recursive term does the optimizer just consider it as a subquery or does it work like Oracle's WITH CLAUSE

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Thomas Kellerer
Tom Lane wrote on 20.11.2008 22:21: Josh Harrison [EMAIL PROTECTED] writes: My question is when I don't use the Recursive term does the optimizer just consider it as a subquery or does it work like Oracle's WITH CLAUSE (Subquery Factoring) ? Oracle's WITH CLAUSE boosts the performance of the

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Bruce Momjian
Thomas Kellerer wrote: Tom Lane wrote on 20.11.2008 22:21: Josh Harrison [EMAIL PROTECTED] writes: My question is when I don't use the Recursive term does the optimizer just consider it as a subquery or does it work like Oracle's WITH CLAUSE (Subquery Factoring) ? Oracle's WITH CLAUSE

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Thomas Kellerer
Bruce Momjian wrote on 20.11.2008 22:56: From http://umitanuki.net/pgsql/wfv08/design.html I got the impression that windowing functions will make into (at least partially) into 8.4 because on that page several items are marked with [DONE]. I can't see anything in the developer docs regarding

Re: [GENERAL] Question about the WITH RECURSIVE patch

2008-11-20 Thread Bruce Momjian
Thomas Kellerer wrote: Bruce Momjian wrote on 20.11.2008 22:56: From http://umitanuki.net/pgsql/wfv08/design.html I got the impression that windowing functions will make into (at least partially) into 8.4 because on that page several items are marked with [DONE]. I can't see

[GENERAL] Porting from Oracle PL/SQL

2008-11-20 Thread Daniel Clark
While doing a Google search recently, I found a nice site located at http://www.redhat.com/docs/manuals/database/RHDB-2.0-Manual/prog/plpgsql-porting.html. The number and quality of Postgres related book titles has grown, and greatly improved over the years. With the increased popularity of

[GENERAL] lo data type

2008-11-20 Thread John Zhang
Hi there, I am writing to seek your assistance on how to set up the lo data type for large objects. I am using postres 3.3. By default, the data type lo is not created by the installation, right? How to create one? Any input would be much appreciated. Thanks. John

Re: [GENERAL] lo data type

2008-11-20 Thread Alan Hodgson
On Thursday 20 November 2008, John Zhang [EMAIL PROTECTED] wrote: Hi there, I am writing to seek your assistance on how to set up the lo data type for large objects. I am using postres 3.3. By default, the data type lo is not created by the installation, right? How to create one? Any input

[GENERAL] Reversing transactions on a large scale

2008-11-20 Thread snacktime
Right now we are running mysql as that is what was there when I entered the scene. We might switch to postgres, but I'm not sure if postgres makes this any easier. We run a couple of popular games on social networking sites. These games have a simple economy,and we need to be able to time warp

Re: [GENERAL] Reversing transactions on a large scale

2008-11-20 Thread Scott Marlowe
On Thu, Nov 20, 2008 at 4:36 PM, snacktime [EMAIL PROTECTED] wrote: Right now we are running mysql as that is what was there when I entered the scene. We might switch to postgres, but I'm not sure if postgres makes this any easier. We run a couple of popular games on social networking sites.

Re: [GENERAL] Porting from Oracle PL/SQL

2008-11-20 Thread Scott Marlowe
On Thu, Nov 20, 2008 at 4:05 PM, Daniel Clark [EMAIL PROTECTED] wrote: While doing a Google search recently, I found a nice site located at http://www.redhat.com/docs/manuals/database/RHDB-2.0-Manual/prog/plpgsql-porting.html. The number and quality of Postgres related book titles has grown,

Re: [GENERAL] Reversing transactions on a large scale

2008-11-20 Thread Tom Lane
On Thu, Nov 20, 2008 at 4:36 PM, snacktime [EMAIL PROTECTED] wrote: Right now we are running mysql as that is what was there when I entered the scene. We might switch to postgres, but I'm not sure if postgres makes this any easier. We run a couple of popular games on social networking

[GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Tom Lane
I got interested by Bruce's plot of PG email traffic here http://momjian.us/main/img/pgincoming.gif and decided to try to extend it into the past. The data I have available is just my own incoming mail log, but being a pack-rat by nature I have that back to April 1998. Attached is a graph of

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Bruce Momjian
Tom Lane wrote: I got interested by Bruce's plot of PG email traffic here http://momjian.us/main/img/pgincoming.gif and decided to try to extend it into the past. The data I have available is just my own incoming mail log, but being a pack-rat by nature I have that back to April 1998.

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: So, to a first approximation, the PG list traffic has been constant since 2000. Not the result I expected. I also was confused by its flatness. I am finding the email traffic almost impossible to continue tracking, so something

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Tom Lane wrote: So, to a first approximation, the PG list traffic has been constant since 2000. Not the result I expected. I also was confused by its flatness. I am finding the email traffic almost impossible to continue

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Joshua D. Drake
On Thu, 2008-11-20 at 22:36 -0500, Tom Lane wrote: I got interested by Bruce's plot of PG email traffic here http://momjian.us/main/img/pgincoming.gifto and decided to try to extend it into the past. The data I have available is just my own incoming mail log, but being a pack-rat by nature

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Tom Lane
Joshua D. Drake [EMAIL PROTECTED] writes: I know that my email (I am pretty sure I am subscribed to at least as many lists as you) has been on a steady incline, especially through -general and -hackers. I would have said the same, which is why I find it noteworthy that my mail logs don't seem

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread brian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: I am finding the email traffic almost impossible to continue tracking, so something different is happening, but it seems it is not volume-related. Yes, my perception also is that it's getting harder and harder to keep up with the list

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Joshua D. Drake
On Thu, 2008-11-20 at 23:46 -0500, Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: I know that my email (I am pretty sure I am subscribed to at least as many lists as you) has been on a steady incline, especially through -general and -hackers. I would have said the same, which

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Joshua D. Drake
On Thu, 2008-11-20 at 21:19 -0800, Joshua D. Drake wrote: On Thu, 2008-11-20 at 23:46 -0500, Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: I know that my email (I am pretty sure I am subscribed to at least as many lists as you) has been on a steady incline, especially through

Re: [GENERAL] Postgres mail list traffic over time

2008-11-20 Thread Joshua D. Drake
On Fri, 2008-11-21 at 00:06 -0500, brian wrote: Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: I am finding the email traffic almost impossible to continue tracking, so something different is happening, but it seems it is not volume-related. Yes, my perception also is

Re: [GENERAL] join with redundant results VS simpler join plus multiple selects

2008-11-20 Thread WireSpot
On Thu, Nov 20, 2008 at 20:40, Craig Ringer [EMAIL PROTECTED] wrote: I'm not even sure how you'd achieve that (exactly 3 randomly selected images per user) in with a single query. Then again, it's stupidly late here, so my brain may not be working. Any chance you can post a query that shows

Re: [GENERAL] start/stop error message

2008-11-20 Thread Martijn van Oosterhout
On Thu, Nov 20, 2008 at 12:22:24AM -0500, David wrote: I am unable to solve the following problem. When I start or stop PostgreSQL using pg_ctl (without the -D option) the system works fine. No errors. I have the PGDATA environment variable set and it points to my cluster. What did you do

Re: [GENERAL] Prepared statement already exists

2008-11-20 Thread WireSpot
On Thu, Nov 20, 2008 at 19:19, Daniel Verite [EMAIL PROTECTED] wrote: By the way, why do the prepared statements require to be named at all? With other DBMS such as oracle or mysql, one can prepare statements without providing any name for them: the prepare() step returns a statement handle

Re: [GENERAL] Serial - last value

2008-11-20 Thread Richard Huxton
hendra kusuma wrote: Let me get this clear it should looks like this? create function something() returns integer as $$ declare ret integer; begin -- just assume something table has a serial column as primary key insert into something values ('a value'); select

[GENERAL]transaction isolation level in plpgsql function

2008-11-20 Thread Sergey Moroz
Is there any way to set transaction isolation level inside plpgsql function? In my case I have no control of transaction before function is started. -- Sincerely, Sergey Moroz