[GENERAL] Is your data okay?

2010-08-26 Thread Mike Christensen
I found this tool pretty helpful for validating my architectural decisions.. http://www.howfuckedismydatabase.com/ -- 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] Feature proposal

2010-08-26 Thread Adrian von Bidder
Heyho! On Wednesday 25 August 2010 09.15:33 wstrzalka wrote: > I'm currently playing with very large data import using COPY from > file. > > As this can be extremely long operation (hours in my case) the nice > feature would be some option to show operation progress - how many > rows were already

Re: [GENERAL] WAL Archive Log

2010-08-26 Thread Alvaro Herrera
Excerpts from Sam Nelson's message of jue ago 26 19:24:00 -0400 2010: > Is there a way to get postgres to write a line to the log file when it > creates a WAL file? We wrote a script that tries to grab the times between > WAL file creation and ingestion without stopping to make absolutely sure > t

[GENERAL] WAL Archive Log

2010-08-26 Thread Sam Nelson
Is there a way to get postgres to write a line to the log file when it creates a WAL file? We wrote a script that tries to grab the times between WAL file creation and ingestion without stopping to make absolutely sure that postgres actually logs the WAL file creation, and so we're kinda stuck sta

Re: [GENERAL] How to convert a binary filed to an integer field?

2010-08-26 Thread Scott Marlowe
On Wed, Aug 25, 2010 at 1:29 PM, wrote: > I have an application in the product. Now, one status field needs to have > three statuses instead of two. How to make a such change in PostgreSQL? You could also use bitstrings. -- To understand recursion, one must first understand recursion. -- S

Re: [GENERAL] looping on NEW and OLD in a trigger

2010-08-26 Thread Merlin Moncure
On Thu, Aug 26, 2010 at 12:59 PM, Michael P. Soulier wrote: > On 26/08/10 Tom Lane did say: > >> If you're trying to do this in plpgsql, the answer is you can't. >> plpgsql doesn't support dynamic field references, which is what you'd >> need for what (I think) you're trying to do. >> >> You can d

Re: [GENERAL] How to convert a binary filed to an integer field?

2010-08-26 Thread wei725
That shall work. I assume that 0 - false, 1 - true. Thank everyone for your suggestion. - Original Message - From: "Arjen Nienhuis" To: wei...@lycos.com Cc: pgsql-general@postgresql.org Sent: Thursday, August 26, 2010 4:56:09 AM GMT -08:00 US/Canada Pacific Subject: Re: [GENERAL] How to

Re: [GENERAL] How to convert a binary filed to an integer field?

2010-08-26 Thread Merlin Moncure
On Thu, Aug 26, 2010 at 1:47 PM, wrote: > I know what I need to do in the application for the change. My problem is > that I don't know a good process to make a such change in PostgreSQL. Since > the application is in production already, do I need to create another field > or convert the data

Re: [GENERAL] Weird behavior with custom operators

2010-08-26 Thread Matthieu HUIN
Hello Tom, Thanks for the answer. I think this is exactly what's happening here. What I cannot understand though, is why this specific error isn't thrown when using the others operators I defined that have the same kind of operands. About your last question; I created this datatype so that I coul

Re: [GENERAL] Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?

2010-08-26 Thread Tom Lane
Denis Papathanasiou writes: > So is it the case that, as in the documented example, I need to add a > column of type ts_vector to the table for the index to be most effective? You can do it either way, depending on what you want the queries to look like. One advantage of materializing the tsvec

Re: [GENERAL] Differences between to_tsquery() and plainto_tsquery() when it comes to applying an index?

2010-08-26 Thread Denis Papathanasiou
That index doesn't match the query, so it can't be used. Try select item_pk from node where tag='primaryIssuer.entityType' and to_tsvector('english', val) @@ plainto_tsquery('Limited Partnership'); Tom and Oleg: thank you for clarifying this. I see where I made the mistake in applying the e

Re: [GENERAL] looping on NEW and OLD in a trigger

2010-08-26 Thread Michael P. Soulier
On 26/08/10 Tom Lane did say: > If you're trying to do this in plpgsql, the answer is you can't. > plpgsql doesn't support dynamic field references, which is what you'd > need for what (I think) you're trying to do. > > You can do it in pltcl or plperl, and probably also plpython though > I don't

Re: [GENERAL] looping on NEW and OLD in a trigger

2010-08-26 Thread Tom Lane
"Michael P. Soulier" writes: > I'm very new to writing postgres procedures, and I'm trying to loop over > the fields in the NEW and OLD variables available in an after trigger, > and I can't quite get the syntax correct. If you're trying to do this in plpgsql, the answer is you can't. plpgsql do

[GENERAL] looping on NEW and OLD in a trigger

2010-08-26 Thread Michael P. Soulier
Hi, I'm very new to writing postgres procedures, and I'm trying to loop over the fields in the NEW and OLD variables available in an after trigger, and I can't quite get the syntax correct. Could someone point me at an example? Thanks, Mike -- Michael P. Soulier , 613-592-2122 x2522 "Any intel

Re: [GENERAL] unexpected message type 0x58 during COPY from stdin

2010-08-26 Thread bricklen
On Wed, Aug 25, 2010 at 12:20 PM, bricklen wrote: > On Wed, Aug 25, 2010 at 12:01 PM, Tom Lane wrote: >> >> bricklen writes: >> > I'm getting a strange error during reload of one of our databases. >> >> This appears to indicate that the server's first idea that there was >> trouble came when the

Re: [GENERAL] IBATIS support for postgres cursors

2010-08-26 Thread Guy Rouillier
On 8/26/2010 5:27 AM, atul.g...@globaldatapoint.com wrote: Hi Guy, Thanks for your reply. We were able to work out with type OTHER. How did you get OTHER to work? Did you define your own TypeHandler? -- Guy Rouillier -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To

Re: [GENERAL] Weird behavior with custom operators

2010-08-26 Thread Tom Lane
Matthieu HUIN writes: > xxx=> SELECT value FROM tags WHERE value > 3 LIMIT 1; > ERROR: unsupported type: 17886 I think you're probably hitting this: /* * Can't get here unless someone tries to use scalarltsel/scalargtsel on * an operator with one numeric and one non-numeric operan

[GENERAL] Weird behavior with custom operators

2010-08-26 Thread Matthieu HUIN
Greetings, I am using postgresql 8.4 (debian backport). In order to optimize some of my code I decided to go with a custom data type to which I associated operators and an operator class for indexation. Here is the code I use : -- 8<--- CREATE TYPE tagvalue AS (storedvalue text); CREATE OR

Re: [GENERAL] Optimizing queries that use multiple tables and many order by columns

2010-08-26 Thread Joshua Berry
On Thu, Aug 26, 2010 at 2:51 AM, Wappler, Robert wrote: > Do you really have the requirement to sort anything? Or let me ask it > the other way round: Assuming you have too much data, to sort it on the > application side, which user can read all this from one single table in > the user interface?

Re: [GENERAL] Is TRUNCATE a DML statement?

2010-08-26 Thread Gnanakumar
>> I also understand that "There is no TRUNCATE command in the SQL standard." > this is old information - now TRUNCATE is part of SQL standard ANSI > SQL 2008 - F200 Thanks for the update. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscriptio

Re: [GENERAL] Is TRUNCATE a DML statement?

2010-08-26 Thread Pavel Stehule
Hello 2010/8/26 Gnanakumar : > Hi, > > Can we say that TRUNCATE belongs/falls under DML statement? > > TRUNCATE: http://www.postgresql.org/docs/8.2/interactive/sql-truncate.html > > I also understand that "There is no TRUNCATE command in the SQL standard." > this is old information - now TRUNCATE

[GENERAL] Is TRUNCATE a DML statement?

2010-08-26 Thread Gnanakumar
Hi, Can we say that TRUNCATE belongs/falls under DML statement? TRUNCATE: http://www.postgresql.org/docs/8.2/interactive/sql-truncate.html I also understand that "There is no TRUNCATE command in the SQL standard." Regards, Gnanam -- Sent via pgsql-general mailing list (pgsql-general@postgres

Re: [GENERAL] How to convert a binary filed to an integer field?

2010-08-26 Thread Arjen Nienhuis
On Wed, Aug 25, 2010 at 9:29 PM, wrote: > I have an application in the product. Now, one status field needs to have > three statuses instead of two. How to make a such change in PostgreSQL? > ALTER TABLE product ALTER status TYPE int USING status::integer;

Re: [GENERAL] Feature proposal

2010-08-26 Thread Vick Khera
On Wed, Aug 25, 2010 at 8:48 PM, Craig Ringer wrote: > synchronous_commit also has effects on data safety. It permits the loss of > transactions committed within the commit delay interval if the server > crashes. If you turn it on, you need to decide how much recent work you can > afford to lose i

Re: [GENERAL] How to convert a binary filed to an integer field?

2010-08-26 Thread Merlin Moncure
On Thu, Aug 26, 2010 at 12:28 AM, wrote: > You are right. I typed the message in hurry before I left home this morning. > It is the boolean type. Thanks for your suggestion. The NULL value may not > work for jdbc. On the application level, a fixed set of constants is used to > represent the th

Re: [GENERAL] Feature proposal

2010-08-26 Thread Sam Mason
On Wed, Aug 25, 2010 at 08:47:10PM +0200, Wojciech Strzaaaka wrote: > The data set is 9mln rows - about 250 columns 250 columns sounds very strange to me as well! I start to getting worried when I hit a tenth of that. > CPU utilization - 1,2% (half of the one core) > iostat shows writes ~6MB/s

Re: [GENERAL] Using FULLTEXT search with different weights for various fields

2010-08-26 Thread Mike Christensen
Thanks, the function idea is a good one. It makes the query look a lot better. My next question is are there any obvious advantages of making the tsvector part of the table and using a trigger to update it (or refresh the vectors every night or something). Thanks! Mike On Thu, Aug 26, 2010 at

Re: [GENERAL] Using FULLTEXT search with different weights for various fields

2010-08-26 Thread Arjen Nienhuis
The simple answer is this: SELECT R.RecipeId, R.Title, R.Description, R.ImageUrl, R.Rating, setweight(to_tsvector(title), 'A') || setweight(to_tsvector(coalesce(description, '')), 'B') || setweight(to_tsvector(coalesce(steps, '')), 'C') as vector, ts_rank_cd( setweight(to_tsvector(

Re: [GENERAL] IBATIS support for postgres cursors

2010-08-26 Thread Atul.Goel
Hi Guy, Thanks for your reply. We were able to work out with type OTHER. Many thanks for support. Regards, Atul Goel -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Guy Rouillier Sent: 25 August 2010 08:03 To: pgsql-

[GENERAL] Using FULLTEXT search with different weights for various fields

2010-08-26 Thread Mike Christensen
I'm trying to make some improvements to my search results by taking advantage of Postgres' setweight function, but am having a lot of problems getting a query to run.. Here's the query that I run now (I've removed some parts that just make it more complicated than you need to be bothered with)..

Re: [GENERAL] Optimizing queries that use multiple tables and many order by columns

2010-08-26 Thread Wappler, Robert
On 2010-08-25, Joshua Berry wrote: > --Here's what explain analyze says for the query > explain analyze > declare "SQL_CUR0453D910" cursor with hold for > select Anl.Priority, Anl.Lab, Anl.Job, JOB.DateIn, > JOB.CompanyCode, Anl.SampleName > from analysis anl join job on anl.job = job.job > order