Re: [SQL] selects on differing subsets of a query

2006-05-03 Thread ed . temp . 01
Hello Markus, It's actually a temporary mailbox just in case the list attracts spam :-) Thank you for your help, I will study it when I get development time on the database. On 03/05/06, Markus Schaber <[EMAIL PROTECTED]> wrote: Hi, Ed Temp, [EMAIL PROTECTED] wrote: > First p

[SQL] selects on differing subsets of a query

2006-05-03 Thread ed . temp . 01
First post, be gentle as I have terminology problems and so the subject might be wrongly worded. Say I have a table with fields ... gender diet_pref ... What I am trying to construct is a *single* query showing the total number of males in the table and also the total number of male vegetarians

Re: [SQL] integrity of column used to order rows

2003-03-19 Thread Ed L.
key to the parent table, the overall size of the table is probably irrelevant; use of the index would allow you to avoid traversal of the entire table. You also have the option of writing the function in C to get better performance. Ed ---(end of broadcast)-

Re: [SQL] Scheduling Events?

2003-01-28 Thread Ed L.
On Thursday January 23 2003 5:16, David Durst wrote: > Is there anyway to schedule DB Events based on time? If you're using one of the unices (linux, etc.), how about... crontab + perl + DBI + DBD::Pg? or crontab + bash/sh + psql + pl/pgsql? ---(end of broadcast)--

[SQL] Error : Unknown address family (0)

2000-07-10 Thread Ed
Each time I try to do an pg_dump or pg_dumpall I receive this message : Error : Unknown address family (0) What can I do to resolve this? Or at least what does it means? Thanks a lot! Frédéric Boucher [EMAIL PROTECTED]

Re: [SQL] Re: Matching and Scoring with multiple fields

2000-07-10 Thread Ed Loehr
the vector(s) closest in N-space to the input vector. You might dig up an old 3-variable calculus book, find the formula, and write a PL/pgSQL function to compute the distance between two N-dimensional vectors... Regards, Ed Loehr

Re: [SQL] Timestamp problem

2000-07-10 Thread Ed Loehr
http://www.postgresql.org/docs/postgres/index.html Regards, Ed Loehr

Re: [SQL] SERIAL type does not generate new ID ?

2000-07-10 Thread Ed Loehr
at value for film_id in the table, or 2) could be the message is coming from a triggered insert "downstream" from your initial insert (see your server log). BTW, 7.0+ tells you *which* index caused the problem. Regards, Ed Loher

[SQL] Corruption... please help

2000-07-10 Thread Ed
Hi... I am unable to select every row from a table. Every time, the backend disconnect. When I do a : The_DB=> vacuum; I get : ERROR: Invalid XID in t_cmin (2) What does it meens and how can I recover from it? Frédéric Boucher [EMAIL PROTECTED]

Re: [SQL] pg_dump problem

2000-06-26 Thread Ed Loehr
ve looked though the > documentation and I am still struggling :-( You probably don't need to increase the buffer. More likely, there is an unterminated string constant somewhere in db.out. Yes, that would probably be a bug in pg_dump, but I do vaguely recall problems in 6.5* with pg_dump. You might search deja for your error message. Regards, Ed Loehr

Re: [SQL] A subselect in an aggregate

2000-06-26 Thread Ed Loehr
t you're after? select o.date, sum(d.qty * d.price) from orderdetail d, orders o where d.orderid = o.orderid group by o.date Regards, Ed Loehr

Re: [SQL] timespan casting

2000-06-22 Thread Ed Loehr
hours 32 minutes.. Try to_char(). http://www.postgresql.org/docs/postgres/x2976.htm Regards, Ed Loehr

Re: [SQL] Wildcard in date field???

2000-06-22 Thread Ed Loehr
tual day in > the date field. > > Ex.: select * from item where date = '2000-06-%%'; Multiple ways to do it, but here's one: select * from item where date_part('month',mydate) = 6 and date_part('year',mydate) = 2000; Regards, Ed Loehr

[SQL] Simply append...

2000-06-21 Thread Ed
Hi, I would like to append 2 simple query's result but they are ordered completly different like : select * from foo order by col1 asc union select * from foo2 order by col2 desc how could I do this? When I use union I can't use order by clause. Is there a way to tell "simply append bot resul

Re: [SQL] Type conversion

2000-06-20 Thread Ed Loehr
ven't checked to see if it matters... Regards, Ed Loehr

[SQL] \copy...

2000-06-20 Thread Ed
Hi, I have a file that look like this : firstname|lastname|[EMAIL PROTECTED] firstname2|lastname2|[EMAIL PROTECTED] and a table foo like : firstname varchar(30), lastname varchar(30), emailvarchar(50) and I would like to do a : copy tablename from '/home/ed/import.dat';

Re: [SQL] Outer join in postgresql

2000-06-12 Thread Ed Loehr
Patrick Kay wrote: > > I am looking for a way run an outer join in psql. Can anyone help? > > Informix has an "OUTER" keyword. I don't see anything like this in the docs > for psql. There are many examples on how to do this in the archives or via deja.com's power search. Regards, Ed Loehr

Re: [SQL] Newbie question on how to check triggers created

2000-06-12 Thread Ed Loehr
Chunky wrote: > > Could someone please enlightenment me what command in psql i should use > to show the various triggers and rules that i have created? These might work... select tgname from pg_trigger select rulename from pg_rewrite Regards, Ed Loehr

[SQL] Sum of datetime différence...

2000-06-08 Thread Ed
Hi, I would like to know what is the easiest way to add multiple difference of datetime but show the result in hour and minute something like : table foo: start datetime end datetime I would like to do : select sum(end-start) from foo; but it gives me 3 days 12 hours 23 minutes...etc I wo

Re: [SQL] how to know when a table is altered

2000-06-07 Thread Ed Loehr
time we perfomed the query. > > then > > if (&do_check($ptr_array)){ >fetch rows >store in cache > } > -->use the cache I haven't seen that syntax before with your use of "as", but I get your gist. Sounds reasonable, though it looks like a major pain, stealing most of the pleasure and convenience of SQL. I'd almost be tempted to build a regex'er to pick out the table names from each query in a layer between DBI and the app until the regex performance became an issue. Regards, Ed Loehr

Re: [SQL] how to know when a table is altered

2000-06-07 Thread Ed Loehr
Ed Loehr wrote: > > Vincenzo Passoli wrote: > > > > i'm developing a framework (mod_perl+apache) that reads the db-schema and > > explode html forms. > > > > now i read the schema and cache it into perl-hashes to speedup things. > > > > my pr

Re: [SQL] oracle rownum equivalent?

2000-06-07 Thread Ed Loehr
7;t understand very well how these are used. Maybe someone else can say or you can experiment... Regards, Ed Loehr (PS: Posting to only one of -general or -sql will almost always be sufficient.)

Re: [SQL] how to know when a table is altered

2000-06-07 Thread Ed Loehr
ear if others have a better/faster solution here. Regards, Ed Loehr

Re: [SQL] oracle rownum equivalent?

2000-06-07 Thread Ed Loehr
mikeo wrote: > > is there an equivalent to rownum in oracle? > > also, where can one find reference to "hidden columns" > such as OID or, as in oracle, rownum? oid is the equivalent. not sure documentation exists for these... Regards, Ed Loehr

Re: [SQL] psql problem

2000-05-31 Thread Ed Loehr
What is the definition of the table 'some_table'?? Regards, Ed Loehr Rick Parker wrote: > > Does anyone know why when I am in a particular DB as user postgres and use > the following statement, why I get this error?" > > This is the statement; > SEL

Re: [SQL] POSTGRESQL and PERL?

2000-05-26 Thread Ed Loehr
not? The query string is created before prepare is called... Regards, Ed Loehr

Re: [SQL] PG/DBI: 'NOTICE: UserAbortTransactionBlock and not in in-progress state'

2000-05-26 Thread Ed Loehr
ried to do -> finish and -> commit after each > query, but the messages still appear. > > Any hints? I think that happens if the backend aborted (elogged) with an ERROR message and you did not start a new transaction. ERROR kills the current transaction altogether in 6.5.*, IIRC. Regards, Ed Loehr