Re: [GENERAL] What is statement ID of table?

2009-10-12 Thread A. Kretschmer
In response to Jignesh Shah : Thanks Andreas. Sorry for confusion here. I mean statement ID that can be associated with prepared query(not table) to improve performance of building query. I just need to find plan using statement ID and execute it. I don't know how to do this. Please, answer

Re: [GENERAL] table full scan or index full scan?

2009-10-12 Thread Martijn van Oosterhout
On Sun, Oct 11, 2009 at 10:01:52PM -0500, Peter Hunsberger wrote: This is interesting, I just ran a similar issue the other day. Clearly there is a wide range of read / write scenarios that Postgres should be able to cover. These days, I have a lot of designs leaning more toward the data

Re: [GENERAL] What is statement ID of table?

2009-10-12 Thread paragasu
you can create a primary key to associate with each row in the table On 10/12/09, A. Kretschmer andreas.kretsch...@schollglas.com wrote: In response to Jignesh Shah : Thanks Andreas. Sorry for confusion here. I mean statement ID that can be associated with prepared query(not table) to improve

[GENERAL] Window function order changing order of whole query

2009-10-12 Thread Thom Brown
I tried posting this on the pgsql-sql but they don't seem to be posting successfully there, so I'm re-posting it here. I've had a look at examples of lag and lead window functions with order by inside the OVER clause, and I'm confused as to why it influences the overall order in the output. For

Re: [GENERAL] Window function order changing order of whole query

2009-10-12 Thread Martijn van Oosterhout
On Mon, Oct 12, 2009 at 09:13:09AM +0100, Thom Brown wrote: I tried posting this on the pgsql-sql but they don't seem to be posting successfully there, so I'm re-posting it here. I've had a look at examples of lag and lead window functions with order by inside the OVER clause, and I'm

[GENERAL] auth problem

2009-10-12 Thread Vasiliy G Tolstov
Hello. Today i'm try to install postresql an init database initdb --pgdata=/media/pgsql --encoding=utf8 --locale=en_US.UTF-8 --auth=crypt --username=postgres --pwprompt password is crypted $1$qJzh/8AD$Q0wVsHF9XE9NmA/8uKjy2/ then i start postgresql and try to connect via psql following message

Re: [GENERAL] full text + snowball + ispell?

2009-10-12 Thread Cédric Villemain
Le vendredi 09 octobre 2009 19:31:56, Dominic Bevacqua a écrit : Hi This is probably a naive question, but what would I gain from using snowball and ispell dictionaries in tsearch2, as described here: http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intr o.html ?

Re: [GENERAL] strange plpgsql error

2009-10-12 Thread Merlin Moncure
On Sun, Oct 11, 2009 at 6:21 PM, SunWuKung ralik...@hotmail.com wrote: Yep, it is probably a bug though. It's not...it's just the way plpgsql works. I prefix all my local variables in plpgsql with an underscore to prevent these kinds of conflicts. merlin -- Sent via pgsql-general mailing

Re: [GENERAL] Where can I get the number of plans that considered by Planner?

2009-10-12 Thread 纪晓曦
What I want to count is the number of plans that have been considered cheapest_path. Since if a path is considered to be a cheapest_path, the postgres optimizer need to spent time on comparison. I think this is what I want. 2009/10/4 Martijn van Oosterhout klep...@svana.org On Sat, Oct 03,

Re: [GENERAL] Where can I get the number of plans that considered by Planner?

2009-10-12 Thread 纪晓曦
Is it a reasonable idea to add a counter to set_cheapest? I think this function evaluate the cheapest path. Therefore, it means how many complete plans have been considered, doesn't it? 2009/10/12 纪晓曦 sheep...@gmail.com What I want to count is the number of plans that have been considered

Re: [GENERAL] auth problem

2009-10-12 Thread Peter Eisentraut
On Mon, 2009-10-12 at 15:17 +0400, Vasiliy G Tolstov wrote: Hello. Today i'm try to install postresql an init database initdb --pgdata=/media/pgsql --encoding=utf8 --locale=en_US.UTF-8 --auth=crypt --username=postgres --pwprompt password is crypted $1$qJzh/8AD$Q0wVsHF9XE9NmA/8uKjy2/

Re: [GENERAL] auth problem

2009-10-12 Thread Vasiliy G Tolstov
В Пнд, 12/10/2009 в 15:04 +0300, Peter Eisentraut пишет: Use --auth=md5. Why? crypt is deprecated? -- Vasiliy G Tolstov v.tols...@selfip.ru Selfip.Ru -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

[GENERAL] Dumping without Postgis functions

2009-10-12 Thread Tyler Durden
Hi, I'm trying to migrate a database from an old posgresql 8.1 server to a new one 8.3. I have the Postgis installed on that old database, that is not used. When I try to restore the database, several errors happens because of the various links to libs of Postgis on the disk . How do I dump the

Re: [GENERAL] auth problem

2009-10-12 Thread Peter Eisentraut
On Mon, 2009-10-12 at 16:06 +0400, Vasiliy G Tolstov wrote: В Пнд, 12/10/2009 в 15:04 +0300, Peter Eisentraut пишет: Use --auth=md5. Why? crypt is deprecated? Yes, and removed in 8.4. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Gaini Rajeshwar
Hi, is there a way to rank the search results based on multiple fields in postgreSQL? For example, i have *title*, *abstract*, *summary*, *body* as fields/columns in my database. When user searches on *title*, i want to rank the results based on *title* field as well as *summary* field, where

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Raymond O'Donnell
On 12/10/2009 14:16, Gaini Rajeshwar wrote: Hi, is there a way to rank the search results based on multiple fields in postgreSQL? For example, i have *title*, *abstract*, *summary*, *body* as fields/columns in my database. When user searches on *title*, i want to rank the results based on

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Raymond O'Donnell
On 12/10/2009 14:23, Raymond O'Donnell wrote: Hoe do you define importance? Whoops... for Hoe read How :-) Ray. -- Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland r...@iol.ie Galway Cathedral Recitals:

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Gaini Rajeshwar
I think you misunderstood my question. let me give clear idea about what i need. I am using PostgreSQL fulltext search (tsearch2) feature to implement searching on database. From readings i came to know that we can give weights to different fields in database something like this:

[GENERAL] Cascading of trigger execution level

2009-10-12 Thread Naoko Reeves
Hello, Is there a way to identify cascading of trigger execution level? Please let me know if my question doesn't make any sense.

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Ivan Sergio Borgonovo
On Mon, 12 Oct 2009 18:46:02 +0530 Gaini Rajeshwar raja.rajeshwar2...@gmail.com wrote: Hi, is there a way to rank the search results based on multiple fields in postgreSQL? For example, i have *title*, *abstract*, *summary*, *body* as fields/columns in my database. When user searches on

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Ivan Sergio Borgonovo
On Mon, 12 Oct 2009 19:11:01 +0530 Gaini Rajeshwar raja.rajeshwar2...@gmail.com wrote: I think you misunderstood my question. let me give clear idea about what i need. I am using PostgreSQL fulltext search (tsearch2) feature to implement searching on database. From readings i came to know

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Gaini Rajeshwar
Ivan, If i create a tsvector as you mentioned with concatenation operator, my search query will search in any of these fields which are concatenated in my tsvector. For example, if i create tsvector like this, UPDATE document_table SET search_col = setweight(to_tsvector(coalesce(title,'')), 'A')

Re: [GENERAL] Where can I get the number of plans that considered by Planner?

2009-10-12 Thread Tom Lane
=?UTF-8?B?57qq5pmT5pum?= sheep...@gmail.com writes: Is it a reasonable idea to add a counter to set_cheapest? You can try it but I think you'll find it's not terribly useful. That will effectively just give you a count of the number of join combinations that were considered (plus the number of

Re: [GENERAL] Dumping without Postgis functions

2009-10-12 Thread Tom Lane
Tyler Durden tylersti...@gmail.com writes: I'm trying to migrate a database from an old posgresql 8.1 server to a new one 8.3. I have the Postgis installed on that old database, that is not used. When I try to restore the database, several errors happens because of the various links to libs

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Ivan Sergio Borgonovo
On Mon, 12 Oct 2009 19:26:55 +0530 Gaini Rajeshwar raja.rajeshwar2...@gmail.com wrote: Ivan, If i create a tsvector as you mentioned with concatenation operator, my search query will search in any of these fields which are concatenated in my tsvector. For example, if i create tsvector like

Re: [GENERAL] Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Gaini Rajeshwar
On Mon, Oct 12, 2009 at 7:26 PM, Ivan Sergio Borgonovo m...@webthatworks.it wrote: On Mon, 12 Oct 2009 19:11:01 +0530 Gaini Rajeshwar raja.rajeshwar2...@gmail.com wrote: I think you misunderstood my question. let me give clear idea about what i need. I am using PostgreSQL fulltext

Re: [GENERAL] [HACKERS] contrib/plantuner - enable PostgreSQL planner hints

2009-10-12 Thread Hans-Juergen Schoenig -- PostgreSQL
hi there ... for this work i will include you in my evening prayers for at least one week. i know there has been a lot of discussion about this but what you just posted it excellent and more important: USEFUL to many people. i had something else in mind recently as well: virtual indexes. it

Re: [GENERAL] strange plpgsql error

2009-10-12 Thread Ralikwen
Dunno, if it was a documented behavior it should fail both on on 8.1 Linux and on 8.4 Windows, but it only fails on 8.4 Windows. I will try to create a clear test. Merlin Moncure-2 wrote: On Sun, Oct 11, 2009 at 6:21 PM, SunWuKung ralik...@hotmail.com wrote: Yep, it is probably a bug

[GENERAL] ERROR: simple_heap_delete: tuple already updated by self

2009-10-12 Thread utsav
Dear All , I am using postgres 7.3. on RHEL 4.0 I have table on which there are duplicate rows even though there is a primary key constraint.I dont know how the rows got duplicate , because in my s/w there is no such possibility. Wel till now i used to delete the row duplicate row with the

Re: [GENERAL] table full scan or index full scan?

2009-10-12 Thread peixubin
I understood , thanks. --- 09年10月12日,周一, Martijn van Oosterhout klep...@svana.org 写道: 发件人: Martijn van Oosterhout klep...@svana.org 主题: Re: [GENERAL] table full scan or index full scan? 收件人: Peter Hunsberger peter.hunsber...@gmail.com 抄送: Scott Marlowe scott.marl...@gmail.com, ??

Re: [GENERAL] ERROR: simple_heap_delete: tuple already updated by self

2009-10-12 Thread Tom Lane
utsav utsav.tur...@newgen.co.in writes: I am using postgres 7.3. on RHEL 4.0 7.3.what? If it's not 7.3.21 then an update would probably be worth your time. In particular there were fixes in 7.3.14 and 7.3.20 that could possibly explain this. If it is 7.3.21, then I think an upgrade to a

Re: [GENERAL] Nested transactions

2009-10-12 Thread David Fetter
On Sun, Oct 11, 2009 at 07:41:54PM -0700, Bill Todd wrote: Does PostgreSQL support nested transactions as shown below? BEGIN; ...do some stuff... BEGIN; ...more stuff... COMMIT; COMMIT; It depends what you want to have happen when the outer transaction rolls back. If you want all

[GENERAL] setweight detailed doc was: Ranking search results using multiple fields in PostgreSQL fulltext search

2009-10-12 Thread Ivan Sergio Borgonovo
On Mon, 12 Oct 2009 20:02:16 +0530 Gaini Rajeshwar raja.rajeshwar2...@gmail.com wrote: inputquery := setweight(cfg, inputtitle, 'A', ''); inputquery := inputquery setweight(cfg, inputsummary, 'B', ''); I didn't understand why did u use '' operator in setweight function. is that going

Re: [GENERAL] Is there a way to know if trigger is invoked by the code from another trigger

2009-10-12 Thread Erik Jones
On Oct 11, 2009, at 10:51 AM, Naoko Reeves wrote: Could you tell me if there is a way to know if trigger is invoked by the code from another trigger? For instance, table A Trigger deletes table B record. While in table B trigger, I want to know whether this was triggered from table A.

[GENERAL] PostgreSQL Conference West, registration closing

2009-10-12 Thread Joshua D. Drake
PostgreSQL Conference West is set to start this Friday. Online registration for PostgreSQL Conference West will be closing October 14th. If you have not yet registered now is the time. You can register online here: http://www.postgresql.us/purchase Review the schedule here:

Re: [GENERAL] Inheritance on foreign key

2009-10-12 Thread Erik Jones
On Oct 9, 2009, at 9:57 AM, Takeichi Kanzaki Cabrera wrote: Hi everybody, I need your help. I have a hierarchy of tables, and other table that has a foreign key with the top table of the hierarchy, can I insert a value into the other table where the value it reference is not on the parent

[GENERAL] creating a function with another function

2009-10-12 Thread Dave Huber
Is it possible to execute a CREATE OR REPLACE FUNCTION with another function or even have a function modify itself? Dave This electronic mail message is intended exclusively for the individual(s) or entity to which it is addressed. This message, together with

Re: [GENERAL] creating a function with another function

2009-10-12 Thread David Fetter
On Mon, Oct 12, 2009 at 02:12:35PM -0500, Dave Huber wrote: Is it possible to execute a CREATE OR REPLACE FUNCTION with another function or even have a function modify itself? Yes, but doing any of that is a sign that you're working with a broken design. That, or you're looking to make an

Re: [GENERAL] creating a function with another function

2009-10-12 Thread Merlin Moncure
On Mon, Oct 12, 2009 at 3:41 PM, David Fetter da...@fetter.org wrote: On Mon, Oct 12, 2009 at 02:12:35PM -0500, Dave Huber wrote: Is it possible to execute a CREATE OR REPLACE FUNCTION with another function or even have a function modify itself? Yes, but doing any of that is a sign that

Re: [GENERAL] creating a function with another function

2009-10-12 Thread Dave Huber
Surely, there are valid cases of having a function create a function. Suppose (just off the top of my head), you create a helper function that generates triggers on a table for record archiving. My application is for archiving. I'm using partitioned tables (each 10 records) to keep a

Re: [GENERAL] creating a function with another function

2009-10-12 Thread David Fetter
On Mon, Oct 12, 2009 at 03:36:47PM -0500, Dave Huber wrote: Surely, there are valid cases of having a function create a function. Suppose (just off the top of my head), you create a helper function that generates triggers on a table for record archiving. My application is for

Re: [GENERAL] Nested transactions

2009-10-12 Thread Bill Todd
Scott Marlowe wrote: On Sun, Oct 11, 2009 at 8:41 PM, Bill Todd p...@dbginc.com wrote: Does PostgreSQL support nested transactions as shown below? BEGIN; ...do some stuff... BEGIN; ...more stuff... COMMIT; COMMIT; Postgresql uses savepoints. Savepoints do not provide the

Re: [GENERAL] Nested transactions

2009-10-12 Thread Jeff Davis
On Mon, 2009-10-12 at 16:18 -0700, Bill Todd wrote: Savepoints do not provide the same functionality as nested or parallel transactions because you cannot commit a savepoint. What does it mean to commit a subtransaction or savepoint? What can you do with a subtransaction that you can't do with

Re: [GENERAL] Nested transactions

2009-10-12 Thread Alvaro Herrera
Jeff Davis escribió: On Mon, 2009-10-12 at 16:18 -0700, Bill Todd wrote: Savepoints do not provide the same functionality as nested or parallel transactions because you cannot commit a savepoint. What does it mean to commit a subtransaction or savepoint? What can you do with a

[GENERAL] `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

2009-10-12 Thread Dan Kortschak
Hi, I'm using the perl DBI module to interface with Pg, generating a number of tables and then loading them into a postgres database (this is to automate a previously psql-based setup). One instance of loading the data looks like this, but I am only able to do this as a superuser (this is

Re: [GENERAL] `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

2009-10-12 Thread Stephen Frost
* Dan Kortschak (dan.kortsc...@adelaide.edu.au) wrote: $dbh-do(COPY chromosome_data FROM '.chromosomes(\%options).' CSV); Does anyone have any suggestions (the least bad of the options above seems to be to use psql, but I think that is ugly)? perldoc DBD::Pg Read the 'COPY support' section.

Re: [GENERAL] `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

2009-10-12 Thread Dan Kortschak
Thanks for that. On Mon, 2009-10-12 at 20:21 -0400, Stephen Frost wrote: * Dan Kortschak (dan.kortsc...@adelaide.edu.au) wrote: $dbh-do(COPY chromosome_data FROM '.chromosomes(\%options).' CSV); Does anyone have any suggestions (the least bad of the options above seems to be to use psql,

Re: [GENERAL] `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

2009-10-12 Thread Sam Mason
On Tue, Oct 13, 2009 at 11:10:12AM +1030, Dan Kortschak wrote: On Mon, 2009-10-12 at 20:21 -0400, Stephen Frost wrote: Read the 'COPY support' section. Seems like the way to go, though it will be significantly slower than psql or superuser reads (a couple of tables have ~10s-100sM rows).

Re: [GENERAL] `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

2009-10-12 Thread Stephen Frost
* Dan Kortschak (dan.kortsc...@adelaide.edu.au) wrote: On Mon, 2009-10-12 at 20:21 -0400, Stephen Frost wrote: Does anyone have any suggestions (the least bad of the options above seems to be to use psql, but I think that is ugly)? perldoc DBD::Pg Read the 'COPY support' section.

Re: [GENERAL] `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

2009-10-12 Thread Dan Kortschak
Thanks again. On Mon, 2009-10-12 at 21:14 -0400, Stephen Frost wrote: Seems like the way to go, though it will be significantly slower than psql or superuser reads (a couple of tables have ~10s-100sM rows). Erm, really? You've tested that and found it to be that much slower? Sorry,

Re: [GENERAL] Where can I get the number of plans that considered by Planner?

2009-10-12 Thread 纪晓曦
Yeah, the problem is when I test large join, the plan considered by geqo is large than path. (3000+ vs 500+). However, the time used in optimizer of geqo is 1/4 of path. By the way, I use the same query. Another thing is for the join of 2 tables, geqo consider 60-90 plans. In general, I think for

Re: [GENERAL] Is there a way to know if trigger is invoked by the code from another trigger

2009-10-12 Thread Craig Ringer
On Mon, 2009-10-12 at 10:36 -0700, Erik Jones wrote: On Oct 11, 2009, at 10:51 AM, Naoko Reeves wrote: Could you tell me if there is a way to know if trigger is invoked by the code from another trigger? For instance, table A Trigger deletes table B record. While in table B trigger,

Re: [GENERAL] How useful is the money datatype?

2009-10-12 Thread Craig Ringer
On Sun, 2009-10-04 at 17:12 +0100, Sam Mason wrote: There is an open source library by IBM that I use in my C++ code to do this, and may be it can be incorporated into PG it is called decNumber http://speleotrove.com/decimal/decnumber.html How would this help over PG's existing

Re: [GENERAL]

2009-10-12 Thread Craig Ringer
On Thu, 2009-09-24 at 07:33 -0700, Ms swati chande wrote: LOG: server process (PID 3304) was terminated by exception 0xC005 The execution for this and other queries has been fine so far. What is exception 0xC005?

[GENERAL] Are there only 4 weights in PostgreSQL fulltext search?

2009-10-12 Thread Gaini Rajeshwar
Hi, From the readings and documentation, i understood that there are 4 weights * A,B,C,D *(*1.0, 0.4, 0.2, 0.1* are the defalut values, which can be changed) to rank the search results. But using just these 4 weights is too less to rank the search results, as i have many fields to use for ranking.

Re: [GENERAL] Nested transactions

2009-10-12 Thread Scott Marlowe
On Mon, Oct 12, 2009 at 5:18 PM, Bill Todd p...@dbginc.com wrote: Scott Marlowe wrote: On Sun, Oct 11, 2009 at 8:41 PM, Bill Todd p...@dbginc.com wrote: Does PostgreSQL support nested transactions as shown below? BEGIN;  ...do some stuff...  BEGIN;   ...more stuff...  COMMIT; COMMIT;

[GENERAL] Cannot start the postgres service

2009-10-12 Thread Mitesh51
If I move any file from the \PostgreSQL\8.4\data\pg_xlog\ then postgres services are stopped I cannot start them. I need to reinstall the postgres. -- View this message in context: http://www.nabble.com/Cannot-start-the-postgres-service-tp25867194p25867194.html Sent from the PostgreSQL -

[GENERAL] WAL handling issue.

2009-10-12 Thread Mitesh51
When I set archive_mode = on # allows archiving to be done # (change requires restart) archive_command = 'copy %p C:\\archivedir\\%f' # command to use to archive a logfile segment in postgres...WAL files are created. But I am not

Re: [GENERAL] Are there only 4 weights in PostgreSQL fulltext search?

2009-10-12 Thread Christophe Pettus
On Oct 12, 2009, at 9:59 PM, Gaini Rajeshwar wrote: From the readings and documentation, i understood that there are 4 weights A,B,C,D (1.0, 0.4, 0.2, 0.1 are the defalut values, which can be changed) to rank the search results. But using just these 4 weights is too less to rank the search

Re: [GENERAL] Are there only 4 weights in PostgreSQL fulltext search?

2009-10-12 Thread Gaini Rajeshwar
On Tue, Oct 13, 2009 at 11:00 AM, Christophe Pettus x...@thebuild.comwrote: On Oct 12, 2009, at 9:59 PM, Gaini Rajeshwar wrote: From the readings and documentation, i understood that there are 4 weights A,B,C,D (1.0, 0.4, 0.2, 0.1 are the defalut values, which can be changed) to rank the