Re: [SQL] sql error creating function

2006-08-11 Thread Christopher Browne
Quoth [EMAIL PROTECTED] ("TJ O'Donnell"): > When I psql -f f.sql > I get the following error: > psql:f.sql:10: ERROR: relation "fragset" does not exist > CONTEXT: SQL function "fragments" > >> cat f.sql > Create Or Replace Function fragments(character varying) > Returns setof character varying >

Re: [SQL] Query response time

2006-08-11 Thread Jonathan Sinclair
Hi all. Thanks for your help so far. However after configuring my system I am still getting major lag times with a couple of queries. The first, which suffers from the '538/539'(see old email included below) bug, is caused by running the following statement: SELECT t1.col1, SUM(test) test_col, SU

[SQL] Can't find which return type is incorrect.

2006-08-11 Thread Chris Lukenbill
Alright.  I have a very large amount of columns being returned by this stored procedure that I ported from MS SQL to Postgres.  Now the problem I'm having is that when the select * from sp_whatever(1,0,3) as ( foo int, bar int, etc.) is executed the error "wrong record type supplied in RETURN NEX

[SQL] The Right Way to manage schemas in SCM systems

2006-08-11 Thread Andrew Hammond
I've been trying to figure out a good way to manage schema change control for a while now. Since I have a development background, I really want to find some way to check the schema into a SCM system like CVS (for example). Just using a pg_dump doesn't work very well becase there's no guarantee of c

Re: [SQL] Can't find which return type is incorrect.

2006-08-11 Thread codeWarrior
Can you show us the code for your SP ? I'd like to see what the RETURNS statement is in the sp declaration (CREATE OR REPLACE PROCEDURE sproc(type, type, type) RETURNS SETOF returntype AS ...)     You might reconsider your SELECT * FROM sproc() AS () -- SELECT * retrieves ALL columns defined

Re: [SQL] Can't find which return type is incorrect.

2006-08-11 Thread Chris Lukenbill
Let me try this againMy first one got delayed when my gmail defualted to the wrong account.  (the response is inside codeWarrior's message.Thanks,ChrisOn 8/11/06, Chris Lukenbill <[EMAIL PROTECTED]> wrote: On 8/11/06, codeWarrior < [EMAIL PROTECTED]> wrote: Can you show us the code for

[SQL] Undo an update

2006-08-11 Thread Judith
Hello everybody!! Is there a way to undo an update??? Thanks!!! ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Undo an update

2006-08-11 Thread Rodrigo De León
If it was inside a transaction, and the transaction is still open, then just rollback. Otherwise, no. I'm not sure if there's any way of doing some kind of PITR, no familiar with it. If not, best bet is to recover from the newest backup set you have. Regards, Rodrigo

Re: [SQL] timestamp (MS SQLServer's rowversion) functionality

2006-08-11 Thread Aaron Bono
On 10 Aug 2006 06:28:30 -0700, Andrew Hammond <[EMAIL PROTECTED]> wrote: Tomski wrote:> Hello!> As many of you know, SQL Server (2000) has peculiar data type "timestamp"> which is not SQL standard timestamp. In fact it is "rowversion" type. It> makes tha field to be updated with current timestamp w

Re: [SQL] timestamp (MS SQLServer's rowversion) functionality

2006-08-11 Thread Andrew Hammond
On 8/11/06, Aaron Bono <[EMAIL PROTECTED]> wrote: I put a create_dt and modify_dt column on every table and set the default to now(). Then I use this trigger: CREATE OR REPLACE FUNCTION "public"."modify_date_stamp_fn" () RETURNS SETOF opaque AS ' BEGIN -- if a trigger insert or update oper