Re: [SQL] How to make a IN without a table... ?

2003-06-16 Thread David Pradier
> > I avoid as hell to use temporary tables. This is part of a complex > > database, with more than 250 different tables. So i don't even want to > > think about adding temporary tables, brrr ! > > Just FYI, temporary tables in pgsql are invisible to other connections > even if they have the same

[SQL] Let join syntax

2003-06-16 Thread Nicolas JOUANIN
Hi, I've a problem with the following query. I want to left join table sec (x5) with x0, and x4. I try the following query : select x0.coh_agent ,x0.bra_id ,x0.dpr_id ,x0.usr_id ,x0.csc_id ,x0.spp_id ,x0.csc_id_inv ,x0.coh_doc_inv ,x0.coh_d_inv , x0.coh_process ,x0.coh_doc_main ,x0.coh

Re: [SQL] Let join syntax

2003-06-16 Thread Manfred Koizar
On Mon, 16 Jun 2003 12:34:34 +0200, "Nicolas JOUANIN" <[EMAIL PROTECTED]> wrote: >from >coh x0 , cpy x1 ,bra x2 , >cur x3 ,tad x4 LEFT OUTER JOIN sec x5 on x5.thr_id=x4.thr_id AND >x5.usr_id=x0.usr_id AND [...] > >Unfortunatelly, postgres returns me the following error : > Error: ERR

[SQL] casting interval to time

2003-06-16 Thread Tomasz Myrta
Hi psql -V psql (PostgreSQL) 7.3 SELECT cast(cast('1 day 12 hours' as interval) as time); time -- 12:00:00 (1 row) psql -V psql (PostgreSQL) 7.3.2 SELECT cast(cast('1 day 12 hours' as interval) as time); time -- 00:00:00 (1 row) Did I miss something? I looked into 'history' f

Re: [SQL] Let join syntax

2003-06-16 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: > On Mon, 16 Jun 2003 12:34:34 +0200, "Nicolas JOUANIN" > <[EMAIL PROTECTED]> wrote: >> from >> coh x0 , cpy x1 ,bra x2 , >> cur x3 ,tad x4 LEFT OUTER JOIN sec x5 on x5.thr_id=x4.thr_id AND >> x5.usr_id=x0.usr_id AND [...] >> >> Unfortunatelly, postgres

Re: [SQL] Let join syntax

2003-06-16 Thread Manfred Koizar
On Mon, 16 Jun 2003 12:34:34 +0200, "Nicolas JOUANIN" <[EMAIL PROTECTED]> wrote: >from >coh x0 , cpy x1 ,bra x2 , >cur x3 ,tad x4 LEFT OUTER JOIN sec x5 on x5.thr_id=x4.thr_id AND >x5.usr_id=x0.usr_id AND x5.bra_id = x0.bra_id AND x5.dpr_id = x0.dpr_id, >dpr x6 where ((x0.cpy_i

Re: [SQL] casting interval to time

2003-06-16 Thread Tom Lane
Tomasz Myrta <[EMAIL PROTECTED]> writes: > psql (PostgreSQL) 7.3.2 > SELECT cast(cast('1 day 12 hours' as interval) as time); >time > -- > 00:00:00 > (1 row) I get 12:00:00 here, using 7.3.3 ... platform-specific problem maybe? regards, tom lane

Re: [SQL] casting interval to time

2003-06-16 Thread Tomasz Myrta
Dnia 2003-06-16 16:53, Użytkownik Tom Lane napisał: Tomasz Myrta <[EMAIL PROTECTED]> writes: psql (PostgreSQL) 7.3.2 SELECT cast(cast('1 day 12 hours' as interval) as time); time -- 00:00:00 (1 row) I get 12:00:00 here, using 7.3.3 ... platform-specific problem maybe? Default Debian p

[SQL] [pgmail] - I have problems with pgmail

2003-06-16 Thread BenLaKnet
I install language and all codes ... but I have problems with text in french with accents "ééé èèè" The datas are correct in database but tcl does not recognize the format and trnasform accents when I send mail ! ... What could I do ? ---(end of broadcast)-

Re: [SQL] casting interval to time

2003-06-16 Thread Tom Lane
Tomasz Myrta <[EMAIL PROTECTED]> writes: > Dnia 2003-06-16 16:53, U¿ytkownik Tom Lane napisa³: >> Tomasz Myrta <[EMAIL PROTECTED]> writes: >> >>> psql (PostgreSQL) 7.3.2 >>> SELECT cast(cast('1 day 12 hours' as interval) as time); >>> time >>> -- >>> 00:00:00 >>> (1 row) >> >> >> I get 1

Re: [SQL] [pgmail] - I have problems with pgmail

2003-06-16 Thread Tom Lane
BenLaKnet <[EMAIL PROTECTED]> writes: > The datas are correct in database but tcl does not recognize the format > and trnasform accents when I send mail ! ... Try making sure that client_encoding is set to unicode. (libpgtcl probably ought to enforce this, but it doesn't at the moment.)

Re: [SQL] casting interval to time

2003-06-16 Thread Antti Haapala
On Mon, 16 Jun 2003, Tom Lane wrote: > Tomasz Myrta <[EMAIL PROTECTED]> writes: > > Dnia 2003-06-16 16:53, U¿ytkownik Tom Lane napisa³: > > > Tomasz Myrta <[EMAIL PROTECTED]> writes: > > > > > > > psql (PostgreSQL) 7.3.2 > > > > SELECT cast(cast('1 day 12 hours' as interval) as time); > > > > tim

Re: [SQL] casting interval to time

2003-06-16 Thread Tomasz Myrta
Dnia 2003-06-16 17:17, Użytkownik Tom Lane napisał: What do you get from "pg_config --configure"? What's the hardware platform --- i386, or something else? Can anyone else reproduce this, on any platform? The platform is i386. There was no "pg_config" file in binary package. After copying this

[SQL] Let join syntax

2003-06-16 Thread Nicolas JOUANIN
Hi, select x0.coh_agent ,x0.bra_id ,x0.dpr_id ,x0.usr_id ,x0.csc_id ,x0.spp_id ,x0.csc_id_inv ,x0.coh_doc_inv ,x0.coh_d_inv , x0.coh_process ,x0.coh_doc_main ,x0.coh_status ,x0.coh_total_local ,x0.coh_basis_local ,x0.coh_cost_local ,x0.coh_profit_local ,x0.coh_over_local ,x0.coh_

[SQL] date question

2003-06-16 Thread javier garcia - CEBAS
Hi; I've got a table in the way: year | month | day | est7237 | est7238 | est7239 | est7250 --+---+-+-+-+-+- 2002 | 9 | 1 | | | | 2002 | 9 | 2 | | | | 2002 | 9 | 3 | |

Re: [SQL] question on rules

2003-06-16 Thread Tomasz Myrta
Dnia 2003-06-13 03:26, Uz.ytkownik [EMAIL PROTECTED] napisa?: hi folks, i'd like to write an rule which fills out some empty attrs on insert (w/ data from other given attrs). the table structure is: CREATE TABLE foo (start date, duration integer, endtime date); and the rule is: CREATE RULE foo1

[SQL] "No such attribute or function 'oid'"

2003-06-16 Thread javier garcia - CEBAS
Hi; I'm using ODBC driver for windows, because I use Excel (Microsoft) to work with data. When I try to get data from a Postgres table there is no problem; but when I try to acces a view I get the mesage: "No such attribute or function 'oid'" When I try to access views from ACCESS2000 there is n

[SQL] UNION & LIMIT & ORDER BY

2003-06-16 Thread Emmanuel Engelhart
Hi Why this query doesn't work ? << SELECT '1' AS id FROM users ORDER BY id LIMIT 1 UNION SELECT '2' AS id FROM users >> And this one work ? << SELECT '1' AS id FROM users UNION SELECT '2' AS id FROM users ORDER BY id LIMIT 1 >> -- -

Re: [SQL] Ordering in an aggregate -- points to paths

2003-06-16 Thread Julian Scarfe
From: "Tom Lane" <[EMAIL PROTECTED]> > Yeah, this is a fairly obvious thing to want to do with a user-written > aggregate. It does not work in released versions, because the planner > does not notice that the inner SELECT's output ordering matches what > the GROUP BY needs, and so it inserts an a

Re: [SQL] date question

2003-06-16 Thread Bruno Wolff III
On Fri, Jun 13, 2003 at 13:44:09 +0200, javier garcia - CEBAS <[EMAIL PROTECTED]> wrote: > > And I've got another related tables with a date field. I need to compare the > dates field in the other tables with "year", "month", "day" in this table. > > Is there a way to create a table from this

Re: [SQL] "No such attribute or function 'oid'"

2003-06-16 Thread Tomasz Myrta
Dnia 2003-06-13 13:59, Uz.ytkownik javier garcia - CEBAS napisa?: Hi; I'm using ODBC driver for windows, because I use Excel (Microsoft) to work with data. When I try to get data from a Postgres table there is no problem; but when I try to acces a view I get the mesage: "No such attribute or func

Re: [SQL] UNION & LIMIT & ORDER BY

2003-06-16 Thread Guillaume LELARGE
Hi, Le Samedi 14 Juin 2003 17:01, Emmanuel Engelhart a écrit : > [...] Taken from the postgresql manual (http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql-select.html#SQL-UNION): ORDER BY and LIMIT can be attached to a sub-expression if it is enclosed in parentheses. Without pa

Re: [SQL] casting interval to time

2003-06-16 Thread Tom Lane
Antti Haapala <[EMAIL PROTECTED]> writes: > '--enable-integer-datetimes' (could be this?) Bingo. I can reproduce it with that configure choice. Should have the answer soon ... regards, tom lane ---(end of broadcast)--- TIP

Re: [SQL] casting interval to time

2003-06-16 Thread Tom Lane
Antti Haapala <[EMAIL PROTECTED]> writes: > It's also Debian (3.0). On investigation the interval_time() function was completely broken for the --enable-integer-datetimes case --- it was reducing the interval value modulo one second, rather than modulo one day as intended. I also noticed that neit

[SQL] Our FLOAT(p) precision does not conform to spec

2003-06-16 Thread Tom Lane
Fernando Nasser of Red Hat pointed out to me that we are not quite spec-compliant on the FLOAT(p) datatype notation. We interpret P as the number of decimal digits of precision, and hence translate P = 1..6 => float4 (a/k/a REAL) P = 7..15 => float8 (a/k/a DOUBLE PRECISION)

[SQL] unique keys on inherited classes

2003-06-16 Thread weigelt
hi folks, in many of my applications i'm deriving all classes from the base _inode, which stores general information needed for mirroring. the _inode class defines an inode_id (cluster-wide object id) and an timestamp field for the modification time. I've defined an unique index on the inode_id

[SQL] Trouble porting a Oracle PL/SQL procedure to PL/pgSQL

2003-06-16 Thread Tony G. Harris
Hello. I'm using PostgreSQL to learn SQL and SQL-based languages. The text I'm using (SAMS Teach Yourself SQL in 21 Days, 3rd.ed.) references Oracle in its examples, though I can usually get PostgreSQL to work almost as well. Well, I'm almost to the end of the book and I'm trying to port some of

Re: [SQL] Trouble porting a Oracle PL/SQL procedure to PL/pgSQL

2003-06-16 Thread Stephan Szabo
On Mon, 16 Jun 2003, Tony G. Harris wrote: > Hello. I'm using PostgreSQL to learn SQL and SQL-based languages. The > text I'm using (SAMS Teach Yourself SQL in 21 Days, 3rd.ed.) references > Oracle in its examples, though I can usually get PostgreSQL to work > almost as well. > > Well, I'm almo

[SQL] select date range?

2003-06-16 Thread ko
Hi,   When I use sql statement to select the date range from $_POST value,It doesn't work.   --- "select * from mydatabase where mydate between '$_POST[start_date]' and '$_POST[end_date]' "   There is no error,but the result is not I want.   ps: (1)myda

Re: [SQL] [HACKERS] Our FLOAT(p) precision does not conform to spec

2003-06-16 Thread Bruce Momjian
Tom Lane wrote: > Is it worth trying to provide some sort of backwards-compatibility mode? > We could imagine adding a GUC variable to select binary or decimal > precision, but I really don't want to. It would increase the amount of > work needed by more than an order of magnitude, and this proble

Re: [SQL] Our FLOAT(p) precision does not conform to spec

2003-06-16 Thread Richard Hall
Fix the problem and inform the users about code that may break. Rick ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] select date range?

2003-06-16 Thread Josh Berkus
Ko, > (1)mydate attribute is timestamp > (2)$_POST[start_date] is something like '2003/05/12' You probably need to re-format the POST date before passing it to the back-end. For example, my compilation of PostgreSQL would not necessarily correctly recognize that date format. Try re-formatting

Re: [SQL] select date range?

2003-06-16 Thread Ramil G. Sagum
hmm it should work fine. Remember, the statement where mydate between '2003/05/12' and '2003/06/17' would ONLY return records from '2003/05/12 to 2003/06/16 since your type is a timestamp. 2003/06/17 actually means 2003/06/17 00:00:00.00+00. so a timestamp of 2003/06/17 03:01:10.102022+08

Re: [SQL] Trouble porting a Oracle PL/SQL procedure to PL/pgSQL

2003-06-16 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Mon, 16 Jun 2003, Tony G. Harris wrote: >> The problem is, when I call the function, I get: >> sql-practice=# select update_pay(); >> ERROR: pay_cursor: no such class >> WARNING: plpgsql: ERROR during compile of update_pay near line 2 >> ERROR: pay_