Re: [GENERAL] what Linux to run

2012-03-04 Thread Devrim GÜNDÜZ
On Sat, 2012-03-03 at 14:15 -0700, David Boreham wrote: We use CentOS 5 and 6 and install PG from the yum repository detailed on the postgresql.org web site. Those RPMs will probably be a part of CentOS Testing repository soon. I and Karanbir had a chat about it at FOSDEM this year. --

[GENERAL] Create topology from a shape file

2012-03-04 Thread ArArgyridis
Greetings to all. I want to know if with postgis 2.0 and postgresql is possible to generate a topology from the geometries contained inside a shape file. If this can be accomplished, where can I find the procedure i must follow? Thanks in advance. signature.asc Description: This is a

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-04 Thread c k
I have found an another difference. select 'AA '::char(5) || 'AA'::char(5); result: while select 'AA '::varchar(5) || 'AA'::varchar(5); gives result: AA AA select 'AA '::text || 'AA'::text; gives result: AA AA what will be the reason for this? Regards, C P Kulkarni On Sat,

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-04 Thread David Johnston
Both varchar and text keep the trailing whitespace since it must be significant. A char removes all trailing whitespace (with the || operator) since it cannot distinguish between padding supplied whitespace (insignificant) and user-supplied whitespace (significant). On Mar 4, 2012, at 13:26, c

[GENERAL] Return unknown resultset from a function

2012-03-04 Thread Jan Meyland Andersen
How do I return an unknown resultset from a function My main problem is that I do not know how many columns or the data type of the columns before runtime. It this possible at all? I also tried to return the data as a text array but I also have trouble with that. Regards Jan -- Sent via

Re: [GENERAL] Return unknown resultset from a function

2012-03-04 Thread Pavel Stehule
Hello 2012/3/4 Jan Meyland Andersen j...@agile.dk: How do I return an unknown resultset from a function My main problem is that I do not know how many columns or the data type of the columns before runtime. It this possible at all? no, or it is not possible simply. PostgreSQL is strongly

Re: [GENERAL] Return unknown resultset from a function

2012-03-04 Thread David Johnston
On Mar 4, 2012, at 14:52, Jan Meyland Andersen j...@agile.dk wrote: How do I return an unknown resultset from a function My main problem is that I do not know how many columns or the data type of the columns before runtime. It this possible at all? I also tried to return the data as a

Re: [GENERAL] || versus concat( ), diff behavior

2012-03-04 Thread Tom Lane
c k shreeseva.learn...@gmail.com writes: what will be the reason for this? The short answer is that || uses cast-to-text semantics, whereas concat uses output-function semantics, and char(n) is one of the weird types for which those are different. Don't blame us, blame the SQL committee. Or

Re: [GENERAL] Return unknown resultset from a function

2012-03-04 Thread Rory Campbell-Lange
On 04/03/12, Jan Meyland Andersen (j...@agile.dk) wrote: How do I return an unknown resultset from a function My main problem is that I do not know how many columns or the data type of the columns before runtime. It this possible at all? I also tried to return the data as a text array but

Re: [GENERAL] Return unknown resultset from a function

2012-03-04 Thread Rory Campbell-Lange
On 04/03/12, Rory Campbell-Lange (r...@campbell-lange.net) wrote: On 04/03/12, Jan Meyland Andersen (j...@agile.dk) wrote: My main problem is that I do not know how many columns or the data type of the columns before runtime. It this possible at all? There is a section on this in the

[GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread Chris Angelico
One of our tables has a few columns that may be interpreted as strings or may be numbers (data type is varchar, numbers are stored as decimal). Generally, operations are performed on the string, but sometimes we need to parse out a number - without it failing on error. I wrote the following

Re: [GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread Chris Angelico
(Hoping you meant for that reply to be on-list as I'm here responding on-list.) On Mon, Mar 5, 2012 at 2:16 PM, A.M. age...@themactionfaction.com wrote: On Mar 4, 2012, at 9:13 PM, Chris Angelico wrote: One of our tables has a few columns that may be interpreted as strings or may be numbers

Re: [GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread David Johnston
On Mar 4, 2012, at 22:31, Chris Angelico ros...@gmail.com wrote: (Hoping you meant for that reply to be on-list as I'm here responding on-list.) On Mon, Mar 5, 2012 at 2:16 PM, A.M. age...@themactionfaction.com wrote: On Mar 4, 2012, at 9:13 PM, Chris Angelico wrote: One of our tables

Re: [GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread Chris Angelico
On Mon, Mar 5, 2012 at 2:50 PM, David Johnston pol...@yahoo.com wrote: Any efficient, non-RegEx, alternative would require more context to evaluate than you provide.  Mainly, would it be faster to have a separate field to store the parsed (at input) number and then query that field directly

Re: [GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread Tom Molesworth
On 05/03/12 04:06, Chris Angelico wrote: On Mon, Mar 5, 2012 at 2:50 PM, David Johnstonpol...@yahoo.com wrote: Any efficient, non-RegEx, alternative would require more context to evaluate than you provide. Mainly, would it be faster to have a separate field to store the parsed (at input)

Re: [GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread Chris Angelico
On Mon, Mar 5, 2012 at 3:15 PM, Tom Molesworth t...@audioboundary.com wrote: Can you use to_number() here? It sounds like something along the lines of cast(to_number('0' || field::varchar, '9.') as int) might give the behaviour you're after, and a quick test seems to indicate that it's

Re: [GENERAL] atoi-like function: is there a better way to do this?

2012-03-04 Thread David Johnston
On Mar 5, 2012, at 0:08, Chris Angelico ros...@gmail.com wrote: On Mon, Mar 5, 2012 at 3:15 PM, Tom Molesworth t...@audioboundary.com wrote: Can you use to_number() here? It sounds like something along the lines of cast(to_number('0' || field::varchar, '9.') as int) might give the

[GENERAL] Create topology from a shape file

2012-03-04 Thread ArArgyridis
Greetings to all. I want to know if with postgis 2.0 and postgresql is possible to generate a topology from the geometries contained inside a shape file. If this can be accomplished, where can I find the procedure i must follow? Thanks in advance. -- Sent via pgsql-general mailing list

Re: [GENERAL] what Linux to run

2012-03-04 Thread Gavin Flower
On 04/03/12 09:49, John R Pierce wrote: On 03/03/12 2:55 AM, Gavin Flower wrote: My knowledge of Debian is via friend's (an extremely competent and experienced Unix guy who got me into Linux who still runs Debian) comments and what I've noticed on the web. For a Desktop development

Re: [GENERAL] what Linux to run

2012-03-04 Thread Brent Wood
Hmm... I tend to _mostly_ run workstations rather than servers, pick my distro to suit my application needs. My workplace is a SLES site, I use Open Suse. Given most of my Postgres databases are in fact PostGIS databases, and need to work with a variety of other spatial data GIS related

[GENERAL] SELECT FOR UPDATE could see commited trasaction partially.

2012-03-04 Thread Sam Wong
Hi, I hit a UPDATE/LOCK issue in my application and the result has surprised me somewhat. And for the repro, it boils down into this: --- CREATE TABLE x (a int, b bool); INSERT INTO x VALUES (1, TRUE); COMMIT; _THREAD 1_: BEGIN; UPDATE x SET b=FALSE; INSERT INTO x VALUES (2, TRUE);