Re: [GENERAL] : Looking for a PostgreSQL book

2011-09-28 Thread Venkat Balaji
Thanks Adam ! Regards, VB On Thu, Sep 29, 2011 at 12:03 AM, Adam Cornett wrote: > The same publisher (Packt) has a book *PostgreSQL > 9 Administration Cookbook* by Simon Riggs and Hannu Krosing that is > equally useful as Greg's *High Performance* book > > > On Wed, Sep 28, 2011 at 1:14 PM, Venk

Re: [GENERAL] stored procs

2011-09-28 Thread John R Pierce
On 09/28/11 6:33 PM, J.V. wrote: Is is possible within a stored procedure to read all the tables in a schema into a list? From that list and for each table is it possible to find the foreign keys in that table? From that list of foreign keys, is it possible to find out which field in which

[GENERAL] stored proc

2011-09-28 Thread J.V.
Is it possible to group a bunch of methods and functions into a single file (stored procedures & functions) and have a main method that can be called to orchestrate the methods, pass in params, get back results, log to a file? I know this can be done with Oracle PL/SQL but a simple google on th

[GENERAL] stored procs

2011-09-28 Thread J.V.
Is is possible within a stored procedure to read all the tables in a schema into a list? From that list and for each table is it possible to find the foreign keys in that table? From that list of foreign keys, is it possible to find out which field in which table the FK corresponds to? I n

Re: [GENERAL] Rules going away

2011-09-28 Thread Ondrej Ivanič
Hi, > folks, don't use RULES! use triggers -- and as much as possible, keep > triggers simple, short, and to the point (simple validation, custom > RI, auditing/logging, etc). I like them :). 'DO INSTEAD' rules are great for partitioning so you can insert (or update) to parent table and 'DO INSTE

Re: [GENERAL] tubles matching

2011-09-28 Thread Michael Glaesemann
On Sep 28, 2011, at 7:19, salah jubeh wrote: > > > Hello, > > I have two views both contain identical column names , order and types > except the primary keys. I want to match these two views - return the pk pair > of the rows which match from these views - by comparing all the column > v

Re: [GENERAL] Help needed in Search

2011-09-28 Thread planas
On Wed, 2011-09-28 at 12:33 +0530, Siva Palanisamy wrote: > Hi All, > > > > I am trying to retrieve the contact names based on the keyed search > string. It performs good for the English alphabets and behaves > strangely for special chars such as _,/,\,% > > The % character is used by SQL

Re: [GENERAL] Rules going away

2011-09-28 Thread Merlin Moncure
On Wed, Sep 28, 2011 at 10:53 AM, Rob Sargent wrote: > > > On 09/28/2011 08:34 AM, Tom Lane wrote: >> Andrew Sullivan writes: >>> On Wed, Sep 28, 2011 at 06:20:04AM -0700, David Fetter wrote: There's an even better reason not to use rules: they're going away in a not too distant version

[GENERAL] Create Extension search path

2011-09-28 Thread Roger Niederland
On my windows install of postgres 9.1.0. I have a search_path set in the config file. This search path has several schemas defined. Some of the databases within postgres, do not have the schema specified on the search path defined within the database. Trying to add pgcryto via: CREATE EXTENS

Re: [GENERAL] : Looking for a PostgreSQL book

2011-09-28 Thread Adam Cornett
The same publisher (Packt) has a book *PostgreSQL 9 Administration Cookbook* by Simon Riggs and Hannu Krosing that is equally useful as Greg's *High Performance* book On Wed, Sep 28, 2011 at 1:14 PM, Venkat Balaji wrote: > Hello Everyone, > > I have been working on PostgreSQL for quite a while (2

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread Merlin Moncure
On Wed, Sep 28, 2011 at 11:45 AM, Diego Augusto Molina wrote: > 2011/9/28, Merlin Moncure : >> Yup -- I get it now.  Well, one point about this is that it seems >> directed towards your personal requirements. This is a very 'heavy' >> audit system that will not be suitable for high performance >>

[GENERAL] One small annoyance

2011-09-28 Thread Chris Travers
I don't know if this has been changed in 9.1 but in 9.0.5 we were trying to set up streaming replication and kept getting the warning about wal_level=minimal and hence hot standby not being possible. It was the same message as this (found in one of the emails I found when researching the problem):

Re: [GENERAL] Rules going away

2011-09-28 Thread Rob Sargent
On 09/28/2011 08:34 AM, Tom Lane wrote: > Andrew Sullivan writes: >> On Wed, Sep 28, 2011 at 06:20:04AM -0700, David Fetter wrote: >>> There's an even better reason not to use rules: they're going away in >>> a not too distant version of PostgreSQL. >> Really? How? I thought views were done us

[GENERAL] Re: What about improving the rules system we have, was Re: Rules going away

2011-09-28 Thread Chris Travers
First, thanks for your thoughtful reply. On Wed, Sep 28, 2011 at 9:12 AM, Tom Lane wrote: > > You're certainly right that unexpected multiple evaluations of volatile > expressions is the first thing that bites people.  (I don't believe > that's restricted to DO ALSO vs INSTEAD though.) I am hav

[GENERAL] : Looking for a PostgreSQL book

2011-09-28 Thread Venkat Balaji
Hello Everyone, I have been working on PostgreSQL for quite a while (2 yrs) now. I have got "PostgreSQL 9.0 High Performance" book and quite excited to go through it. Please let me know any source where i can get more books on PG, I am especially looking for books on PG internals, architecture,

Re: [GENERAL] What about improving the rules system we have, was Re: Rules going away

2011-09-28 Thread Merlin Moncure
On Wed, Sep 28, 2011 at 11:46 AM, Harald Fuchs wrote: > In article <4116.1317226...@sss.pgh.pa.us>, > Tom Lane writes: > >> Not sure this specific proposal makes any sense at all.  IMO the only >> real advantage that rules have over triggers is that they work on a >> set-operation basis not a tup

Re: [GENERAL] What about improving the rules system we have, was Re: Rules going away

2011-09-28 Thread Harald Fuchs
In article <4116.1317226...@sss.pgh.pa.us>, Tom Lane writes: > Not sure this specific proposal makes any sense at all. IMO the only > real advantage that rules have over triggers is that they work on a > set-operation basis not a tuple-by-tuple basis. Isn't that what statement-level triggers ar

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread Diego Augusto Molina
2011/9/28, Merlin Moncure : > Yup -- I get it now. Well, one point about this is that it seems > directed towards your personal requirements. This is a very 'heavy' > audit system that will not be suitable for high performance > transactional systems. That said, it looks well thought out. Storin

Re: [GENERAL] What about improving the rules system we have, was Re: Rules going away

2011-09-28 Thread Tom Lane
Chris Travers writes: > On Wed, Sep 28, 2011 at 7:34 AM, Tom Lane wrote: >> I think the true state of affairs is this: rules have a lot of >> surprising behaviors, and if we could think of something that works more >> straightforwardly, we'd love to replace them. > I guess my question is what it

Re: [GENERAL] tubles matching

2011-09-28 Thread salah jubeh
Thanks Chris, this solution is one alternative, but it will not work in my app because the join condition in your example is defined using all the fields. in my case the join condition is unknown.  if a row in the first view is a subset of a row in the second view that means there is a match. 

[GENERAL] What about improving the rules system we have, was Re: Rules going away

2011-09-28 Thread Chris Travers
On Wed, Sep 28, 2011 at 7:34 AM, Tom Lane wrote: > I think the true state of affairs is this: rules have a lot of > surprising behaviors, and if we could think of something that works more > straightforwardly, we'd love to replace them.  But I think we'd have to > have the "something" in place be

Re: [GENERAL] bytea columns and large values

2011-09-28 Thread Merlin Moncure
On Wed, Sep 28, 2011 at 3:28 AM, David North wrote: > On 28/09/11 01:50, Craig Ringer wrote: >> >> On 09/28/2011 01:01 AM, David North wrote: >> >>> testdb=# select * from problem_table; >>> ERROR: invalid memory alloc request size 2003676411 >> >> What Pg version are you using? >> >> On which pla

Re: [GENERAL] tubles matching

2011-09-28 Thread Chris Travers
Is something like this what you are trying to do? somedb=# create table a (a int, b text, c date); CREATE TABLE somedb=# create table b (a int, b text, c date); CREATE TABLE somedb=# select * from a join b using (a, b, c); a | b | c ---+---+--- (0 rows) somedb=# insert into a values (1, 'test',

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread Merlin Moncure
On Wed, Sep 28, 2011 at 8:20 AM, Diego Augusto Molina wrote: > 2011/9/27, Merlin Moncure : >> *) when posting schema definitions, particularly in email format, try >> not to use dumped definitions from pg_dump or pgadmin. This creates a >> lot of noise in the script that detracts from what you are

Re: Rules going away (was: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers)

2011-09-28 Thread Andrew Sullivan
On Wed, Sep 28, 2011 at 10:34:32AM -0400, Tom Lane wrote: > I think the true state of affairs is this: rules have a lot of > surprising behaviors, and if we could think of something that works more > straightforwardly, we'd love to replace them. Oh. Well, _that's_ not news :-) -- Andrew Sulli

Re: Rules going away (was: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers)

2011-09-28 Thread Tom Lane
Andrew Sullivan writes: > On Wed, Sep 28, 2011 at 06:20:04AM -0700, David Fetter wrote: >> There's an even better reason not to use rules: they're going away in >> a not too distant version of PostgreSQL. > Really? How? I thought views were done using rules under the hood? > Also, it'd be awfu

Rules going away (was: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers)

2011-09-28 Thread Andrew Sullivan
On Wed, Sep 28, 2011 at 06:20:04AM -0700, David Fetter wrote: > > There's an even better reason not to use rules: they're going away in > a not too distant version of PostgreSQL. Really? How? I thought views were done using rules under the hood? Also, it'd be awfully nice if, in case rules are

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread Diego Augusto Molina
2011/9/27, Merlin Moncure : > *) when posting schema definitions, particularly in email format, try > not to use dumped definitions from pg_dump or pgadmin. This creates a > lot of noise in the script that detracts from what you are trying to > do. Also an attached file would probably have been m

Re: [GENERAL] [Solved] Generic logging system for pre-hstore using plperl triggers

2011-09-28 Thread David Fetter
On Tue, Sep 27, 2011 at 04:52:08PM -0300, Diego Augusto Molina wrote: > 2011/9/27, Diego Augusto Molina : > > Honestly, I don't remember why I used triggers instead of rules in the > > "audit" and "audet" tables. > > I remember now, that's because in my case, operations over tuples are > done very

Re: [GENERAL] live metadata changes v8.3.4

2011-09-28 Thread David Fetter
On Tue, Sep 27, 2011 at 01:51:42PM -0700, Gauthier, Dave wrote: > Hi: > > How does one make a metadata change to a DB that's actively being > used. Specifically, I want to drop a view, drop some columns from a > table that's used in the view, recreate the view without those > columns. > > In the

Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-28 Thread Rich Shepard
On Wed, 28 Sep 2011, Vincent Veyron wrote: I'm not sure what 'INSTALL INTO ... statements' are, but are you aware of the very convenient 'M-x sql-postgres' in emacs? Vincent, I have a SQL major mode for emacs. Don't know that it's specific to postgres but it is automatically invoked when I

[GENERAL] Help needed in Search

2011-09-28 Thread Siva Palanisamy
Hi All, I am trying to retrieve the contact names based on the keyed search string. It performs good for the English alphabets and behaves strangely for special chars such as _,/,\,% My query in the function is similar to SELECT contact_name FROM contacts WHERE LOWER(contact_name) LIKE LOWER(

[GENERAL] Help needed in Search

2011-09-28 Thread Siva Palanisamy
Hi All, I am trying to retrieve the contact names based on the keyed search string. It performs good for the English alphabets and behaves strangely for special chars such as _,/,\,% My query in the function is similar to SELECT contact_name FROM contacts WHERE LOWER(contact_name) LIKE LOWER(

Re: [GENERAL] tubles matching

2011-09-28 Thread Alban Hertroys
On 28 September 2011 13:19, salah jubeh wrote: > > Hello, > > I have two views both contain  identical column names , order and types > except the primary keys. I want to match these two views - return the pk > pair  of the rows which match from these views - by comparing all the column > values.

[GENERAL] tubles matching

2011-09-28 Thread salah jubeh
Hello, I have two views both contain  identical column names , order and types except the primary keys. I want to match these two views - return the pk pair  of the rows which match from these views - by comparing all the column values. I want to write a pgplsql function to do this Job by ite

Re: [GENERAL] Download States and Capitals Database

2011-09-28 Thread Adarsh Sharma
Craig Ringer wrote: On 28/09/11 13:43, Johan De Meersman wrote: - Original Message - From: "Adarsh Sharma" This Link gives the capitals of all countries but I need the states and their capitals in all these countries too.. But I think this is not possible because very few coun

Re: [GENERAL] bytea columns and large values

2011-09-28 Thread David North
On 28/09/11 01:50, Craig Ringer wrote: On 09/28/2011 01:01 AM, David North wrote: testdb=# select * from problem_table; ERROR: invalid memory alloc request size 2003676411 What Pg version are you using? On which platform? 32-bit or 64-bit OS? If 64-bit, with a 32-bit or 64-bit build of Pos

Re: [GENERAL] PostgreSQL recovery when lost some file in data\global

2011-09-28 Thread tuanhoanganh
I can start postgresql but there is error 2011-09-28 15:09:37 ICT LOG: database system was interrupted; last known up at 2011-09-26 08:03:39 ICT 2011-09-28 15:09:37 ICT LOG: database system was not properly shut down; automatic recovery in progress 2011-09-28 15:09:37 ICT LOG: consistent recove

Re: [GENERAL] Download States and Capitals Database

2011-09-28 Thread Craig Ringer
On 28/09/11 13:43, Johan De Meersman wrote: > > - Original Message - >> From: "Adarsh Sharma" >> >> This Link gives the capitals of all countries but I need the states >> and their capitals in all these countries too.. >> But I think this is not possible because very few countries are >>

Re: [GENERAL] Quick-and-Dirty Data Entry with LibreOffice3?

2011-09-28 Thread Vincent Veyron
Le mardi 27 septembre 2011 à 13:19 -0700, Rich Shepard a écrit : > On Tue, 27 Sep 2011, John R Pierce wrote: > > > to use ODBC, you'd need to give it the DSN information, I don't know the > > exact format, but in general, its something like > > > > [PostgreSQL] > > Description = Po