Re: [GENERAL] Using sequences in SQL text files

2008-02-20 Thread HHB
Thank you all for your help. Let me summer what I'm trying to do: I have an empty database that I want to populate it with data. I created SQL text files, categories.sql, books.sql As I'm a Java guy, I use Apache Ant SQL taks to run those SQL text files. So, I run categories.sql file first,

Re: [GENERAL] uninstalling tsearch2 error: gin_tsvector_ops does not exist for access method gin

2008-02-20 Thread Magnus Hagander
On Tue, Feb 19, 2008 at 07:58:20PM -0500, Tom Lane wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: when i try to uninstall tsearch2 i get this error, Hmm, maybe you originally put tsearch2 into some other schema than public? If so, try setting search_path to point to that schema before

Re: [GENERAL] Using sequences in SQL text files

2008-02-20 Thread Thomas
On 20 févr. 08, at 08:57, HHB wrote: Thank you all for your help. Let me summer what I'm trying to do: I have an empty database that I want to populate it with data. I created SQL text files, categories.sql, books.sql As I'm a Java guy, I use Apache Ant SQL taks to run those SQL text

[GENERAL] longest prefix match

2008-02-20 Thread Dragan Zubac
Hello Anybody got any ideas/experiences/links for 'longest prefix match' solution in PostgreSQL ? Basically,put some telephone prefices in some kind of trie,and be able to perform fast lookups ? Sincerely Dragan Zubac ---(end of broadcast)---

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Postgres User
a final question: why does this syntax do a seq scan + filter: select * from tablea where fielda = fielda -or- select * from tablea where fielda in (fielda) while this syntax results in no filter, seq scan only select * from tablea where 1 = 1 it seems that both where clauses should be

Re: [GENERAL] SPI-functions and transaction control

2008-02-20 Thread Mikko Partio
On Feb 19, 2008 12:12 AM, Alvaro Herrera [EMAIL PROTECTED] wrote: Mikko Partio escribió: Now, I was wondering if a c function would be faster, and with the help of the manual I have written a function that can insert tuples from one table to another. As the manual states (

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Martijn van Oosterhout
On Wed, Feb 20, 2008 at 12:56:54AM -0800, Postgres User wrote: a final question: why does this syntax do a seq scan + filter: select * from tablea where fielda = fielda -or- select * from tablea where fielda in (fielda) while this syntax results in no filter, seq scan only select *

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Tino Wildenhain
Postgres User wrote: im trying to allow the client to pass a varchar param into my function, and want to avoid any parsing of the parameter inside the function, or code to build a sql string. if the function can use this code, it will be compiled and optimized (unlike a dynamic sql stirng)

Re: [GENERAL] longest prefix match

2008-02-20 Thread Jorge Godoy
Em Wednesday 20 February 2008 05:55:07 Dragan Zubac escreveu: Anybody got any ideas/experiences/links for 'longest prefix match' solution in PostgreSQL ? Basically,put some telephone prefices in some kind of trie,and be able to perform fast lookups ? Prefix or suffix? For prefix you can

Re: [GENERAL]

2008-02-20 Thread Jorge Godoy
Em Wednesday 20 February 2008 03:56:37 Scott Marlowe escreveu: On Feb 19, 2008 11:39 PM, Tom Lane [EMAIL PROTECTED] wrote: http://www.postgresql.org/docs/8.3/static/plpgsql-cursors.html section 38.7.3.5. But then I go to the index page for plpgsql at

Re: [GENERAL] longest prefix match

2008-02-20 Thread Oleg Bartunov
On Wed, 20 Feb 2008, Jorge Godoy wrote: Em Wednesday 20 February 2008 05:55:07 Dragan Zubac escreveu: Anybody got any ideas/experiences/links for 'longest prefix match' solution in PostgreSQL ? Basically,put some telephone prefices in some kind of trie,and be able to perform fast lookups ?

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Postgres User
Tino, My users are developers and the goal was to accept a simple comma-delimited list of string values as a function's input parameter. The function would then parse this input param into a valid regex expression. I was trying to write a function that lets me avoid using Execute string and

[GENERAL] is a unique key on null field bad?

2008-02-20 Thread Geoffrey
So, we are trying to track down some problems we're having with an implementation of slony on our database. I've posted to the slony list about this issue, but I wanted to get a more generic response from the perspective of postgresql. Is it a 'bad thing' to have a unique key on a field that

Re: [GENERAL] is a unique key on null field bad?

2008-02-20 Thread Peter Childs
On 20/02/2008, Geoffrey [EMAIL PROTECTED] wrote: So, we are trying to track down some problems we're having with an implementation of slony on our database. I've posted to the slony list about this issue, but I wanted to get a more generic response from the perspective of postgresql. Is it

Re: [GENERAL] dynamic crosstab

2008-02-20 Thread Balázs Klein
I always hope that somebody might have something similar but generic - eg. create those columns automatically and just treat them all as text. I came up with this amateurish one based on http://www.ledscripts.com/tech/article/view/5.html. Maybe someone can use it: takes - a select statement

Re: [GENERAL] is a unique key on null field bad?

2008-02-20 Thread Geoffrey
Peter Childs wrote: On 20/02/2008, Geoffrey [EMAIL PROTECTED] wrote: So, we are trying to track down some problems we're having with an implementation of slony on our database. I've posted to the slony list about this issue, but I wanted to get a more generic response from the perspective of

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Tom Lane
Postgres User [EMAIL PROTECTED] writes: My users are developers and the goal was to accept a simple comma-delimited list of string values as a function's input parameter. The function would then parse this input param into a valid regex expression. Why are you fixated on this being a regex?

Re: [GENERAL] Order of SUBSTR and UPPER in statement

2008-02-20 Thread Carlo Stonebanks
Hermann Muster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I encountered something I can't really explain. I use the following statement in my application: COALESCE(UPPER(SUBSTR(Y.Firma,1,7)),'') This returns ERROR: syntax error at end of input However, using the

[GENERAL] select...into non-temp table raises 'duplicate key ... pg_type_typname_nsp_index'

2008-02-20 Thread Carlo Stonebanks
When performing a select ... into ... an app crashed out with the error 'duplicate key violates unique constraint pg_type_typname_nsp_index' I looked in the mail lists and I see this error associated with TEMPORARY tables, but the into table is not a temp table. A previous

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Postgres User
Tom, I was looking for another approach but didn't come across that array syntax in my searches (perhaps because it's newer. Thanks for a solution. Now to end my fixation, one last item. What about the case of a null or empty param value- is there a way to assign a condition value that

[GENERAL] pgplsql and arrays

2008-02-20 Thread Dan Str
Hi List ! I have a problem with defining an array in pl/pgsql using an already defined column in a table. Is it possible to define an array ( v_var1 ) as in my example below: If it is not possible now it would be really nice to have in a future release , maybe something for 8.4 wishlist ?

[GENERAL] Vacuous errors in pg_dump ... | pg_restore pipeline

2008-02-20 Thread Kynn Jones
Hi. I've written a Unix shell (zsh) script to streamline the process of duplicating a database. At the heart of this script I have the following pipeline: pg_dump -U $OWNER -Fc $FROM | pg_restore -U $OWNER -d $TO As far as the shell is concerned, this pipeline fails, due to three errors

[GENERAL] Suggestions for schema design?

2008-02-20 Thread cluster
I really need some input: In a system that handles money transfers I have a table to store each money transfer. A number of different events can result in a money transfer but the events are so different that each event type is stored in its own table. So we have a schema of the form:

Re: [GENERAL] Vacuous errors in pg_dump ... | pg_restore pipeline

2008-02-20 Thread Douglas McNaught
On 2/20/08, Kynn Jones [EMAIL PROTECTED] wrote: Alternatively, is there a better way to streamline the duplication of a database? How about: CREATE DATABASE newdb TEMPLATE olddb; (don't remember the exact syntax, but it'll be in the docs for CREATE DATABASE). I think the 'createdb' program

Re: [GENERAL] Using sequences in SQL text files

2008-02-20 Thread intelforum
HHB wrote: Thank you all for your help. Let me summer what I'm trying to do: I have an empty database that I want to populate it with data. I created SQL text files, categories.sql, books.sql As I'm a Java guy, I use Apache Ant SQL taks to run those SQL text files. So, I run categories.sql

Re: [GENERAL] Suggestions for schema design?

2008-02-20 Thread brian
cluster wrote: I really need some input: In a system that handles money transfers I have a table to store each money transfer. A number of different events can result in a money transfer but the events are so different that each event type is stored in its own table. So we have a schema of

Re: [GENERAL] Vacuous errors in pg_dump ... | pg_restore pipeline

2008-02-20 Thread Tom Lane
Kynn Jones [EMAIL PROTECTED] writes: As far as the shell is concerned, this pipeline fails, due to three errors emitted by pg_restore. All these errors are vacuous, as far as I can tell. They're hardly vacuous --- they're telling you that the destination database will be missing plpgsql, which

Re: [GENERAL] Vacuous errors in pg_dump ... | pg_restore pipeline

2008-02-20 Thread SunWuKung
On Feb 20, 8:12 pm, [EMAIL PROTECTED] (Douglas McNaught) wrote: On 2/20/08, Kynn Jones [EMAIL PROTECTED] wrote: Alternatively, is there a better way to streamline the duplication of a database? How about: CREATE DATABASE newdb TEMPLATE olddb; Do these methods also recreate the schema

[GENERAL] Error in PlPython procedure

2008-02-20 Thread mars_osrp
Hi All, I am using PlPython procedure to insert data in a table: plan = plpy.execute(insert into test(id,name) values(1 , 'test_py')) I am getting error: ERROR: invalid input syntax for integer: PLyResult object at 0x374a5a70 In fact preparing a plan and passing a list of values for columns

[GENERAL] ts_headline

2008-02-20 Thread Stephen Davies
I am a bit puzzled by the output of ts_headline (V8.3) for different queries. I have one record in a test documentation table and am applying different queries against that table to check out the ts_headline outputs. The document in question has 2553 words which generate 519 tokens in the

Re: [GENERAL] Error in PlPython procedure

2008-02-20 Thread brian
mars_osrp wrote: Hi All, I am using PlPython procedure to insert data in a table: plan = plpy.execute(insert into test(id,name) values(1 , 'test_py')) I am getting error: ERROR: invalid input syntax for integer: PLyResult object at 0x374a5a70 In fact preparing a plan and passing a list of

[GENERAL] Install problem w/8.3 on windows 2000 : application failed to initialize properly (0xc0000022)

2008-02-20 Thread Dee
Hi. This is my first post to this list. So please let me know if my question is in the wrong area. I am trying to install version 8.3.0.1 on an old windows 2000 box I inherited. Firewall s/w is installed but disabled. I am logged in as a user with Administrative rights. When the

Re: [GENERAL] Error in PlPython procedure

2008-02-20 Thread Erik Jones
On Feb 20, 2008, at 5:53 PM, mars_osrp wrote: Hi All, I am using PlPython procedure to insert data in a table: plan = plpy.execute(insert into test(id,name) values(1 , 'test_py')) I am getting error: ERROR: invalid input syntax for integer: PLyResult object at 0x374a5a70 In fact

[GENERAL] How to view temp tables

2008-02-20 Thread pc
My php code is creating temporary table named mytemp,but when I run a selec * from mytemp I cannot see the table.How can I see the table from postgresql command prompt? ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] How to make update rapidly?

2008-02-20 Thread hewei
Hi, Scott Marlowe: You said that As for processing them in order versus randomly,that's a common problem. do you know why? how postgres work in this scenario. On Wed, Feb 20, 2008 at 3:07 PM, Scott Marlowe [EMAIL PROTECTED] wrote: On Feb 19, 2008 9:38 PM, hewei [EMAIL PROTECTED] wrote:

Re: [GENERAL] How to view temp tables

2008-02-20 Thread Chris
pc wrote: My php code is creating temporary table named mytemp,but when I run a selec * from mytemp I cannot see the table.How can I see the table from postgresql command prompt? temp tables are automatically deleted when the connection is closed. make it a non-temp table :) -- Postgresql

Re: [GENERAL] How to view temp tables

2008-02-20 Thread Scott Marlowe
On Wed, Feb 20, 2008 at 7:30 PM, pc [EMAIL PROTECTED] wrote: My php code is creating temporary table named mytemp,but when I run a selec * from mytemp I cannot see the table.How can I see the table from postgresql command prompt? Got a code sample that shows this problem? I.e. create table

Re: [GENERAL] How to make update rapidly?

2008-02-20 Thread Scott Marlowe
On Thu, Feb 21, 2008 at 1:07 AM, hewei [EMAIL PROTECTED] wrote: Hi, Scott Marlowe: You said that As for processing them in order versus randomly,that's a common problem. do you know why? how postgres work in this scenario. Pretty much the same way any database would. it's likely that your