Re: [GENERAL] pg_upgrade only to 9.0 ?

2011-05-09 Thread Iain Barnett
On 10 May 2011, at 01:16, Scott Marlowe wrote: > On Mon, May 9, 2011 at 6:10 PM, Iain Barnett wrote: >> Hi, >> >> I'm currently running 8.4.4. I downloaded the source for 9.0.4 and installed >> it, and then installed pg_upgrade and ran it, and got the followi

[GENERAL] pg_upgrade only to 9.0 ?

2011-05-09 Thread Iain Barnett
Hi, I'm currently running 8.4.4. I downloaded the source for 9.0.4 and installed it, and then installed pg_upgrade and ran it, and got the following message: > This utility can only upgrade to PostgreSQL version 9.0. It seems strange to me that it can only upgrade to that and not 4 patch points

Re: [GENERAL] Locale and UTF8 for template1 in 8.4.4

2011-05-06 Thread Iain Barnett
On 6 May 2011, at 16:19, Alan Hodgson wrote: > On May 6, 2011, Iain Barnett wrote: > > Would anyone be able to point out to me how I can get the template1 > > database to be utf8 and en_GB? (or US, I'm not *that* fussed) > Use the --encoding and --locale options to initd

[GENERAL] Locale and UTF8 for template1 in 8.4.4

2011-05-06 Thread Iain Barnett
Hi, I'd like to change the template1 database to be in UTF8 and en_GB, so that all databases I create (unless specified otherwise) will start with that encoding by default, if I understand correctly. I've searched around for how to do this but can't seem to get what I've found to work. If I ru

[GENERAL] how to create a new composite type using already existing composite types

2010-02-09 Thread Iain Barnett
Hi, Is there a way to create a new composite type using already existing composite type? For example, CREATE TABLE inventory_item ( nametext, supplier_id integer REFERENCES suppliers, price numeric CHECK (price > 0) ); produces the following type automatic

[GENERAL] How to call SETOF function?

2010-01-06 Thread Iain Barnett
If I run the following (in either a terminal or the PgAdmin3 Query tool) I get the error: ERROR: query has no destination for result data SQL state: 42601 Hint: If you want to discard the results of a SELECT, use PERFORM instead. Context: PL/pgSQL function "anything_all_udf" line 3 at SQL stateme

Re: [GENERAL] variables in ad hoc queries

2009-09-29 Thread Iain Barnett
Sorry, in oversimplifying for clarity I was making it more unclear! Whenever I write a function, I like to write a quick ad hoc test to go with it in the comments. It means I can also test combinations of functions together quickly, without having to build other functions first, and gives a

[GENERAL] variables in ad hoc queries

2009-09-29 Thread Iain Barnett
If I have a function that returns an integer, how can I use the following code outside of a function block? declare _myint int; begin _myint := myfunction( ); end; or is it just not possible? Iain -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] INSERT... RETURNING with a function

2009-09-26 Thread Iain Barnett
On 26 Sep 2009, at 19:57, Tom Lane wrote: I think you want INSERT ... RETURNING ... INTO some-plpgsql-variable; regards, tom lane On 26 Sep 2009, at 19:56, Adrian Klaver wrote: See: http://www.postgresql.org/docs/8.4/interactive/plpgsql- statements.html#PLPGSQL-S

[GENERAL] INSERT... RETURNING with a function

2009-09-26 Thread Iain Barnett
I've written a straightforward insert function, but using the RETURNING keyword for the first time. If I try running the test case I get the error: ERROR: query has no destination for result data CONTEXT: PL/pgSQL function "nonauth_users_insert_new_udf" line 7 at SQL statement I'm not s