[SQL] Database with "override" tables

2005-12-05 Thread Michael Burke
Hello, I am in a situation where I have various tables (including data such as a product list) that are read-only to me. I wish to provide the functionality of changing this table: Removing items, modifying items, creating new ones. My original idea is to use a second table that is formatte

Re: [SQL] Database with "override" tables

2005-12-06 Thread Michael Burke
Lane Van Ingen wrote: I think I have a similar situation involving the naming of assets, where the usual asset description is used, but users can enter a description in a separate table which 'overrides' the original name with a name that is more familiar to the individual. IF THIS IS WHAT YO

Re: [SQL] Database with "override" tables

2005-12-07 Thread Michael Burke
Lane Van Ingen wrote: Not quite sure how to answer this, but one thought does occur to me: I was perhaps assuming that an override table would override an entire record in the 'original' table(that is what we are doing), and we require that critical fields in the override field be NOT NULL (and

Re: [SQL] Querying date_time for date only ?

2005-12-20 Thread Michael Burke
, SELECT field::date FROM mytable; to select only the date part. Likewise, you can use field::time if you want to disregard the date. > TIA, > > Aarni HTH. Mike. -- Michael Burke [EMAIL PROTECTED] ---(end of broadcast)--- TIP 1: if

[SQL] Sub-query as function argument

2005-12-20 Thread Michael Burke
ELECT will return only a single value; perhaps it needs to be wrapped in another function? TIA. Mike. -- Michael Burke [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] Sub-query as function argument

2005-12-20 Thread Michael Burke
though: => SELECT my_func('Sample', NULL, MIN(year)) FROM audio [ WHERE ... ]; -- Michael Burke [EMAIL PROTECTED] ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Using calculated columns as arguments in same SELECT

2006-02-16 Thread Michael Burke
-calling the inside functions This doesn't work -- it complains that transformed_geom is not a column. SELECT version(); gives: PostgreSQL 8.0.6 on i386-portbld-freebsd5.4, compiled by GCC cc (GCC) 3.4.2 [FreeBSD] 20040728 Thanks in advance! Mike. -- Michael Burke Engineering Technologi

Re: [SQL] Using calculated columns as arguments in same SELECT

2006-02-16 Thread Michael Burke
On February 16, 2006 11:07 am, Michael Burke wrote: > Hello, > > I am looking to simplify this query (uses PostGIS, but I have encountered > this scenario with other chains of functions): > -- snip -- Immediately after sending this one, I realized I could do it with a sub-select:

[SQL] SELECT composite type

2006-04-05 Thread Michael Burke
y want to call get_xy for every row in sightings, and use its output for two columns; or perhaps there is another way to think of this. I am using Postgres 8.1.2 (same with client) on FreeBSD, with PostGIS 1.1.1: $ postmaster --version postmaster (PostgreSQL) 8.1.2 Thanks in advance! Mike. --

Re: [SQL] SELECT composite type

2006-04-06 Thread Michael Burke
ouldn't harm it too much (unsure about SetSRID); additionally, adding the OFFSET 0 is an interesting trick that I will also try. Thus, my final query: SELECT (xy).x, (xy).y, title FROM (SELECT get_xy(SetSRID(sightings.location, 26910), 4326) AS xy, sightings.title FROM sightings WHERE s