[GENERAL] CREATE TABLE AS does not support IF NOT EXISTS?

2012-02-12 Thread David Waddy
This works: CREATE TEMP TABLE temp_medical_summary AS (SELECT * from bov.medical_summary) This gives an error: CREATE TEMP TABLE IF NOT EXISTS temp_medical_summary AS (SELECT * from bov.medical_summary) It would seem that CREATE TABLE AS does not support IF NOT EXISTS. Is this true? David Waddy

Re: [GENERAL] CREATE TABLE AS does not support IF NOT EXISTS?

2012-02-12 Thread David Waddy
Thank-you, mystery solved! I was reading the CREATE TABLE docs and not the CREATE TABLE AS docs. My mistake. David Waddy On Sun, Feb 12, 2012 at 3:50 PM, Adrian Klaver adrian.kla...@gmail.comwrote: On Sunday, February 12, 2012 11:42:37 am David Waddy wrote: This works: CREATE TEMP TABLE

Re: [GENERAL] How to return latest results without a polygon intersect?

2012-01-15 Thread David Waddy
that doesn't intersect with any other's. I went for the second, cross joining the table to itself, so every record with be compared to every other record, which is gonna be a huge number of comparisons. So it'll be slow. -Andy -- David Waddy Waddy Colpitts Ltd. 99 Milky Way Colpitts Settlement

[GENERAL] How to return latest results without a polygon intersect?

2012-01-11 Thread David Waddy
If I have a table of the following form: id (integer) event_time (timestamp) lat_lon (polygon) 3497 1977-01-01 00:00:00 ((-64.997,45.975),(,(-64.9981,45.975),(-64.8981,45.875),(-64.9978,45.9751)) 3431 2007-06-06 01:00:00

[GENERAL] Creating a view: ERROR: rules on SELECT must have action INSTEAD SELECT

2010-03-19 Thread David Waddy
I get the following error when trying to create a view with the following trivial example. SQL error: ERROR: rules on SELECT must have action INSTEAD SELECT In statement: CREATE VIEW nutrition.test_view AS SELECT 2 as two, 3 as three INTO TEMP temp_table; SELECT *,two+three as five FROM