[SQL] type regclass casting

2004-05-31 Thread sad
hello look select * from pg_class where oid = 'sometablename'::regclass; (1 row) select * from pg_class where oid = 'sometablename'::text::regclass; ERROR can not cast TEXT to regclass What does this mean ? version 7.3.3 please try it on 7.4.x ---(end of broadcast)

Re: [SQL] 7.4 - FK constraint performance

2004-05-31 Thread ow
--- Tom Lane <[EMAIL PROTECTED]> wrote: > Can't see how we optimize your case without pessimizing more-common cases. My case appears to be pretty common, i.e. 1 small and 1 large table with RI constraint between them. In order to delete a record from the small table, the large table must not have

[SQL] joining a table with a function

2004-05-31 Thread Jaime Casanova
hi all, i have a function of a user defined type it returns a record of values but just a row. select * from rec_f_consultar_alumno(a.ent_codigo, a.alu_codigo) what i want to do now is a select in wich i can do a seq scan or an index scan of a table and pass the values i retrieve into the functi

Re: [SQL] Index question

2004-05-31 Thread Tom Lane
"David Witham" <[EMAIL PROTECTED]> writes: > I understand that selecting count(*) will involve a scan at some > stage, but I was surprised that the index wasn't used in the >= case, > but was used in the between case. Given the estimated row counts in your examples, the planner's choices are not s

[SQL] multi results with functions

2004-05-31 Thread kasper
Hi Im trying to make a stored procedure that returns * from at table, and returns multible rows. Can you do that, and how? basically I would like to do: create or replace function test () returns record as ' select * from dummytable; ' language sql; Thanks - Kasper -

Re: [SQL] sum ( time) problem

2004-05-31 Thread Willem de Jong
"Loeke" <[EMAIL PROTECTED]> wrote in Dan heb je nog de 24-uurs notatie, en krijg je niet een result boven de 24-uurs notatie. news:[EMAIL PROTECTED]: > kijk eens bij functions and operators van de > sql help bij pgadmin > > "Willem de Jong" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PR

Re: [SQL] not really SQL but I need info on BLOBs

2004-05-31 Thread Jared Evans
I did something similar- a web application for online employer picture directory along with dynamic graphical output of the desk locations throughout the company (using the GD package). I kept the pictures in a separate directory and used links in the database. I set up a DB trigger that took car

[SQL] type regclass casting

2004-05-31 Thread sad
hello select * from pg_class where oid = 'sometablename'::regclass; (1 row) select * from pg_class where oid = 'sometablename'::text::regclass; ERROR can not cast TEXT to regclass What does this mean ? version 7.3.3 please try it on 7.4.x ---(end of broadcast)---

Re: [SQL] multi results with functions

2004-05-31 Thread CoL
hi, kasper wrote, On 5/31/2004 00:02: Hi Im trying to make a stored procedure that returns * from at table, and returns multible rows. Can you do that, and how? basically I would like to do: create or replace function test () returns record as ' select * from dummytable; ' language sql; returns SE

[SQL] insert or update violates foreign key constraint.why?

2004-05-31 Thread Oleg Mayevskiy
it seems to be a simple problem, but it is not. i have declared 2 simple tables: CREATE TABLE public.test1 ( id int4 NOT NULL, data float4, CONSTRAINT mytest_pkey PRIMARY KEY (id) ) WITH OIDS; CREATE TABLE public.test2 ( id1 int4 NOT NULL, data1 float4, CONSTRAINT test2_pkey PRIMARY K

Re: [SQL] insert or update violates foreign key constraint.why?

2004-05-31 Thread Tom Lane
Oleg Mayevskiy <[EMAIL PROTECTED]> writes: > it seems to be a simple problem, but it is not. Yes it is ... you're expecting the RI triggers to fire during the plpgsql function, but in fact they fire at completion of the outer statement that called the plpgsql function. There's been some debate ab

[SQL] arrays and polygons

2004-05-31 Thread David
Hi there i am having problems inserting an array of polygons into a table, i have added the column using: ALTER TABLE species ADD COLUMN location polygon[]; this works fine, but when i try INSERT INTO species (location) VALUES ('{((432,89), (45,87), (89,87)), ((54,78), (34,98))}; I get the foll