[SQL] CHECK problem really OK now...

2001-09-24 Thread Kovacs Baldvin
Hi everybody! I tried, and it works: the current CVS version really runs happily the query what sent to heaven our 7.1 version of the backend. Kevin: your original complex schema also runs smoothly. Thanks for our mindful developers! Regards, Baldvin I think Jan wrote: > Sorry, I missed

[SQL] Server crash caused by CHECK on child

2001-09-24 Thread Kovacs Baldvin
-- Hi Kevin, and everyone! -- -- I don't think that I only found a minor bug compared to -- the other you wrote in your last letter: the backend crash -- is caused by the same CHECK constraint in the child table. -- -- However, for you without time to analyzing Kevin's huge -- scheme, here is th

[SQL] Bug?: Update on ancestor for a row of a child

2001-09-23 Thread Kovacs Baldvin
Hello (mainly developer) folks! Probably Kevin really found a bug. When I saw his words in $50, I immediately started to look around his problem... You probably don't think that as a student here, in Hungary I live half a month for $50 :- So I simplified his given schema as much as I needed

Re: [SQL] table restruct...

2001-09-20 Thread Kovacs Baldvin
Hi! Do you REALLY need to restructure your data for changing columns? Probably you could use views instead. Üdv, Baldvin ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Creating a boolean function

2001-09-19 Thread Kovacs Baldvin
> You need conditional logic, which suggests pl/pgsql is the way to go. Maybe he could use simple sql function like this: create function check_loan(text,int,int) returns boolean as ' select ( select count(*) from kolcsonok where code_user=($2) and code_loan=($3) and typet

Re: [SQL] Checking for table existence (fwd)

2001-09-19 Thread Kovacs Baldvin
Some of you may get this message for the second time, but as I see there is some problem with one particular mail server on the route, and this message didn't arrive back from the list despite the fact that I sent it several days ago. -- Subject: R

Re: [SQL] Out of free buffers... HELP!

2001-09-18 Thread Kovacs Baldvin
> psql ids -c 'select src,dst,count(*) from brick* where src_port=135 > group by src,dst' > /tmp/135.dat > > and I get: > > ERROR: out of free buffers: time to abort ! Does anybody knows if the buffers of pgsql are insufficient, or the operating system cries out this error? Regards, Baldvin

Re: [SQL] Checking for table existence

2001-09-18 Thread Kovacs Baldvin
> > CREATE FUNCTION my_function ( ... > > > IF NOT table_exists(''my_table'') THEN > CREATE TABLE ... > END IF; > > > > Got the idea? Not bad... Well, I am not the person questioned... But let me share a few ideas about it. The solution what I gave was a "more SQL way" of doing i

Re: [SQL] Checking for table existence

2001-09-17 Thread Kovacs Baldvin
> Hi everyone. In my old SQL Server days, I used a command such as "IF > exists(select name from sys_objects where name = 'xyztable')" to check if a As far as I know, there is not direct support of this. However, I also would appreciate a builtin qexec(text) procedure, for making queries. Now

Re: [SQL] Number the lines

2001-09-17 Thread Kovacs Baldvin
Hi! I am in the university now, not be able to test what I say, so please forgive me if it is buggy or wrong. So does it helps you?: CREATE SEQUENCE ordering; SELECT NEXTVAL('ordering') as rownumber, * INTO TABLE anewname FROM whatyouwant; Probably CREATE SEQUENCE 'ordering';, do try it...

Re: [SQL] Part 2 of "Intentional, or a bug"....

2001-09-17 Thread Kovacs Baldvin
> > After these I use ~= if I need lines with NULLs in both to be selected. > > Perhaps you should reconsider your data model. You seem to be treating The given column is a date type column, with some records where "date is not given". This "not given" is represented by NULL. I saw it more elega

[SQL] Part 2 of "Intentional, or a bug"....

2001-09-16 Thread Kovacs Baldvin
Hi again. First of all, tank you for the immediate and precise answers. My solution to the problem was the following. However, I found that to be quite slow. I would like to ask if one can suggest me how to optimize this, because I need this regularly. CREATE FUNCTION gyegyenlo(text, text) RETU

[SQL] Correction for the previous letter:

2001-09-16 Thread Kovacs Baldvin
Sorry, I made a mistake in my previous letter, the table b looks like this: b) y | z 100 (not 1) | 'Hallelujah' NULL| 'Hmm...' Bye, Baldvin ---(end of broadcast)--- TIP 5: Have you checked our extensiv

[SQL] Intentional, or bug?

2001-09-16 Thread Kovacs Baldvin
Hi! I probably found an inconsistence of the working of the = operator. Please read ahead, if you're interested. I have two tables, let't call them a and b. They are: a) x | y - 1 | 100 2 | NULL b) y | z --

[SQL] Number of tuples to fetch

2001-01-31 Thread Kovacs Baldvin
Hello. Is it somehow possible to fetch only the number of tuples after declaring a cursor? If I move a cursor forward by 1 in a ten record long table, is moves only to the end, but it doesn't tell me how many steps it could do, and where it is. Thanks Baldvin

[SQL] Architectural question

2001-01-27 Thread Kovacs Baldvin
Hello everybody. I would like to create a database. It's a structure of about 20 items (tables, views, etc.) Then I would like to make it a template, because I need 7 copies of this structure, possibly a growing number. The only problem is that there are four tables in it, which are general