[GENERAL] Documentation suggestion

2011-05-11 Thread Thomas Kellerer
Hi, I'd like to suggest a little enhancement to the documentation chapter about file-system backup http://www.postgresql.org/docs/current/static/backup-file.html As I regularly see people copying files between different operating systems, I think it would be a good idea to add a third

[GENERAL] invalid byte sequence for encoding UTF8: 0xf1612220

2011-05-11 Thread AI Rumman
I am trying to migrate a database from Postgresql 8.2 to Postgresql 8.3 and getting the following error: pg_restore: [archiver (db)] Error from TOC entry 2764; 0 29708702 TABLE DATA originaldata postgres pg_restore: [archiver (db)] COPY failed: ERROR: invalid byte sequence for encoding UTF8:

Re: Fwd: Re: [GENERAL] SSDD reliability

2011-05-11 Thread Toby Corkindale
BTW, I saw a news article today about a brand of SSD that was claiming to have the price effectiveness of MLC-type chips, but with lifetime of 4TB/day over 5 years. http://www.storagereview.com/anobit_unveils_genesis_mlc_enterprise_ssds which also links to:

[GENERAL] Custom types and JDBC

2011-05-11 Thread mephysto
Hi, I would use custom types in several stored functions and I would my sotred function return these custom types. I would launch stored functions and retrieve results by JDBC interface: is it possible to map postgres custom types to java objects without resultset use? Thanks in advance. Meph

[GENERAL] Re: One-off attempt at catalog hacking to turn bytea column into text

2011-05-11 Thread Noah Misch
On Tue, May 10, 2011 at 04:31:37PM -0400, Vlad Romascanu wrote: As a one-off attempt to change a large table's 'bytea' column to 'text' with minimal I/O (where the 'bytea' contents is already valid UTF8 and the database encoding is also UTF8, and the column is not part of any index or anything

[GENERAL] Postgres federation

2011-05-11 Thread Tim Uckun
I want to set up a central database and several satellite databases which use some of the data from the central database. For example Say my central database contains people records, with a many to many relationship with clients records. Each client has their own database but needs read, write

[GENERAL] Custom types and JDBC

2011-05-11 Thread mephysto
Hi, I would use custom types in several stored functions and I would my sotred function return these custom types. I would launch stored functions and retrieve results by JDBC interface: is it possible to map postgres custom types to java objects without resultset use? Thanks in advance. Meph

[GENERAL] ERROR: cannot execute nextval() in a read-only transaction

2011-05-11 Thread Dae-man Yang
I upgrade postgresql from 8.4.2 to 9.0.4. But I have one problem. The Error message 'cannot execute nextval() in a read-only transaction' Please help me. [Version 8.4.2] DEVDB=# select version(); version

[GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Stanislav Raskin
Hello everybody, I was experimenting with the FTS feature on postgres 8.3.4 lately and encountered a weird performance issue when using a custom FTS configuration. I use this german ispell dictionary, re-encoded to utf8:

Re: [GENERAL] track functions call

2011-05-11 Thread Mark
Thanks for quick reply, but I want to know, which of these method is called in concrete situation. I suppose, that ts_rank call only one of these functions(ts_rank_wttf , ts_rank_wtt , ts_rank_ttf ,ts_rank_tt ). Is it possible? Thanks for reply Mark -- View this message in context:

[GENERAL] ts_rank vs ts_rank_cd

2011-05-11 Thread Mark
Hi I have tested ts_rank and ts_rank_cd for searching in Wikipedia. I would like to know which of them is better for searching in wikipedia. I have read something like that ts_rank_cd is better for long sentences, oposite ts_rank is better for single terms. But generally which of them is better to

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Pavel Stehule
Hello 2011/5/11 Stanislav Raskin ras...@livn.de: Hello everybody, I was experimenting with the FTS feature on postgres 8.3.4 lately and encountered a weird performance issue when using a custom FTS configuration. I use this german ispell dictionary, re-encoded to utf8:

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Tom Lane
Stanislav Raskin ras...@livn.de writes: The problem is, that if I open a new connection to the database and do something like this SELECT to_tsquery('german_de', 'abcd'); it takes A LOT of time for the query to complete for the first time. About 1-1,5s. If I submit the same query for a

Re: [GENERAL] Custom types and JDBC

2011-05-11 Thread Dave Cramer
Hi, I'm not sure what you mean by without result set ? There is no real way to get information back from the driver except using a result set. Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Wed, May 11, 2011 at 3:19 AM, mephysto genna...@email.it wrote: Hi, I would

Re: [GENERAL] Custom types and JDBC

2011-05-11 Thread mephysto
This is the point! I would to know if an alternative of resultset exist to retrieve custom data types from postgres by jdbc. I explained me? -- View this message in context: http://postgresql.1045698.n5.nabble.com/Custom-types-and-JDBC-tp4387382p4387475.html Sent from the PostgreSQL - general

Re: [GENERAL] Custom types and JDBC

2011-05-11 Thread Adrian Klaver
On Wednesday, May 11, 2011 7:07:25 am mephysto wrote: This is the point! I would to know if an alternative of resultset exist to retrieve custom data types from postgres by jdbc. I explained me? Not sure:) The information is in the server and the JDBC driver is external to the server, so

Re: [GENERAL] temporarily disabling foreign keys

2011-05-11 Thread Seb
On Tue, 10 May 2011 14:29:48 -0400, Vick Khera vi...@khera.org wrote: in recent versions of postgres, there is a replication mode designed specifically for replication software to disable FK's and other triggers. Perhaps investigate that. the other option is to make your FK's deferrable,

[GENERAL] Recursive select / updates

2011-05-11 Thread Alex -
Hi,I have a problem where i need to calculate totals in a table that are based on previous values and calculations.I am currently doing that in a function which works fine but was wondering if there is a more elegant or efficient way to do this. Here is an example table, ordered by row no.The

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Pavel Stehule
Hello 2011/5/11 Stanislav Raskin ras...@livn.de: On 11.05.11 15:45, Pavel Stehule pavel.steh...@gmail.com wrote: it is expected behave :( . A loading of ispell dictionary is very slow. Use a german snowball instead. You can you a some pooling connection software too. Thank you for the

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Stanislav Raskin
Yes, loading a large dictionary is known to be a fairly expensive operation. There's been discussions about how to make it cheaper, but nothing's been done yet. regards, tom lane Hi Tom, thanks for the quick response. Bad news for me ;( We develop ajax-driven web apps, which

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Stanislav Raskin
On 11.05.11 15:45, Pavel Stehule pavel.steh...@gmail.com wrote: it is expected behave :( . A loading of ispell dictionary is very slow. Use a german snowball instead. You can you a some pooling connection software too. Thank you for the response. Is the dictionary german_stem supplied with

Re: [GENERAL] Custom types and JDBC

2011-05-11 Thread mephysto
M no, my goal is for example: define a typeFoo (id as int, name as varchar) in postgres, define an object in java objFoo (id as int, name string), define a stored function in posgres return a typeFoo create ora replace function getFoo() returns typeFoo as $$ begin .. end; $$ I would to

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread tv
Yes, loading a large dictionary is known to be a fairly expensive operation. There's been discussions about how to make it cheaper, but nothing's been done yet. regards, tom lane Hi Tom, thanks for the quick response. Bad news for me ;( We develop ajax-driven web apps, which

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Pavel Stehule
2011/5/11 Stanislav Raskin ras...@livn.de: On 11.05.11 16:42, Pavel Stehule pavel.steh...@gmail.com wrote: I wrote a patch that stores loaded dictionary in shared memory. Hi Pavel, very interesting. I will give it a closer look. What do you think about using ispell to create, store and

[GENERAL] Regexp match not working.. (SQL help)

2011-05-11 Thread Phoenix Kiula
I have a text column in a table, which I want to search through -- seeking the occurrence of about 300 small strings in it. Let's say the table is like this: table1 ( id bigint primary key ,mytext text ,mydate timestamp without time zone ); I am using this

[GENERAL] Query to return every 1st Sat of a month between two dates

2011-05-11 Thread Alex -
Hi,is there an easy way to return the date of every first Saturday of a month in a data range i.e. 2011-2013 Any help would be appreciated ThanksAlex

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Tom Lane
Stanislav Raskin ras...@livn.de writes: Is there any way of hack or compromise to achieve good performance without losing fts ability? I am thinking, for example, of a way to permanently keep a loaded dictionary in memory instead of loading it for every connection. As I wrote in response to

Re: [GENERAL] Custom types and JDBC

2011-05-11 Thread Adrian Klaver
On 05/11/2011 08:03 AM, mephysto wrote: M no, my goal is for example: define a typeFoo (id as int, name as varchar) in postgres, define an object in java objFoo (id as int, name string), define a stored function in posgres return a typeFoo create ora replace function getFoo() returns

Re: [GENERAL] Custom types and JDBC

2011-05-11 Thread Tom Lane
mephysto genna...@email.it writes: my goal is for example: define a typeFoo (id as int, name as varchar) in postgres, define an object in java objFoo (id as int, name string), define a stored function in posgres return a typeFoo You'd probably be better off asking about this in the pgsql-jdbc

Re: [GENERAL] Regexp match not working.. (SQL help)

2011-05-11 Thread Tom Lane
Phoenix Kiula phoenix.ki...@gmail.com writes: I am using this SQL: SELECT id FROM table1 WHERE mytext ~* E'sub1|sub2|sub3|sub4...' LIMIT 10; This is basically working, but some of the mytext columns being returned that do not contain any of these substrings. [ raised

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Stanislav Raskin
On 11.05.11 16:42, Pavel Stehule pavel.steh...@gmail.com wrote: I wrote a patch that stores loaded dictionary in shared memory. Hi Pavel, very interesting. I will give it a closer look. What do you think about using ispell to create, store and index tsvectors, but at the same time to use the

[GENERAL] Read Committed transaction with long query

2011-05-11 Thread Durumdara
Hi! Two table: Main Lookup The query is: select Main.*, Lookup.Name left join Lookup on (Main.Type_ID = Lookup.ID) Lookup: ID Name 1 Value1 2 Value 2 3 Value 3 Many records is in Main table (for example 1 million). What happens in this case (C = connection): C1.) begin read committed C1.)

Re: [GENERAL] full text search to_tsquery performance with ispell dictionary

2011-05-11 Thread Oleg Bartunov
On Wed, 11 May 2011, Stanislav Raskin wrote: Yes, loading a large dictionary is known to be a fairly expensive operation. There's been discussions about how to make it cheaper, but nothing's been done yet. regards, tom lane Hi Tom, thanks for the quick response. Bad news for

[GENERAL] Returning NULL to a set returning C type function

2011-05-11 Thread Bborie Park
I have a C type function that returns a set of a type. The problem I have is that the underlying function may return NULL. When the underlying function returns NULL, I get the error message: ERROR: function returning set of rows cannot return null value I'm wondering what is the proper way

Re: [GENERAL] Query to return every 1st Sat of a month between two dates

2011-05-11 Thread Michael Nolan
On Wed, May 11, 2011 at 10:22 AM, Alex - ainto...@hotmail.com wrote: Hi, is there an easy way to return the date of every first Saturday of a month in a data range i.e. 2011-2013 This is one way to do it:, there are others: select '2011-01-01'::date + s.a as dates from

Re: [GENERAL] Returning NULL to a set returning C type function

2011-05-11 Thread Tom Lane
Bborie Park bkp...@ucdavis.edu writes: I have a C type function that returns a set of a type. The problem I have is that the underlying function may return NULL. When the underlying function returns NULL, I get the error message: ERROR: function returning set of rows cannot return null

Re: [GENERAL] Regexp match not working.. (SQL help)

2011-05-11 Thread David Johnston
I am using this SQL: SELECT id FROM table1 WHERE mytext ~* E'sub1|sub2|sub3|sub4...' LIMIT 10; This is basically working, but some of the mytext columns being returned that do not contain any of these substrings. Am I doing the POSIX regexp wrongly? This same thing

Re: [GENERAL] Returning NULL to a set returning C type function

2011-05-11 Thread Bborie Park
Don't do that ;-). You could choose either to not return any row at all when this happens, or to construct an all-nulls row to return. ExecMakeTableFunctionResult doesn't want to guess which behavior is appropriate for your use-case, so it just complains. regards, tom

Re: [GENERAL] track functions call

2011-05-11 Thread Cédric Villemain
2011/5/10 Mark marek.bal...@seznam.cz: Thanks for quick reply, but I want to know, which of these method is called in concrete situation. I suppose, that ts_rank call only one of these functions(ts_rank_wttf , ts_rank_wtt , ts_rank_ttf ,ts_rank_tt ). Is it possible? Yes, same table: select

Re: [GENERAL] PGA

2011-05-11 Thread salah jubeh
Hello Andrew, You are right, it is pgaccess Thanks From: Andrew Sullivan a...@crankycanuck.ca To: pgsql-general@postgresql.org Sent: Tue, May 10, 2011 4:01:42 PM Subject: Re: [GENERAL] PGA On Tue, May 10, 201t 06:53:11AM -0700, salah jubeh wrote:

Re: [GENERAL] FILLFACTOR and increasing index

2011-05-11 Thread Tomas Vondra
Hi, I've studied the implementation of the btree indexes and how exactly the fillfactor is used, and in general - when a page split happens, the process needs to obtain more locks than with simple insert, which may result in contention with other processes that modify the index (the same

Re: [GENERAL] Urgent Order

2011-05-11 Thread Joshua J. Kugler
On Saturday 07 May 2011, John R Pierce elucidated thus: On 05/07/11 6:08 AM, Bob Wilson wrote: Hello This is Bob and I will like to order ( Indexing Table )Do get back to me with the types and cost for the ones you do carry and let me know if there is an extra cost when using visa or

[GENERAL] Sharing data between databases

2011-05-11 Thread Tim Uckun
What is the preferred way to share tables between databases? I read about dblink but it doesn't seem optimal because it needs to pull in the entire query every time the view is referenced so it might be highly inefficient if I am trying to join a dblinked table with a local table. Cheers. --

Re: [GENERAL] Debug Contrib/cube code

2011-05-11 Thread Joshua Tolley
On Fri, May 06, 2011 at 10:43:23AM +0530, Nick Raj wrote: Hi, I am using postgresql-8.4.6. I want to debug the contrib/cube code. Can we able to debug that cube code? Because there is no .configure file to enable debug. Is there is any way to change make file to enable debug? If your

Re: [GENERAL] ERROR: cannot execute nextval() in a read-only transaction

2011-05-11 Thread Craig Ringer
On 05/11/2011 02:29 PM, Dae-man Yang wrote: I upgrade postgresql from 8.4.2 to 9.0.4. But I have one problem. The Error message 'cannot execute nextval() in a read-only transaction' Please help me. nextval() modifies a sequence, so you shouldn't be doing it in a read-only transaction. Pg

Re: [GENERAL] invalid byte sequence for encoding UTF8: 0xf1612220

2011-05-11 Thread Craig Ringer
On 05/11/2011 03:16 PM, AI Rumman wrote: I am trying to migrate a database from Postgresql 8.2 to Postgresql 8.3 and getting the following error: pg_restore: [archiver (db)] Error from TOC entry 2764; 0 29708702 TABLE DATA originaldata postgres pg_restore: [archiver (db)] COPY failed: ERROR:

Re: [GENERAL] Sharing data between databases

2011-05-11 Thread Craig Ringer
On 05/12/2011 08:48 AM, Tim Uckun wrote: What is the preferred way to share tables between databases? I read about dblink but it doesn't seem optimal because it needs to pull in the entire query every time the view is referenced so it might be highly inefficient if I am trying to join a

Re: [GENERAL] Sharing data between databases

2011-05-11 Thread Tim Uckun
That's disappointing. I guess I'll have to look towards a replication solution. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Sharing data between databases

2011-05-11 Thread John R Pierce
On 05/11/11 8:10 PM, Tim Uckun wrote: That's disappointing. I guess I'll have to look towards a replication solution. or carefully structure your dblink joins so they can perform efficiently, possibly using temp tables as a sort of materialized view. thats really all that the fancier

Re: [GENERAL] Sharing data between databases

2011-05-11 Thread Tim Uckun
or carefully structure your dblink joins so they can perform efficiently, possibly using temp tables as a sort of materialized view. According to the documents unless you are writing procedural code with cursors when you touch the dblink view it will pull the entire table/recordset over.

Re: [GENERAL] Sharing data between databases

2011-05-11 Thread John R Pierce
On 05/11/11 9:04 PM, Tim Uckun wrote: or carefully structure your dblink joins so they can perform efficiently, possibly using temp tables as a sort of materialized view. According to the documents unless you are writing procedural code with cursors when you touch the dblink view it will pull