Re: [GENERAL] auto-filling a field on insert

2009-10-25 Thread Craig Ringer
Scott Marlowe wrote: > On Fri, Oct 23, 2009 at 9:32 PM, semi-ambivalent wrote: >> Thanks everyone for the pointers. I like the idea of getting rid of >> the concatenated field even though it reduced the worst case query >> time to one tenth of what I had been seeing. But for now I'm going to >> ke

Re: [GENERAL] PostgreSQL Conference 2009 Japan

2009-10-25 Thread Ian Barwick
2009/9/2 Markus Wanner : > Hi, > > I've added a wiki page with some information you might find helpful, if you > are attending the PostgreSQL Conference 2009 in Japan. However, I've never > been to Tokyo before, so please feel free to correct and add better links, > hints and recommendations: > > h

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Sat, Oct 24, 2009 at 5:41 PM, Tom Lane wrote: > Timothy Madden writes: > > Can the string literal syntax for the function body in a CREATE FUNCTION > > statement please, > > please be dropped ? > > No. Since the function's language might be anything, there's no way to > identify the end of t

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Adrian Klaver
On Sunday 25 October 2009 9:17:04 am Timothy Madden wrote: > On Sat, Oct 24, 2009 at 5:41 PM, Tom Lane wrote: > > Timothy Madden writes: > > > Can the string literal syntax for the function body in a CREATE > > > FUNCTION statement please, > > > please be dropped ? > > > > No. Since the function

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > There is a SQL standard for this, and other DBMS look like they found a way > > How come it can not be done ? It *can* be done, but it won't be done. At least not by default. You might get better traction if you perhaps argue for a flag to pg_

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Sun, Oct 25, 2009 at 8:49 PM, Adrian Klaver wrote: > On Sunday 25 October 2009 9:17:04 am Timothy Madden wrote: > > On Sat, Oct 24, 2009 at 5:41 PM, Tom Lane wrote: > > > Timothy Madden writes: > > > > Can the string literal syntax for the function body in a CREATE > > > > FUNCTION statement

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Sun, Oct 25, 2009 at 10:38 PM, Greg Sabino Mullane wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: RIPEMD160 > > > There is a SQL standard for this, and other DBMS look like they found a > way > > > > How come it can not be done ? > > It *can* be done, but it won't be done. At least not b

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Scott Marlowe
On Sun, Oct 25, 2009 at 2:43 PM, Timothy Madden wrote: > > > On Sun, Oct 25, 2009 at 8:49 PM, Adrian Klaver wrote: >> >> On Sunday 25 October 2009 9:17:04 am Timothy Madden wrote: >> > On Sat, Oct 24, 2009 at 5:41 PM, Tom Lane wrote: >> > > Timothy Madden writes: >> > > > Can the string literal

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Alvaro Herrera
Timothy Madden escribió: > Just like when I write C++ applications I use standards-conforming > C++, when I write SQL applications I would like to use > standard-conforming SQL. Sadly, we don't have standards-conformant SQL/PSM. Right now, we have a lot of different languages for functions, none

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Tom Lane
Timothy Madden writes: > What I want is compatible with existing code and the current default > behavior. Just look for a LANGUAGE SQL declaration in the function > header (before the body). > If found expect the in-place definition of the function body to follow. > If not found expect a string

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Sun, Oct 25, 2009 at 11:33 PM, Scott Marlowe wrote: > On Sun, Oct 25, 2009 at 2:43 PM, Timothy Madden > wrote: > > Just like when I write C++ applications I use standards-conforming C++, > when > > I write SQL > > applications I would like to use standard-conforming SQL. > > But as soon as the

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Sun, Oct 25, 2009 at 11:40 PM, Alvaro Herrera wrote: > Timothy Madden escribió: > > > Just like when I write C++ applications I use standards-conforming > > C++, when I write SQL applications I would like to use > > standard-conforming SQL. > > Sadly, we don't have standards-conformant SQL/PSM

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Mon, Oct 26, 2009 at 12:01 AM, Tom Lane wrote: > Timothy Madden writes: > > What I want is compatible with existing code and the current default > > behavior. Just look for a LANGUAGE SQL declaration in the function > > header (before the body). > > > If found expect the in-place definition

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Alvaro Herrera
Timothy Madden escribió: > Anyway Posgres offers a CREATE FUNCTION statement that resembles or should > resemble that in the standard, and that is what I am talking about. "Should" being the operative word in that sentence. If you want to submit a patch to move us closer towards the SQL/PSM goal

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Timothy Madden
On Mon, Oct 26, 2009 at 12:42 AM, Alvaro Herrera wrote: > Timothy Madden escribió: > > > Anyway Posgres offers a CREATE FUNCTION statement that resembles or > should > > resemble that in the standard, and that is what I am talking about. > > "Should" being the operative word in that sentence. If

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Adrian Klaver
On Sunday 25 October 2009 3:20:51 pm Timothy Madden wrote: > On Mon, Oct 26, 2009 at 12:01 AM, Tom Lane wrote: > > Timothy Madden writes: > > > What I want is compatible with existing code and the current default > > > behavior. Just look for a LANGUAGE SQL declaration in the function > > > head

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Adrian Klaver
On Sunday 25 October 2009 4:06:33 pm Timothy Madden wrote: > On Mon, Oct 26, 2009 at 12:42 AM, Alvaro Herrera > > > wrote: > > > > Timothy Madden escribió: > > > Anyway Posgres offers a CREATE FUNCTION statement that resembles or > > > > should > > > > > resemble that in the standard, and that is

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Alvaro Herrera
Timothy Madden escribió: > On Mon, Oct 26, 2009 at 12:42 AM, Alvaro Herrera > wrote: > > > Timothy Madden escribió: > > > > > Anyway Posgres offers a CREATE FUNCTION statement that resembles > > > or should resemble that in the standard, and that is what I am > > > talking about. > > > > "Should"

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Tom Lane
Alvaro Herrera writes: > SQL/PSM is a different beast than all the rest of the PLs, because it is > standard, so I am sure that we will want to implement the standard > syntax (no string literal) when we have SQL/PSM. But implementing no- > string-literals before we get full SQL/PSM support would

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread David W Noon
On Sun, 25 Oct 2009 20:17:22 -0400, Tom Lane wrote about Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?: [snip] > ::= > > | > > ::= > >and seems to allow one (count em, one) SQL >DDL or DML statement. So p

[GENERAL] indexing

2009-10-25 Thread ginanjar
I work on my thesis on spatial database indeksing using Btree n GiST. Can you help to explain how the GiST and btree indexing work in postgresql ( the algorithm ) ? Can somone show me how to write code to know the tree level and count the root and leaf ? thanks for the information n help . --

Re: [GENERAL] How can I get one OLD.* field in a dynamic query inside a trigger function ?

2009-10-25 Thread Bruno Baguette
Le 24/10/09 22:57, Pavel Stehule a écrit : 2009/10/24 Bruno Baguette : Which one would you advise me to learn and use, instead of PL/pgSQL ? It depends on what you are know (if you known better perl or pthon). Usually I using mainly plpgsql and on some functions plperl and C. plpgsql is good l

Re: [GENERAL] Can the string literal syntax for function definitions please be dropped ?

2009-10-25 Thread Pavel Stehule
2009/10/26 Tom Lane : > Alvaro Herrera writes: >> SQL/PSM is a different beast than all the rest of the PLs, because it is >> standard, so I am sure that we will want to implement the standard >> syntax (no string literal) when we have SQL/PSM.  But implementing no- >> string-literals before we ge