Re: [GENERAL] Statement Triggers

2010-03-10 Thread A. Kretschmer
In response to Gordan Bobic : > Specifically, what features of the SQL statement that triggered the event > are available to the function invoked by the trigger? Say I wanted to write http://www.postgresql.org/docs/8.4/interactive/plpgsql-trigger.html Except for NEW and OLD. > all INSERT statem

Re: [GENERAL] SAS Raid10 vs SATA II Raid10 - many small reads and writes

2010-03-10 Thread Magnus Hagander
On Thursday, March 11, 2010, Phillip Berry wrote: > On Wednesday 10 March 2010 18:32:41 Scott Marlowe wrote: >> On Tue, Mar 9, 2010 at 11:49 PM, Phillip Berry >> >> wrote: >> > Hi Everyone, >> > >> > We're in the market for a new DB server to replace our current one (yes >> > it's one of *those*

Re: [GENERAL] Finding duplicates only.

2010-03-10 Thread A. Kretschmer
In response to Greenhorn : > Hi, > > Can someone please help me with this duplicate query. > > I'm trying to: > > 1. Return duplicates only. (without including the first valid record), and I will try to help you. Assuming this table: test=*# select * from greenhorn order by id; id | ins

Re: [GENERAL] dst question

2010-03-10 Thread Tom Lane
jgirvin writes: > Australia will come out of DST on the 4th April 2010 at 03:00:00 and > will be +9:30 from utc, currently we are +10:30 utc. OK, so this is a "fall back" transition for you guys, right? > This is 4 seconds into the last hour prior to dst changeover, now the > to_timestamp res

Re: [GENERAL] Naming conventions for lots of stored procedures

2010-03-10 Thread Chris Travers
On Wed, Mar 10, 2010 at 7:08 PM, Justin Graf wrote: > look into schemas. > > this allow group table and procedure logically and can limit access > based on schemas. > > what i did is group procedures, views, and tables into schemas  to keep > them logically grouped. > in one project there is 300

Re: [GENERAL] crosstab functionality for postgres 8.1.4

2010-03-10 Thread Tom Lane
Merlin Moncure writes: > On Wed, Mar 10, 2010 at 7:00 PM, Amol Chiplunkar > wrote: >> My postgres 8.1.4 installation does not have the crosstab >> functions. Most likely due to unavailability of contrib/tablefunc >> module. > does too! I think the problem is the OP didn't install postgresql-con

Re: [GENERAL] SAS Raid10 vs SATA II Raid10 - many small reads and writes

2010-03-10 Thread Phillip Berry
On Wednesday 10 March 2010 18:32:41 Scott Marlowe wrote: > On Tue, Mar 9, 2010 at 11:49 PM, Phillip Berry > > wrote: > > Hi Everyone, > > > > We're in the market for a new DB server to replace our current one (yes > > it's one of *those* questions) ;). > > > > It'll have quad core Xeons, 36GB RAM

Re: [GENERAL] Naming conventions for lots of stored procedures

2010-03-10 Thread Justin Graf
On 3/10/2010 8:16 PM, Chris Travers wrote: > Hi all; > > One of my applications currently has over 60 stored procedures and > future versions will likely have several hundred. I am wondering what > folks find to be helpful naming conventions for managing a large > number of stored procedures. We

Re: [GENERAL] crosstab functionality for postgres 8.1.4

2010-03-10 Thread Merlin Moncure
On Wed, Mar 10, 2010 at 7:00 PM, Amol Chiplunkar wrote: > Hi, > > My postgres 8.1.4 installation does not have the crosstab > functions. Most likely due to unavailability of contrib/tablefunc > module. does too! http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/contrib/tablefunc/?only_with_tag=REL8_

[GENERAL] dst question

2010-03-10 Thread jgirvin
2010-04-04 02:00:04+09:30 (1 row) Can someone explain as to why the output from the to_timestamp shows the offset at +09:30 when within the hour of the dst changeover and is this expected cheers. -- James. __ Information from ESET NOD32 Antivirus, version of virus signa

[GENERAL] Finding duplicates only.

2010-03-10 Thread Greenhorn
Hi, Can someone please help me with this duplicate query. I'm trying to: 1. Return duplicates only. (without including the first valid record), and 2. Return as duplicate if the difference between a.inspection_time and b.inspection time is under 5 minutes. Here's the query string I'm using to

Re: [GENERAL] log_statement and syslog severity

2010-03-10 Thread Bruce Momjian
Stuart Bishop wrote: -- Start of PGP signed section. > > > On Wed, Mar 10, 2010 at 8:51 AM, Bruce Momjian wrote: > > Greg Sabino Mullane wrote: > >> Bruce replied: > >> ... > >> >> This means that, even using syslog as a destination, it's not possible > >> >> for > >> >> me to filter statements

[GENERAL] Naming conventions for lots of stored procedures

2010-03-10 Thread Chris Travers
Hi all; One of my applications currently has over 60 stored procedures and future versions will likely have several hundred. I am wondering what folks find to be helpful naming conventions for managing a large number of stored procedures. We tried using double underscores to separate module vs p

[GENERAL] crosstab functionality for postgres 8.1.4

2010-03-10 Thread Amol Chiplunkar
Hi, My postgres 8.1.4 installation does not have the crosstab functions. Most likely due to unavailability of contrib/tablefunc module. Is there a std version of tablefunc .so that can be downloaded and used ? thanks - Amol -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] log_statement and syslog severity

2010-03-10 Thread dennis jenkins
On Wed, Mar 10, 2010 at 10:55 AM, Ben Chobot wrote: > On Mar 10, 2010, at 12:15 AM, Stuart Bishop wrote: > > > syslog doesn't give you easily machine readable output. I'm not sure how > syslog implementations handle high load (our sysadmins won't use it, so I > haven't investigated this further).

Re: [GENERAL] Connection timeouts from pgAdmin

2010-03-10 Thread Lee Hachadoorian
John, Just wanted to reply that this seems to have been the right track. Rather than change the firewall settings, our network administrator was able set postgres to send a keepalive to the client. Thanks, --Lee On Thu, Mar 4, 2010 at 5:26 PM, Lee Hachadoorian wrote: > On Thu, Mar 4, 2010 at 5:

Re: [GENERAL] Licence

2010-03-10 Thread Steve Crawford
Bill Moran wrote: In response to "Jonathan Tripathy" : I know the PostgreSQL licence is "based" on the BSD licence, however the line which says "without fee" rings alarm bells, even though I think it means that "you don't have ot pay anything to the PostgreSQL developers" rather than "if yo

Re: [GENERAL] How to? Timestamp with timezone.

2010-03-10 Thread Steve Crawford
Andre Lopes wrote: [code] ALTER DATABASE foo SET timezone TO 'someval' ALTER ROLE bar SET timezone TO 'someval' [/code] I need to alter only the Timezone of the database OR I need also to alter the Role? Timestamp and timezone handling in PostgreSQL is very powerful. Think of it as a hierarc

Re: [GENERAL] regexp_replace puzzle

2010-03-10 Thread David W Noon
On Wed, 10 Mar 2010 13:41:54 +0100, Harald Fuchs wrote about [GENERAL] regexp_replace puzzle: [snip] > SELECT val, > regexp_replace(val, > '^(.*\W)?(C\d{7}|[DI]\d{6}|S\d{10})(\W.*)?$', > '\1' || '»\2«='|| sha224enc('\2') || '\3', 'i') [snip] >i.e. the first '\2' gets pro

Re: [GENERAL] log_statement and syslog severity

2010-03-10 Thread Ben Chobot
On Mar 10, 2010, at 12:15 AM, Stuart Bishop wrote: > syslog doesn't give you easily machine readable output. I'm not sure how > syslog implementations handle high load (our sysadmins won't use it, so I > haven't investigated this further). Have you looked into syslog-ng? I believe it does just

[GENERAL] Statement Triggers

2010-03-10 Thread Gordan Bobic
Hi, Can anyone point me at a comprehensive example of statement (as opposed to row) triggers? I've googled it and looked through the documentation, but couldn't find a complete example relevant to what I'm trying to do. Specifically, what features of the SQL statement that triggered the event are

Re: [GENERAL] Licence

2010-03-10 Thread Bill Moran
In response to "Jonathan Tripathy" : > > I know the PostgreSQL licence is "based" on the BSD licence, however the line > which says "without fee" rings alarm bells, even though I think it means that > "you don't have ot pay anything to the PostgreSQL developers" rather than "if > you distribute

Re: [GENERAL] Licence

2010-03-10 Thread Thom Brown
On 10 March 2010 14:49, Jonathan Tripathy wrote: > Hi Everyone, > > Can someone please confirm that the PostgreSQL licence allow commercial > distribution (with a fee charged)? > > I am developing a proprietary (i.e. non-free) solution in Java, and wish to > use PostgreSQL as the backend databas

[GENERAL] Licence

2010-03-10 Thread Jonathan Tripathy
Hi Everyone, Can someone please confirm that the PostgreSQL licence allow commercial distribution (with a fee charged)? I am developing a proprietary (i.e. non-free) solution in Java, and wish to use PostgreSQL as the backend database. We wish to ship the server with our software, as well as u

Re: [GENERAL] regexp_replace puzzle

2010-03-10 Thread Osvaldo Kussama
2010/3/10 Harald Fuchs : > I've got a problem with regexp_replace which I could reduce to the following: > >  CREATE FUNCTION digest(text, text) RETURNS bytea >      LANGUAGE c IMMUTABLE STRICT >      AS '$libdir/pgcrypto', 'pg_digest'; > >  CREATE FUNCTION sha224enc(text) RETURNS text AS $$ >  BEG

Re: [GENERAL] How to? Timestamp with timezone.

2010-03-10 Thread Alvaro Herrera
Andre Lopes escribió: > Hi, > > Thanks for the reply's. > > [code] > ALTER DATABASE foo SET timezone TO 'someval' > ALTER ROLE bar SET timezone TO 'someval' > [/code] > > I need to alter only the Timezone of the database OR I need also to alter > the Role? One of them suffices. -- Alvaro Herr

[GENERAL] regexp_replace puzzle

2010-03-10 Thread Harald Fuchs
I've got a problem with regexp_replace which I could reduce to the following: CREATE FUNCTION digest(text, text) RETURNS bytea LANGUAGE c IMMUTABLE STRICT AS '$libdir/pgcrypto', 'pg_digest'; CREATE FUNCTION sha224enc(text) RETURNS text AS $$ BEGIN RAISE WARNING 'arg=»%«', $1

Re: [GENERAL] make available C extensions to others

2010-03-10 Thread Dimitri Fontaine
Ivan Sergio Borgonovo writes: > I've finished to write an extension to manipulate tsvectors and > tsquery in C. > > I think it could be useful for someone else and I think I may take > advantage at someone else looking at the code too. > > What would be the right place where to publish the code an

[GENERAL] make available C extensions to others

2010-03-10 Thread Ivan Sergio Borgonovo
I've finished to write an extension to manipulate tsvectors and tsquery in C. I think it could be useful for someone else and I think I may take advantage at someone else looking at the code too. What would be the right place where to publish the code and how? -- Ivan Sergio Borgonovo http://ww

Re: [GENERAL] Urgent help needed- alias name in update statement

2010-03-10 Thread Albe Laurenz
Venkat wrote: > In postgre, when i am trying to give alias name in update > statement like below - > > - > update mytable x > set x.name = 'asdf' > where x.no = 1 > --- > > > is giving error - mytable is not having col x. > > We

Re: [GENERAL] How to? Timestamp with timezone.

2010-03-10 Thread Andre Lopes
Hi, Thanks for the reply's. [code] ALTER DATABASE foo SET timezone TO 'someval' ALTER ROLE bar SET timezone TO 'someval' [/code] I need to alter only the Timezone of the database OR I need also to alter the Role? Best Regards, On Wed, Mar 10, 2010 at 1:06 AM, Alvaro Herrera wrote: > Andre Lo

Re: [GENERAL] log_statement and syslog severity

2010-03-10 Thread Magnus Hagander
2010/3/10 Stuart Bishop : > > > On Wed, Mar 10, 2010 at 8:51 AM, Bruce Momjian wrote: >> >> Greg Sabino Mullane wrote: >>> >>> Bruce replied: >>> ... >>> >> This means that, even using syslog as a destination, it's not possible >>> >> for >>> >> me to filter statements without some sort of log-te

Re: [GENERAL] log_statement and syslog severity

2010-03-10 Thread Stuart Bishop
On Wed, Mar 10, 2010 at 8:51 AM, Bruce Momjian wrote: Greg Sabino Mullane wrote: Bruce replied: ... >> This means that, even using syslog as a destination, it's not possible for >> me to filter statements without some sort of log-text parsing, which I'd >> prefer to avoid on effort, performan