pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: proposal for a CookBook in postgresql.org
12+ messages / 5 participants
[nested] [flat]

* Re: proposal for a CookBook in postgresql.org
@ 2009-05-18 11:57  Dave Page <dpage@pgadmin.org>
  parent: Gerardo Herzig <gherzig@fmed.uba.ar>
  0 siblings, 1 reply; 12+ messages in thread

From: Dave Page @ 2009-05-18 11:57 UTC (permalink / raw)
  To: Gerardo Herzig <gherzig@fmed.uba.ar>; +Cc: pgsql-sql

On Mon, May 18, 2009 at 1:29 PM, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:

> I think this is a good time to propose some kind of CookBook, to
> preserve this kind of answers.

What, like this one?

http://wiki.postgresql.org/wiki/Snippets

:-)

-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* proposal for a CookBook in postgresql.org
@ 2009-05-18 12:29  Gerardo Herzig <gherzig@fmed.uba.ar>
  0 siblings, 1 reply; 12+ messages in thread

From: Gerardo Herzig @ 2009-05-18 12:29 UTC (permalink / raw)
  To: pgsql-sql

I just saw a beatifull answer from Pavel, as an answer to this question:
"""
I'm just wondering if there's some way to retrieve the hour column as the
> sum of the array values... Just like this:
>
>            hour            | statistics_date
> ----------------------------+-----------------
>  9000                       | 2008-01-03
"""

With this function:
"""
postgres=# create or replace function sum_items(bigint[]) returns
bigint as $$ select sum($1[i])::bigint from
generate_series(array_lower($1,1), array_upper($1,1)) g(i)$$ language
sql immutable;
CREATE FUNCTION
Time: 2,510 ms
postgres=# select sum_items(array[1,2,3,4]); sum_items
-----------
        10
(1 row)
"""

I think this is a good time to propose some kind of CookBook, to
preserve this kind of answers.

Gerardo



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: proposal for a CookBook in postgresql.org
@ 2009-05-18 12:34  Pavel Stehule <pavel.stehule@gmail.com>
  parent: Gerardo Herzig <gherzig@fmed.uba.ar>
  0 siblings, 1 reply; 12+ messages in thread

From: Pavel Stehule @ 2009-05-18 12:34 UTC (permalink / raw)
  To: Gerardo Herzig <gherzig@fmed.uba.ar>; +Cc: Dave Page <dpage@pgadmin.org>; pgsql-sql

2009/5/18 Gerardo Herzig <gherzig@fmed.uba.ar>:
> Dave Page wrote:
>> On Mon, May 18, 2009 at 1:29 PM, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:
>>
>>> I think this is a good time to propose some kind of CookBook, to
>>> preserve this kind of answers.
>>
>> What, like this one?
>>
>> http://wiki.postgresql.org/wiki/Snippets
>>
>> :-)
>>
> Oops. Yeah, kind of :)
> Did not see any direct link from "Docs" main page.
>
>

this is usual tricks for arrays - you ca use it for min, max, avg,
sort for arrays. In 8.4 is possible to use generate_subscripts
functions.

regards
Pavel Stehule

others tricks http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks

regards
Pavel Stehule



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: proposal for a CookBook in postgresql.org
@ 2009-05-18 13:04  Gerardo Herzig <gherzig@fmed.uba.ar>
  parent: Dave Page <dpage@pgadmin.org>
  0 siblings, 1 reply; 12+ messages in thread

From: Gerardo Herzig @ 2009-05-18 13:04 UTC (permalink / raw)
  To: Dave Page <dpage@pgadmin.org>; +Cc: pgsql-sql

Dave Page wrote:
> On Mon, May 18, 2009 at 1:29 PM, Gerardo Herzig <gherzig@fmed.uba.ar> wrote:
> 
>> I think this is a good time to propose some kind of CookBook, to
>> preserve this kind of answers.
> 
> What, like this one?
> 
> http://wiki.postgresql.org/wiki/Snippets
> 
> :-)
> 
Oops. Yeah, kind of :)
Did not see any direct link from "Docs" main page.

Sory about the noise.

Gerardo



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: proposal for a CookBook in postgresql.org
@ 2009-05-18 16:25  Alvaro Herrera <alvherre@commandprompt.com>
  parent: Pavel Stehule <pavel.stehule@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Alvaro Herrera @ 2009-05-18 16:25 UTC (permalink / raw)
  To: Pavel Stehule <pavel.stehule@gmail.com>; +Cc: Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql

Pavel Stehule escribió:

> others tricks http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks

There's a lot of good stuff in there ... would you care about
copying/moving it to wiki.postgresql.org/wiki/Snippets ?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: proposal for a CookBook in postgresql.org
@ 2009-05-18 16:29  Pavel Stehule <pavel.stehule@gmail.com>
  parent: Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Pavel Stehule @ 2009-05-18 16:29 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql

2009/5/18 Alvaro Herrera <alvherre@commandprompt.com>:
> Pavel Stehule escribió:
>
>> others tricks http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks
>
> There's a lot of good stuff in there ... would you care about
> copying/moving it to wiki.postgresql.org/wiki/Snippets ?
>

This contents is free - and if you would do it, please do it. My
english isn't good, so it's work for someone with good english. I am
maintainer and founder of this site, and I am granting rights for free
content copy.

Regards
Pavel

> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: proposal for a CookBook in postgresql.org
@ 2009-05-18 18:53  Alvaro Herrera <alvherre@commandprompt.com>
  parent: Pavel Stehule <pavel.stehule@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Alvaro Herrera @ 2009-05-18 18:53 UTC (permalink / raw)
  To: Pavel Stehule <pavel.stehule@gmail.com>; +Cc: Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql

Pavel Stehule escribió:
> 2009/5/18 Alvaro Herrera <alvherre@commandprompt.com>:
> > Pavel Stehule escribió:
> >
> >> others tricks http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks
> >
> > There's a lot of good stuff in there ... would you care about
> > copying/moving it to wiki.postgresql.org/wiki/Snippets ?
> 
> This contents is free - and if you would do it, please do it. My
> english isn't good, so it's work for someone with good english. I am
> maintainer and founder of this site, and I am granting rights for free
> content copy.

I don't have time for that right now, but I have added a link to your
page at the top of Snippets.  Thanks.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: [SQL] proposal for a CookBook in postgresql.org
@ 2009-06-02 20:28  Bruce Momjian <bruce@momjian.us>
  parent: Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2009-06-02 20:28 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql; PostgreSQL-documentation <pgsql-docs@postgresql.org>

Alvaro Herrera wrote:
> Pavel Stehule escribi?:
> > 2009/5/18 Alvaro Herrera <alvherre@commandprompt.com>:
> > > Pavel Stehule escribi?:
> > >
> > >> others tricks http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks
> > >
> > > There's a lot of good stuff in there ... would you care about
> > > copying/moving it to wiki.postgresql.org/wiki/Snippets ?
> > 
> > This contents is free - and if you would do it, please do it. My
> > english isn't good, so it's work for someone with good english. I am
> > maintainer and founder of this site, and I am granting rights for free
> > content copy.
> 
> I don't have time for that right now, but I have added a link to your
> page at the top of Snippets.  Thanks.

FYI, I have a copy of the old plpgsql cookbook at:

	http://www.brasileiro.net:8080/postgres/cookbook/
	PostgreSQL CookBook Pages
	Roberto Mello
	
	http://techdocs.postgresql.org/guides/SetReturningFunctions
	PostgreSQL 7.3 Set Returning Functions
	Stephan Szabo

stored at:

	http://momjian.us/expire/cookbook.tgz

if someone wants to transfer them to the wiki.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: [SQL] proposal for a CookBook in postgresql.org
@ 2009-06-02 20:48  Alvaro Herrera <alvherre@commandprompt.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Alvaro Herrera @ 2009-06-02 20:48 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql; PostgreSQL-documentation <pgsql-docs@postgresql.org>

Bruce Momjian escribió:

> FYI, I have a copy of the old plpgsql cookbook at:
> 
> 	http://www.brasileiro.net:8080/postgres/cookbook/
> 	PostgreSQL CookBook Pages
> 	Roberto Mello
> 	
> 	http://techdocs.postgresql.org/guides/SetReturningFunctions
> 	PostgreSQL 7.3 Set Returning Functions
> 	Stephan Szabo

Stephan's article is already on the wiki:
http://wiki.postgresql.org/wiki/Return_more_than_one_row_of_data_from_PL/pgSQL_functions
It needs an update.

I don't know about Roberto Mello's site.  Did we get a copyright
transfer or a license saying we could use the contents?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: [SQL] proposal for a CookBook in postgresql.org
@ 2009-06-02 20:52  Bruce Momjian <bruce@momjian.us>
  parent: Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2009-06-02 20:52 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql; PostgreSQL-documentation <pgsql-docs@postgresql.org>

Alvaro Herrera wrote:
> Bruce Momjian escribi?:
> 
> > FYI, I have a copy of the old plpgsql cookbook at:
> > 
> > 	http://www.brasileiro.net:8080/postgres/cookbook/
> > 	PostgreSQL CookBook Pages
> > 	Roberto Mello
> > 	
> > 	http://techdocs.postgresql.org/guides/SetReturningFunctions
> > 	PostgreSQL 7.3 Set Returning Functions
> > 	Stephan Szabo
> 
> Stephan's article is already on the wiki:
> http://wiki.postgresql.org/wiki/Return_more_than_one_row_of_data_from_PL/pgSQL_functions
> It needs an update.
> 
> I don't know about Roberto Mello's site.  Did we get a copyright
> transfer or a license saying we could use the contents?

Nope, but I assumed it was BSD-licensed.  I see this Josh Berkus
copyright:

	--Copyright Josh Berkus, josh@agliodbs.com
	--permission granted to use anywhere provided that this
	--copyright statement remains in the code.
	--No warranty is given or implied.
	--Use at your own risk -- strictly beta code.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: [SQL] proposal for a CookBook in postgresql.org
@ 2009-06-02 21:10  Alvaro Herrera <alvherre@commandprompt.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Alvaro Herrera @ 2009-06-02 21:10 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql; PostgreSQL-documentation <pgsql-docs@postgresql.org>

Bruce Momjian escribió:
> Alvaro Herrera wrote:

> > I don't know about Roberto Mello's site.  Did we get a copyright
> > transfer or a license saying we could use the contents?
> 
> Nope, but I assumed it was BSD-licensed.  I see this Josh Berkus
> copyright:
> 
> 	--Copyright Josh Berkus, josh@agliodbs.com

You're saying that Josh Berkus owns the copyright of the entire site?
That seems unlikely.

I think the way we should go about this is somebody talks to Roberto and
gets his approval on us using his content on the Wiki (the way we did
with Pavel upthread).  Otherwise I think it's a nonstarter.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



^ permalink  raw  reply  [nested|flat] 12+ messages in thread

* Re: [SQL] proposal for a CookBook in postgresql.org
@ 2009-06-03 00:56  Bruce Momjian <bruce@momjian.us>
  parent: Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 0 replies; 12+ messages in thread

From: Bruce Momjian @ 2009-06-03 00:56 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@commandprompt.com>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; Gerardo Herzig <gherzig@fmed.uba.ar>; Dave Page <dpage@pgadmin.org>; pgsql-sql; PostgreSQL-documentation <pgsql-docs@postgresql.org>

Alvaro Herrera wrote:
> Bruce Momjian escribi?:
> > Alvaro Herrera wrote:
> 
> > > I don't know about Roberto Mello's site.  Did we get a copyright
> > > transfer or a license saying we could use the contents?
> > 
> > Nope, but I assumed it was BSD-licensed.  I see this Josh Berkus
> > copyright:
> > 
> > 	--Copyright Josh Berkus, josh@agliodbs.com
> 
> You're saying that Josh Berkus owns the copyright of the entire site?
> That seems unlikely.

On one function.

> I think the way we should go about this is somebody talks to Roberto and
> gets his approval on us using his content on the Wiki (the way we did
> with Pavel upthread).  Otherwise I think it's a nonstarter.

OK.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +



^ permalink  raw  reply  [nested|flat] 12+ messages in thread


end of thread, other threads:[~2009-06-03 00:56 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-05-18 12:29 proposal for a CookBook in postgresql.org Gerardo Herzig <gherzig@fmed.uba.ar>
2009-05-18 11:57 ` Dave Page <dpage@pgadmin.org>
2009-05-18 13:04   ` Gerardo Herzig <gherzig@fmed.uba.ar>
2009-05-18 12:34     ` Pavel Stehule <pavel.stehule@gmail.com>
2009-05-18 16:25       ` Alvaro Herrera <alvherre@commandprompt.com>
2009-05-18 16:29         ` Pavel Stehule <pavel.stehule@gmail.com>
2009-05-18 18:53           ` Alvaro Herrera <alvherre@commandprompt.com>
2009-06-02 20:28             ` Bruce Momjian <bruce@momjian.us>
2009-06-02 20:48               ` Alvaro Herrera <alvherre@commandprompt.com>
2009-06-02 20:52                 ` Bruce Momjian <bruce@momjian.us>
2009-06-02 21:10                   ` Alvaro Herrera <alvherre@commandprompt.com>
2009-06-03 00:56                     ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox