Re: OFF-TOPIC [GENERAL] Gist Index: Problem getting data in GiST Support Functions "penalty".

2011-06-27 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Michael Gould Sent: Monday, June 27, 2011 8:13 PM To: 'pgsql-general@postgresql.org' Subject: Re: [GENERAL] Gist Index: Problem getting data in GiST Support Functions "penalt

Re: [GENERAL] Gist Index: Problem getting data in GiST Support Functions "penalty".

2011-06-27 Thread Michael Gould
I am running 9.0.4 and I'm running it on Windows 7 Ultimate which is my development machine. I can't even create a server. When I try I get a message The server doesn't accept connections: the connection library reports could not connect to server: Connection refused (0x274D/10061) Is th

Re: [GENERAL] Live records and number of records are differents...

2011-06-27 Thread Craig Ringer
On 06/27/2011 11:12 PM, F T wrote: - but the number of live rows is 772308... The UI should really say something like "Stats: Estimated number of live rows: 772308" to indicate more clearly what's going on. At least putting it under a "Statistics and Estimates" heading/category would help.

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread Merlin Moncure
On Mon, Jun 27, 2011 at 2:22 PM, mephysto wrote: > Thank you Merlin. > > Now, Can I pass the select as an argument of my function? sure: select myfunc(populate_record(null::t, 'b=>9, a=>2')); merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your s

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread mephysto
Thank you Merlin. Now, Can I pass the select as an argument of my function? Or must I do in other manner? Sorry, but I am a novice. Best regards. Mephysto -- View this message in context: http://postgresql.1045698.n5.nabble.com/Custom-types-as-parameter-in-stored-function-tp4527618p4529531.h

Re: [GENERAL] glitch installing xml support in 9.1.beta2

2011-06-27 Thread Rob Sargent
On 06/25/2011 01:10 AM, Guillaume Lelarge wrote: > On Fri, 2011-06-24 at 11:22 -0600, Rob Sargent wrote: >> OpenSuse 11.4 x86-64 >> >> gmake install builds and places the requisite pieces as expected. >> >> Running >> psql --username postgres -d postgres -f xml2--1.0,sql >> results in >>

Re: [GENERAL] In a view, how do I cause fields with possible NULLs to be treated as a blank string in a replace operation?

2011-06-27 Thread Rick Genter
Either use '' as some_type, or use COALESCE(some_type, ''). On Mon, Jun 27, 2011 at 9:53 AM, Asfand Qazi (Sanger Institute) < aq2.san...@gmail.com> wrote: > Hello, > > So I have am playing with a view to test the feasibility of a > technique for storing some data. > > It basically goes something

Re: [GENERAL] In a view, how do I cause fields with possible NULLs to be treated as a blank string in a replace operation?

2011-06-27 Thread Thom Brown
On 27 June 2011 17:53, Asfand Qazi (Sanger Institute) wrote: > Hello, > > So I have am playing with a view to test the feasibility of a > technique for storing some data. > > It basically goes something like this: > > CREATE VIEW formatted_table AS >       SELECT name, >              replace(some_

[GENERAL] In a view, how do I cause fields with possible NULLs to be treated as a blank string in a replace operation?

2011-06-27 Thread Asfand Qazi (Sanger Institute)
Hello, So I have am playing with a view to test the feasibility of a technique for storing some data. It basically goes something like this: CREATE VIEW formatted_table AS SELECT name, replace(some_template, '@', some_type) AS some_field FROM some_table; some_templ

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread Merlin Moncure
On Mon, Jun 27, 2011 at 4:33 AM, mephysto wrote: > Hello to everyone, > I am trying to pass custom types as parameters in stored functions, and I > tried this syntax successfully: > > create type myType as (id bigint, name character varying); > > > create or replace myfunc(obj myType) > returns vo

Re: [GENERAL] Live records and number of records are differents...

2011-06-27 Thread Grzegorz Jaśkiewicz
On Mon, Jun 27, 2011 at 4:12 PM, F T wrote: > Hello list, > > I use PostgreSQL 8.4 and Postgis 1.4. > > I use FME to insert 772185 records in a table (multipolygons that represent > parcels). > > Everything seems fine but... > If I type select count(*), I get the right number of records : 772185 >

[GENERAL] Live records and number of records are differents...

2011-06-27 Thread F T
Hello list, I use PostgreSQL 8.4 and Postgis 1.4. I use FME to insert 772185 records in a table (multipolygons that represent parcels). Everything seems fine but... If I type select count(*), I get the right number of records : 772185 records. But If I use pgAdmin and have a look in the stats :

Re: [GENERAL] to_timestamp() and timestamp without time zone

2011-06-27 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of hernan gonzalez Sent: Sunday, June 26, 2011 3:57 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] to_timestamp() and timestamp without time zone An analogy: a "localtime" is like

Re: [GENERAL] discard on constraint violation

2011-06-27 Thread David Johnston
>>My situation is that I'm reading data from an external website with lots of duplicate data. I am reading the data in a plpythonu function. I never update, only insert. A trigger on the table that has to check if each row exists before trying the insert is too much overhead. Create a staging tabl

Re: [GENERAL] Reusing cached prepared statement slow after 5 executions

2011-06-27 Thread Radoslaw Smogura
This behavior is in some way needed, as PreparedStatement is, commonly, used once, just to pass parameters without escaping. Regards, Radek -Original Message- From: Rob Gansevles Sent: 27 czerwca 2011 08:50 To: pgsql-general Subject: Re: [GENERAL] Reusing cached prepared statement slow a

Re: [GENERAL] discard on constraint violation

2011-06-27 Thread Guillaume Lelarge
On Mon, 2011-06-27 at 15:36 +0300, Sim Zacks wrote: > Is there a way to tell a table to discard an insert if it violates a > constraint (unique in my case) instead of giving an error? I don't want > the overhead of a trigger on each row inserted. > Without a trigger, you can't. -- Guillaume

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-27 Thread Vincent Veyron
Le lundi 27 juin 2011 à 12:11 +0200, Leif Biberg Kristensen a écrit : > PHP has its own Boolean values TRUE/FALSE, but reads Postgresql > Booleans as > 't'/'f'. You always have to rely on kludgy konstructs like > > if ($pg_bool == 't') then > $my_bool = TRUE; > elseif ($pg_bool == 'f') then >

[GENERAL] discard on constraint violation

2011-06-27 Thread Sim Zacks
Is there a way to tell a table to discard an insert if it violates a constraint (unique in my case) instead of giving an error? I don't want the overhead of a trigger on each row inserted. My situation is that I'm reading data from an external website with lots of duplicate data. I am reading

Re: [GENERAL] Reusing cached prepared statement slow after 5 executions

2011-06-27 Thread Albe Laurenz
Dean Rasheed wrote: >> I can confirm, when I call ps.setPrepareThreshold(1) the query is slow >> immediately, so the plan must be different with the server prepared >> statements. > > You can confirm that from psql by doing > > EXPLAIN ANALYSE SELECT ... ; > > and then > > PREPARE ps( ... ) AS SELE

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-27 Thread Leif Biberg Kristensen
On Sunday 26. June 2011 16.11.06 Vincent Veyron wrote: > Le dimanche 26 juin 2011 à 00:05 -0700, Darren Duncan a écrit : > > Michael Nolan wrote: > > > > Having real BOOLEAN is just one of the reasons I like Postgres the most. > > Would you mind giving an example of where a boolean field would be

[GENERAL] Custom types as parameter in stored function

2011-06-27 Thread mephysto
Hello to everyone, I am trying to pass custom types as parameters in stored functions, and I tried this syntax successfully: create type myType as (id bigint, name character varying); create or replace myfunc(obj myType) returns void as begin ... end; select myfunc((1, 'foo')::myType; In

Re: [GENERAL] Custom types as parameter in stored function

2011-06-27 Thread mephysto
Ehmmm, sorry.. Correct syntax for select is: select myfunc((1, 'foo')::myType); -- View this message in context: http://postgresql.1045698.n5.nabble.com/Custom-types-as-parameter-in-stored-function-tp4527618p4527663.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -

Re: [GENERAL] Reusing cached prepared statement slow after 5 executions

2011-06-27 Thread Dean Rasheed
On 27 June 2011 07:50, Rob Gansevles wrote: > I can confirm, when I call ps.setPrepareThreshold(1) the query is slow > immediately, so the plan must be different with the server prepared > statements. > You can confirm that from psql by doing EXPLAIN ANALYSE SELECT ... ; and then PREPARE ps( .

Re: [GENERAL] Anyone using silent_mode?

2011-06-27 Thread Guillaume Lelarge
On Mon, 2011-06-27 at 10:06 +0300, Heikki Linnakangas wrote: > Is anyone using silent_mode=on ? There's some discussion on > pgsql-hackers [1] on whether it should be removed altogether in 9.2, > since you can get the same functionality with "pg_ctl start", or nohup. > If you're using silent_mod

Re: [GENERAL] An amusing MySQL weakness--not!

2011-06-27 Thread Achilleas Mantzios
Στις Sunday 26 June 2011 17:11:06 ο/η Vincent Veyron έγραψε: > Le dimanche 26 juin 2011 � 00:05 -0700, Darren Duncan a �crit : > > Michael Nolan wrote: > > > Having real BOOLEAN is just one of the reasons I like Postgres the most. > > > > Would you mind giving an example of where a boolean field

[GENERAL] Anyone using silent_mode?

2011-06-27 Thread Heikki Linnakangas
Is anyone using silent_mode=on ? There's some discussion on pgsql-hackers [1] on whether it should be removed altogether in 9.2, since you can get the same functionality with "pg_ctl start", or nohup. If you're using silent_mode, what are you using it for? [1] http://archives.postgresql.org/m