Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Mike Christensen
The table in question is a list of events associated with user actions. Users who are subscribed to another user's "channel" will see those events on the home page. The column in question is a "RecipientId" which only contains a link to a User Id if the action was performed on another user, otherw

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Martin Gainty
hi mike- is null uuid valid ? my experience would suggest a uuid is a foreign key to some other entity so any table containing object types (classes/structs) or table created from an object type (class/struct) must have a not null uuid (other systems call it guid) would require the uuid/guid to

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Mike Christensen
Thanks all, that's pretty much what I figured - just wanted to make sure.. I'm still trying to master this SQL thing you speak of. On Sun, Jun 21, 2009 at 5:20 PM, Martin Gainty wrote: > testcase for a null uuid? > > thanks, > Martin > __ > Verzicht u

Re: [GENERAL] postgresql-8.3.7 unexpected connection closures

2009-06-21 Thread Craig Ringer
> > > I'm hesitant to agree with this the PG installer doing more > automatically. If the user does not understand security and proper > configuration to get it to work on windows client, the server setup > will be poorly configured with security problems that a MAC truck can > drive through.

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Martin Gainty
testcase for a null uuid? thanks, Martin __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede

Re: [GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Craig Ringer
On Sun, 2009-06-21 at 22:11 +0200, Ivan Sergio Borgonovo wrote: > > > I think I really don't have a clear picture of how temp tables > > > really work. > > > They can be seen by concurrent transactions in the same session. > > > Eh? In this context, what do you mean by "session"? Did you mean > >

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Steve Atkins
On Jun 21, 2009, at 3:37 PM, Thomas Kellerer wrote: Mike Christensen wrote on 22.06.2009 00:10: I just tracked down a bug in my software due to an "unexpected" behavior in Postgres.. Can someone clarify why this doesn't work (I haven't tried it on MSSQL or anything else, so I'm not sure if

Re: [GENERAL] What's wrong with this query?

2009-06-21 Thread Thomas Kellerer
Mike Christensen wrote on 22.06.2009 00:10: I just tracked down a bug in my software due to an "unexpected" behavior in Postgres.. Can someone clarify why this doesn't work (I haven't tried it on MSSQL or anything else, so I'm not sure if this is the official SQL standard or anything).. CREA

[GENERAL] What's wrong with this query?

2009-06-21 Thread Mike Christensen
I just tracked down a bug in my software due to an "unexpected" behavior in Postgres.. Can someone clarify why this doesn't work (I haven't tried it on MSSQL or anything else, so I'm not sure if this is the official SQL standard or anything).. CREATE TABLE test ( value uuid ); INSERT INTO test

Re: [GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Ivan Sergio Borgonovo
On Sun, 21 Jun 2009 21:43:16 +0800 Craig Ringer wrote: > On Sun, 2009-06-21 at 14:57 +0200, Ivan Sergio Borgonovo wrote: > > > I think everything could be summed up as: > > > > select into t myaggregate1(field) from dataset where condition1; > > if(t>10) then > > update dataset set field=myfu

[GENERAL] Loading long lat values converting degrees to decimal values

2009-06-21 Thread Dave Potts
Hi List I am trying to load some data points stored as lat/long values Q. Do I convert the degree values (0-59.59) to a decimal value in range 0-100, or is setting the right srs value good enough? Dave. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make change

[GENERAL] subscribe-set pgsql-general digest

2009-06-21 Thread Michael Fraley
subscribe-set pgsql-general digest -- 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] default data sort

2009-06-21 Thread David Fetter
On Sun, Jun 21, 2009 at 11:01:59AM -0700, Michael Fraley wrote: > How can I change the default data sort for a table? When I view the > data in the selected table, it always opens a spreadsheet view > sorted by the primary key. In this case, the primary key is a > one-up number and a more usef

[GENERAL] default data sort

2009-06-21 Thread Michael Fraley
How can I change the default data sort for a table? When I view the data in the selected table, it always opens a spreadsheet view sorted by the primary key. In this case, the primary key is a one-up number and a more useful sort is the name column. How can I have it default to sort by name rat

[GENERAL] default data sort

2009-06-21 Thread Michael Fraley
How can I change the default data sort for a table? When I view the data in the selected table, it always opens a spreadsheet view sorted by the primary key. In this case, the primary key is a one-up number and a more useful sort is the name column. How can I have it default to sort by name rat

Re: [GENERAL] Postgres - uuid-ossp error

2009-06-21 Thread Tom Lane
Adalberto Costa writes: > But, I'm getting an error like below: > ERROR: ERROR: could not load library > "/Applications/MAMP/Library/pg/lib/postgresql/uuid-ossp.so": > dlopen(/Applications/MAMP/Library/pg/lib/postgresql/uuid-ossp.so, > 10): no suitable > image found. Did find: > /Applications/MA

Re: [GENERAL] Implicit conversion/comparision of timestamp with and without timezone

2009-06-21 Thread Tom Lane
Gerhard Wiesinger writes: > Ok, the "problem" is: > -- >datetime >= '2009-03-09 00:00:00.0' >AND datetime < '2009-03-10 00:00:00.0' > -- Index Cond: ((datetime >= '2009-03-09 00:00:00+01'::timestamp with time > zone) AND (datetime < '20

[GENERAL] Postgres - uuid-ossp error

2009-06-21 Thread Adalberto Costa
Hi, I'm trying to create a simple function using uuid-ossp package like follows: CREATE OR REPLACE FUNCTION uuid_nil() RETURNS uuid AS '$libdir/uuid-ossp', 'uuid_nil' IMMUTABLE STRICT LANGUAGE C; But, I'm getting an error like below: ERROR: ERROR: could not load library "/Applications/MAMP/L

Re: [GENERAL] Build in spatial support vs. PostGIS

2009-06-21 Thread Stephen Frost
* Assaf Lavie (assafla...@gmail.com) wrote: > Can anyone please shed light on the difference between the two: > http://stackoverflow.com/questions/1023229/spatial-data-in-postgresql > (login _not_ required) Without really good justification to use something else, I'd strongly recommend using PostG

Re: [GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Craig Ringer
On Sun, 2009-06-21 at 14:57 +0200, Ivan Sergio Borgonovo wrote: > I think everything could be summed up as: > > select into t myaggregate1(field) from dataset where condition1; > if(t>10) then > update dataset set field=myfunc1(a,b,c) where condition1; > end if; > > select into t myaggregate2(

Re: [GENERAL] Build in spatial support vs. PostGIS

2009-06-21 Thread Pavel Stehule
Hello 2009/6/21 Assaf Lavie : > Can anyone please shed light on the difference between the two: > http://stackoverflow.com/questions/1023229/spatial-data-in-postgresql > (login _not_ required) > some integrated support for spatial types are relative old thing probably from academic era of pg. It'

Re: [GENERAL] Implicit conversion/comparision of timestamp with and without timezone

2009-06-21 Thread Gerhard Wiesinger
On Sun, 21 Jun 2009, Richard Huxton wrote: Gerhard Wiesinger wrote: Hello, It is unclear to me how implicit conversion/comparision of timestamp with and without timezone works. It's not entirely clear where the problem is. You don't say the results you're getting or what you thought they

[GENERAL] Build in spatial support vs. PostGIS

2009-06-21 Thread Assaf Lavie
Can anyone please shed light on the difference between the two: http://stackoverflow.com/questions/1023229/spatial-data-in-postgresql (login _not_ required) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailp

[GENERAL] cursors, temp tables, dynamic sql technique (was and is: looping over a small record set over and over in a function)

2009-06-21 Thread Ivan Sergio Borgonovo
On Sun, 21 Jun 2009 10:57:51 +0800 Craig Ringer wrote: > On Fri, 2009-06-19 at 20:23 +0200, Ivan Sergio Borgonovo wrote: > > > If I could easily load all the dataset into an array, loop > > through it and then just update the computed field it would be > > nice... but how? > > Are you sure you

Re: [GENERAL] Implicit conversion/comparision of timestamp with and without timezone

2009-06-21 Thread Richard Huxton
Gerhard Wiesinger wrote: Hello, It is unclear to me how implicit conversion/comparision of timestamp with and without timezone works. It's not entirely clear where the problem is. You don't say the results you're getting or what you thought they should be.

Re: [GENERAL] pl/sql resources for pl/pgsql?

2009-06-21 Thread Peter Eisentraut
On Tuesday 16 June 2009 03:16:19 gvimrc wrote: > I'm fairly new to PostgreSQL and completely new to using pl/pgsql though > I've used MySQL's procedural language a little. I heard pl/pgsql is similar > to Oracle's pl/sql so would it be possible, given that pl/pgsql literature > is a bit thin on the