Re: [SQL] redundancy in CHECK CONSTRAINTs

2005-09-24 Thread Ferindo Middleton Jr
Thank you for your advice, Tom. I've re-done the table in my db using the schema you describe below. The is a need for the id field. Other tables in my applications use it to refer to any one intsystem/extsystem relationship and be able to provide users with one simple number to use to refer to

Re: [SQL] stored procs in postgresql

2005-09-24 Thread Cere Davis
thanks, I didn't even know about the string concatination function for this. Unfortunately, it was of no help. Specificly I am trying this, with the following error: SQL error: ERROR: syntax error at or near "' || $2 || '" at character 110 In statement: CREATE FUNCTION "getcensusbound" (g

Re: [SQL] redundancy in CHECK CONSTRAINTs

2005-09-24 Thread Tom Lane
Ferindo Middleton Jr <[EMAIL PROTECTED]> writes: > I have the following table: > CREATE TABLE gyuktnine ( > id SERIAL, > intsystem INTEGER NOT NULL REFERENCES yuksystems(id) CONSTRAINT > int_cannot_equal_ext >CHECK (intsystem != extsystem), >

[SQL] redundancy in CHECK CONSTRAINTs

2005-09-24 Thread Ferindo Middleton Jr
I have the following table: CREATE TABLE gyuktnine ( id SERIAL, intsystem INTEGER NOT NULL REFERENCES yuksystems(id) CONSTRAINT int_cannot_equal_ext CHECK (intsystem != extsystem), extsystem INTEGER NOT NULL REFERENCES yuksystems(id) CONSTR

Re: [SQL] stored procs in postgresql

2005-09-24 Thread Chris Browne
[EMAIL PROTECTED] writes: > I have been having some trouble with plsql stored procs in postgres in > that I can > make a table name a variable in the stored proc. Is there some > special way to make this happen that I am unaware of? > > For example, I want to do something like: > > stored_proc(in

[SQL] stored procs in postgresql

2005-09-24 Thread ceremona
Hi, I have been having some trouble with plsql stored procs in postgres in that I can make a table name a variable in the stored proc. Is there some special way to make this happen that I am unaware of? For example, I want to do something like: stored_proc(integer,varchar) SELECT table_

Re: [SQL] VACUUM FULL vs dump & restore

2005-09-24 Thread Aldor
Another way how to do it with having access to the data in the same time is to create a new table, named a little bit differently and do an: insert into [table]2 select * from[table]; Then switch to the second table. Then you have to do on the first table the TRUNCATE and DROP. For getti

Re: [SQL] VACUUM FULL vs dump & restore

2005-09-24 Thread Aldor
Hello Ilya, you have to check for yourself which method is faster - just test it with a stopwatch;-) You have to take care, because when you make VACUUM FULL, then it vacuums also the system tables, etc. of postgres. I'm not sure if this is the same way VACUUM goes through all objects, but I'd m