Re: [SQL] Problem with extract(epoch from interval ...

2013-01-23 Thread Kaloyan Iliev
Thanks, It works perfectly. Regards, Kaloyan Iliev On 23.01.13 13:00, Ian Lawrence Barwick wrote: Hi 2013/1/23 Kaloyan Iliev : Hi, I have a little problem with extract epoch from interval. It seems that the query works if the interval is in a string but not from DB field. Could someone

[SQL] Problem with extract(epoch from interval ...

2013-01-23 Thread Kaloyan Iliev
Hi, I have a little problem with extract epoch from interval. It seems that the query works if the interval is in a string but not from DB field. Could someone provide support. Thanks in advance. Best regards, Kaloyan Iliev db=# begin; BEGIN db=# SELECT version(); version

Re: [SQL] unique rows

2006-09-21 Thread Kaloyan Iliev
catch the error and move on with the next insert. I hope I helped. Regards, Kaloyan Iliev TJ O'Donnell wrote: I want to make a table that has unique rows - no problem. Create Table x (smarts Varchar Unique); I have input data that has many duplicates and until now I was creating a

[SQL] Thanks

2006-09-07 Thread Kaloyan Iliev
Thanks a lot! It works! Regards,   Kaloyan Iliev Tom Lane wrote: Kaloyan Iliev <[EMAIL PROTECTED]> writes: rsr=# SELECT ... rsr-#FROM debts_desc DD LEFT JOIN config C ON (DD.conf_id = C.id), .

Re: [SQL] Substitute a Character

2006-09-07 Thread Kaloyan Iliev
Hi, Try: UPDATE foe SET field = regexp_replace(field, '^.', '0'); OR UPDATE foe SET field = regexp_replace(field, 'A', '0'); This will replace in table "foe" in the column "field" 'A' with '0'; Regards, Kaloya

[SQL] Problem with FOR UPDATE

2006-09-07 Thread Kaloyan Iliev
ide to use SELECT FOR UPDATE OF but I then receive the error you can see. Can anyone help me with this query? Thanks in advance. Regards, Kaloyan Iliev rsr=# SELECT rsr-#DD.* rsr-# ( SELECT sum(-amount * saldo_sign(cre

Re: [SQL] Triggers

2006-08-21 Thread Kaloyan Iliev
Hi, You can use one procedure(function in Postgres) but you have to use 26 triggers. Every trigger can call this one procedure to record the information you want. Regards, Kaloyan Iliev Ezequias Rodrigues da Rocha wrote: Hi list, I am planning to generate a trigger to each [update or

[SQL] Problem with SET CONSTRAINTS ALL DEFERRED;

2006-05-19 Thread Kaloyan Iliev
Hi Friends, I am trying to postpone the foreign key constraint check till the end of transaction but it doesn't work. Can anyone help me with a tip what I am doing wrong. Thanks in advance. Kaloyan Iliev test=# BEGIN; BEGIN test=# test=# SET CONSTRAINTS ALL DEFERRED; SET CONSTRAINTS

Re: [SQL] Problems with HAVING

2005-01-12 Thread Kaloyan Iliev Iliev
Thank You, That's what I need. I know it was something simple but... Now it works perfectly. Thank's again. Kaloyan Iliev Michael Fuhr wrote: On Wed, Jan 12, 2005 at 10:11:21AM -0700, Michael Fuhr wrote: On Wed, Jan 12, 2005 at 06:38:51PM +0200, Kaloyan Iliev Iliev wrote: My

Re: [SQL] Problems with HAVING

2005-01-12 Thread Kaloyan Iliev Iliev
Thanks for the replay first. Yes I use "having" like I have written. I can't use your query because in subquery I must write again the whole WHERE clause. But in the other mail in the tread there is the solution:) Thanks again Kaloyan Sam Mason wrote: Kaloyan Iliev Iliev w

[SQL] Problems with HAVING

2005-01-12 Thread Kaloyan Iliev Iliev
HAVING must be type boolean, not type date This is the error I receive. As far as I know I can't use agregate functions in where clause. Thank you in advance. Kaloyan Iliev

Re: [SQL] Inheriting text[] field

2004-08-17 Thread Kaloyan Iliev Iliev
10x I suppose you are right:) Regard Kaloyan Iliev Tom Lane wrote: Kaloyan Iliev Iliev <[EMAIL PROTECTED]> writes: I am useing PostgreSQL 7.2.3. test_libvar=# create table temp_a( test_libvar(# name text[] test_libvar(# ); CREATE test_libvar=# create table temp( name text[] ) in

[SQL] Inheriting text[] field

2004-08-16 Thread Kaloyan Iliev Iliev
Dear Friend, I have the following problem when I try to inherits one table with text[] field into another. I am useing PostgreSQL 7.2.3. I suppose that this is a BUG but I am not sure. Any ides. 10x in advance. Kaloyan test_libvar=# create table temp_a( test_libvar(# name text[] test_libvar(# )

[SQL] Problems with UNION ALL and ORDER BY

2004-08-02 Thread Kaloyan Iliev Iliev
10x for the replies. We find the problem. It is in our scripts. We use to_char over a date field and then order by this field. So it sort it as text and not as date. I appologize for loosing your time. 10x again. ---(end of broadcast)--- TIP 2: you

Re: [SQL] Problems with UNION ALL and ORDER BY

2004-08-02 Thread Kaloyan Iliev Iliev
Dear Tom, As I say in my previous letter I am using 7.2.3. If you wish I can show you the query and the result to see for yourself, that there is something wrong. It just don't order the overall result but the separate results of the both subqueries. Tom Lane wrote: Kaloyan Iliev Iliev &l

[SQL] Problems with UNION ALL and ORDER BY

2004-08-02 Thread Kaloyan Iliev Iliev
Hello again, I am using Postgres 7.2.3. If any other details are necessary I will provide them:))) 10x again ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

[SQL] Problems with UNION ALL and ORDER BY

2004-08-02 Thread Kaloyan Iliev Iliev
Dear friends..., I have the following problem: select . from where UNION ALL select ... from where ORDER BY field1 But the the order by doesn't work properly. It returns the rows of the first query ordered and then appends the rows of the second query ordered. But this is

Re: [SQL] Start-up problems

2004-01-08 Thread Kaloyan Iliev Iliev
Look at /etc/ beyaRecords - The home Urban music wrote: Kaloyan, thanks for reply. Still finding my way around the unix environment so could you tell me where the file you mention is situated? On 8 Jan 2004, at 13:24, Kaloyan Iliev Iliev wrote: This is what I have in my rc.local on FreeBSD

[SQL] Unsigned numbers

2003-11-28 Thread Kaloyan Iliev Iliev
Hello Friends, I have the following questions. I have a lot of fields in my database that are int or float. The problem is that I need them to be only positive (unsigned) and the users try to insert sometimes negative. I know that I can make this with CHECK CONSTRAINT but for some reasons this i

[SQL] Unsigned numbers

2003-11-27 Thread Kaloyan Iliev Iliev
10x you all ---(end of broadcast)--- TIP 8: explain analyze is your friend

[SQL] Unsigned numbers

2003-11-26 Thread Kaloyan Iliev Iliev
Hello Friends, I have the following questions. I have a lot of fields in my database that are int or float. The problem is that I need them to be only positive (unsigned) and the users try to insert sometimes negative. I know that I can make this with CHECK CONSTRAINT but for some reasons this i