[GENERAL] More efficient INs when comparing two columns

2005-09-20 Thread Magnus Naeslund(t)
I was thinking if this was possible in some way.. I have this table where we have X and Y coordinates, and i need to select several in one go. # select * from xy where (x = 1 and y = 2) or (x = 2 and y = 2); This works but are not so nice looking. It would be nice to be able to do it like this:

[GENERAL] plpgsql cursors, fetching more than one row

2005-06-15 Thread Magnus Naeslund(t)
I was thinking of using cursors as a paging mechanism for an application. Let's say I need to fetch pagenr from a table. If I use these commands from the client it works: BEGIN WORK; DECLARE my_cursor CURSOR FOR SELECT * FROM test1 ORDER BY id ASC FOR READ ONLY; MOVE pagenr*pagesize IN

Re: [GENERAL] Encoding Issue with UNICODE

2005-04-11 Thread Magnus Naeslund(t)
Fritz Bayer wrote: Hello, I`m using postgresql 7.2.1. According to the following lines data in my database gets encoded as unicode. Server and client communication seems to use unicode as well: woody=# select version(); version ---

Re: [GENERAL] Execute vacuum

2003-11-21 Thread Magnus Naeslund(t)
Carmen Gloria Sepulveda Dedes wrote: Hello! Can I execute VACUUM ANALYZE from ecpg? How I do that??? /* I do: EXEC SQL VACUUM ANALYZE table; But I get error: 'ERROR: VACUUM cannot run inside a transaction block' */ Turn on/off autocommit maybe? Or fake it with EXEC SQL COMMIT; VACUUM