Re: [GENERAL] Emacs and postgres

2005-02-23 Thread Joe Healy
Sean Davis wrote:
This is a bit off-topic
Does anyone know of an interface between emacs and psql?  I currently 
use it as my default editor and do my share of save and then \i.  I 
just gave pgEdit a try and liked many aspects of it, but I still like 
Emacs as an editor and wondered if anyone else has tricks/plugins for 
emacs users.

I have used sql-postgres mode in the past, under both emacs and xemacs. 
It is quite good. Haven't got it working currently under windows, I 
think I need to tell it where i have a psql binary.

Joe
---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [GENERAL] Emacs and postgres

2005-02-23 Thread Joe Healy
Joe Healy wrote:
Sean Davis wrote:
This is a bit off-topic
Does anyone know of an interface between emacs and psql?  I currently 
use it as my default editor and do my share of save and then \i.  I 
just gave pgEdit a try and liked many aspects of it, but I still like 
Emacs as an editor and wondered if anyone else has tricks/plugins for 
emacs users.

I have used sql-postgres mode in the past, under both emacs and 
xemacs. It is quite good. Haven't got it working currently under 
windows, I think I need to tell it where i have a psql binary.

I have now told emacs where my psql binary is, but I do not get the 
prompt. Does anyone know how to change this?

Thanks
Joe
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [GENERAL] Migrating MySQL app to postgres?

2005-04-25 Thread Joe Healy
Hi Rich,
  Guess now's the time. I'm trying to find a copy of pygresql to use, but
it's not easy (www.pygresql.org leads to druid.net and there's nothing 
on the
page about pygresql). I'm learning python to use on a major project 
here (but
the core libraries will remain in C) so I'd like to use that for the 
UI on
this project, too. I'm still not sure about the reports, but one step 
at a
time. That is, will the pygresql display nicely formatted reports 
based on
sql queries to the backend? Need to find out.
I have found using python with reportlab 
(http://www.reportlab.org/rl_toolkit.html)
very easy to create pdf reports based on queries.

Hope this helps,
Joe
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[GENERAL] gborg down

2005-07-14 Thread Joe Healy


Hi

apache test page is showing at 2005-07-15 09:00 AEST.

Joe.


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] How to force planner to use GiST index?

2007-03-07 Thread Joe Healy

[EMAIL PROTECTED] wrote:

Hi,

I have a GiST index on st_geometry type (a user defined type). It looks
like index is not getting hit when I use some geometric operator. Here
is the example of st_contains operator. 
 
  
How can I force or direct the planner to use the GiST index? Am I
missing something? 

  


For the index to be used you need to use an operator that can make use 
of it. eg something like:


select parcel1.id, count(*) from parcel1, polygons where 
contains(polygons.the_geom, parcel1.the_geom) and parcel1.geom && 
polygons.the_geom group by parcel1.id;


the && (inside bounding box) is able to use the gist index, whilst the 
exact contains is not able to.


Hope that helps,

Joe



---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] psql is slow and it does not take much resources

2006-05-03 Thread Joe Healy

Javier de la Torre wrote:

Great! Then there will be no problems.

I would use COPY but I think I can not. While moving from MySQL to
PostgreSQL I am also transforming a pair of fields, latitude,
longitude, into a geometry field, POINT, that is understood for
Potgis. I though I will not be able to use COPY when inserting data
with functions.
I definitely recommend using copy if you are inserting a large amount of 
data into postgis.
we use something like the following python code to read from a csv file 
and insert into pgsql.
I can't remember the rate it works at but it was much quicker than 
anything else we tried.


def insertData( header, delimiter, filename, table, SRID, dbname, user, 
host ):


   f = open(filename, 'r')

   # Open a new process to enter data (~10x faster than psycopg)
   process = os.popen('psql %s %s -c "COPY %s (geom, elevation) from 
stdin;" -h %s' % (dbname, user, table, host), "w")
  
   for a in f:

   unpackline = a[:-1].split(delimiter)
   easting, northing, elevation = unpackline
   process.write("SRID=%s;POINT(%s %s)\t%s\n" %( SRID, easting, 
northing, elevation))


   f.close()
   process.close()

Hope that helps,

Joe

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq