[GENERAL] Pass where clause to a function

2014-08-13 Thread Andrew Bartley
Hi all, Is it possible to create a view or foreign table that will do something like this select * from table_x where x_id = 10; passing the where "x_id = 10" to a function sorta like this select * from api_function('x = 10') or select * from api_function(10) passing the result set back to

Re: [GENERAL] Pass where clause to a function

2014-08-13 Thread Andrew Bartley
/13/2014 10:08 PM, Andrew Bartley wrote: > >> >> Is it possible to create a view or foreign table that will do something >> like this >> >> select * from table_x >> where x_id = 10; >> >> passing the where "x_id = 10" to a functio

[GENERAL] intagg

2013-06-19 Thread Andrew Bartley
ansactions) from x x being create table x (transactions int4[]); Can anyone please advise.. Thanks Andrew Bartley

Re: [GENERAL] intagg

2013-06-19 Thread Andrew Bartley
Sorry that should be aggregate int_array_aggregate not function On 20 June 2013 08:16, Andrew Bartley wrote: > Hi All, > > I am trying to use the intagg extension. in 9.1.9 > > I have created the extension as such "CREATE EXTENSION intagg" > > Then tried to use t

[GENERAL] Rule Question

2013-07-24 Thread Andrew Bartley
Hi all, Hope this question is not too stupid but.. I am trying to do something like this create table cats (a text,b text); create rule cats_test as on update to cats do set a = new.b; Can i manipulate column "a" sort of like this... or is there a better way. I would like to do this a

Re: [GENERAL] Rule Question

2013-07-25 Thread Andrew Bartley
Thanks All, And thanks Tom, I did not realise a rule worked in that manner. Will now take that into account in the future. Thanks Andrew On 26 July 2013 02:02, Giuseppe Broccolo wrote: > > Unrelated to the OP's question, the suggestion above could be more simply >> rewritten as >> >> TG_OP

[GENERAL] Function Logging

2009-08-16 Thread Andrew Bartley
Hi All, We have recently upgraded postgres from 7.2 to 8.3. I am struggling with the logging options when it comes to functions. How do log statements from within a Function? Thanks Andrew Bartley

[GENERAL] Function Logging

2009-08-16 Thread Andrew Bartley
Hi All, We have recently upgraded postgres from 7.2 to 8.3. I am struggling with the logging options when it comes to functions. How do log statements from within a Function? Thanks Andrew Bartley

Re: [GENERAL] Function Logging

2009-08-16 Thread Andrew Bartley
. We have been using Postgres for 8 years, hundreds of functions have been written, we have become reliant on logging for production support. Thanks Andrew Bartley PS on this note, how do we log PIDS? This is another "need to have" for our production systems. We log user activity an

Re: [GENERAL] Function Logging

2009-08-17 Thread Andrew Bartley
Thanks Alvaro, I still need to be able to log statements from within functions... Can you help with that? 2009/8/18 Alvaro Herrera > Andrew Bartley escribió: > > > PS on this note, how do we log PIDS? This is another "need to have" for > our > > production sys

Re: [GENERAL] Function Logging

2009-08-17 Thread Andrew Bartley
So the information i have thus far is that, I am not easily able to log the statements from a function. Does anyone know why it was removed... that is it 7.2 logged this information. Thanks Again Andrew Bartley 2009/8/18 Andrew Bartley > Thanks Alvaro, > > I still need to be ab

[GENERAL] Fatal error on start

2009-10-05 Thread Andrew Bartley
does anyone know what this is? Trying to start postgres version: PostgreSQL 8.3.7 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2 2009-10-06 15:17:21 EST 3757 FATAL: XX000: could not open directory "pg_tblspc": Unknown error 530 2009-10-06 15:17:21 EST 3757 LOCATION

Re: [GENERAL] Fatal error on start

2009-10-06 Thread Andrew Bartley
Thanks, I found it, a permissions issue using sudo to start postgres. Thanks anyway. 2009/10/6 纪晓曦 > Did you delete some log or data in your PGDATA directory? > > 2009/10/6 Andrew Bartley > > does anyone know what this is? >> >> Trying to start postgres version:

[GENERAL] Redundant database objects.

2010-07-12 Thread Andrew Bartley
4.3.2 " Is there an effective way to identify these objects using the stats tables? Something like a last accessed/used or some such column? Any suggestions welcomed. Thanks Andrew Bartley Aimstats Pty Ltd

Re: [GENERAL] Redundant database objects.

2010-07-12 Thread Andrew Bartley
accessed) that would give me a clearer indication. Thanks Andrew On 13 July 2010 08:46, Joe Conway wrote: > On 07/12/2010 02:40 PM, Andrew Bartley wrote: > > We have a large number of orphaned or redundant tables, views, and > > functions, due to many years of inadequate so

Re: [GENERAL] Redundant database objects.

2010-07-12 Thread Andrew Bartley
them being reset by some periodic job. That, at the moment, is my main concern. Thanks again. Also i need to find similar information regarding functions and views Any suggestions? Thanks Andrew Bartley On 13 July 2010 09:45, Greg Smith wrote: > Andrew Bartley wrote: > >> U

Re: [GENERAL] Redundant database objects.

2010-07-12 Thread Andrew Bartley
s in base// . So, I could determine, > that some databases were inactive (precisely,not updated) for about a year > and move them to archive... > > Andrew Bartley wrote: > > Is there an effective way to identify these objects using the stats >> tables? Something like a last

Re: [GENERAL] Redundant database objects.

2010-07-14 Thread Andrew Bartley
Thanks to all that replied, I used Joe Conway's suggestion, using grep and an extracted list of tables, functions and views form the DB. It worked very well. I will attach the code I used to this thread once complete. Again Thanks Andrew Bartley On 14 July 2010 00:43, Greg Smith

Re: [GENERAL] Deleting all but one row of a list of non-uniques

2004-06-22 Thread Andrew Bartley
Try this. Create a temp table with a list of the duplicate unid's eg create temp table duplicates as select min(oid) as oid_val, unid from group by unid having count(*) > 1; Then isolate the unwanted rows update set unid = null from duplicates where .unid = duplicates.unid and oid_val