Re: [GENERAL] dynamic table/col names in plpgsql

2007-06-23 Thread Steve Atkins
On Jun 23, 2007, at 8:47 PM, gary jefferson wrote: Is there a way to use a variable as the name of a table or column in plpgsql? This might be a simple question, but I can't find the answer in the docs. http://www.postgresql.org/docs/8.2/interactive/plpgsql- declarations.html hints that t

Re: [GENERAL] dynamic table/col names in plpgsql

2007-06-23 Thread Michael Glaesemann
On Jun 23, 2007, at 22:47 , gary jefferson wrote: Is there a way to use a variable as the name of a table or column in plpgsql? AIUI, you need to use EXECUTE and build the query string yourself. http://www.postgresql.org/docs/8.2/interactive/plpgsql- statements.html#PLPGSQL-STATEMENTS-EXEC

[GENERAL] dynamic table/col names in plpgsql

2007-06-23 Thread gary jefferson
Is there a way to use a variable as the name of a table or column in plpgsql? This might be a simple question, but I can't find the answer in the docs. http://www.postgresql.org/docs/8.2/interactive/plpgsql-declarations.html hints that there are data types that correspond to table/column, but I

Re: [GENERAL] Table Names

2007-06-23 Thread Michael Glaesemann
On Jun 23, 2007, at 21:29 , Naz Gassiep wrote: Is there a limit on the length of table names? NAMEDATALEN http://www.postgresql.org/docs/8.2/interactive/sql-syntax- lexical.html#SQL-SYNTAX-IDENTIFIERS Michael Glaesemann grzm seespotcode net ---(end of broadcast)

[GENERAL] Table Names

2007-06-23 Thread Naz Gassiep
Is there a limit on the length of table names? Thanks, - Naz. ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] 8.2 contrib. "Full Disjunction"

2007-06-23 Thread Gregory Stark
"Martijn van Oosterhout" <[EMAIL PROTECTED]> writes: > On Fri, Jun 22, 2007 at 07:38:01PM +0300, Tzahi Fadida wrote: >> Let me simplify it in lamer terms. >> Basically, you have a cycle in your relations schema. i.e. >> rel A: att-x, att-y >> rel B: att-y, att-z >> rel C: att-z, att-x >> >> The

Re: [GENERAL] 8.2 contrib. "Full Disjunction"

2007-06-23 Thread Martijn van Oosterhout
On Fri, Jun 22, 2007 at 07:38:01PM +0300, Tzahi Fadida wrote: > Let me simplify it in lamer terms. > Basically, you have a cycle in your relations schema. i.e. > rel A: att-x, att-y > rel B: att-y, att-z > rel C: att-z, att-x > > The only way to join these three without loosing a lot of informati

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Steve Atkins
On Jun 23, 2007, at 11:06 AM, Magnus Hagander wrote: I fully agree with the not part of the default installation. And make it easy to turn the thing off. In that respect it sound like a good feature for developer systems (not servers per se). Just ensure for a small memory footprint, pr

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Magnus Hagander
Joris Dobbelsteen wrote: >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of >> Magnus Hagander >> Sent: zaterdag 23 juni 2007 11:39 >> To: Naz Gassiep >> Cc: Tony Caduto; pgsql-general@postgresql.org >> Subject: Re: [GENERAL] Proposed Feature >> >>

Re: [GENERAL] minimum function

2007-06-23 Thread Tom Lane
Gunther Mayer <[EMAIL PROTECTED]> writes: > SELECT minimum(5,6) => 5 You're looking for the least/greatest functions (in 8.1 and up IIRC). regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] minimum function

2007-06-23 Thread PFC
Check out greatest() and least()... (I think ;) On Sat, 23 Jun 2007 18:35:36 +0200, Raymond O'Donnell <[EMAIL PROTECTED]> wrote: On 23/06/2007 17:17, Gunther Mayer wrote: Any way I can achieve that on one line? I.e. I want it simpler than IF arg1 < arg2 THEN RETURN arg1; ELSE

Re: [GENERAL] minimum function

2007-06-23 Thread Martijn van Oosterhout
On Sat, Jun 23, 2007 at 06:17:03PM +0200, Gunther Mayer wrote: > Hi there, > > I'm busy writing a trigger function in pl/pgsql and find myself in need > of a minimum() function. I can't see how the builtin min() aggregate > function can be of any use here since all I want to do is something like

Re: [GENERAL] minimum function

2007-06-23 Thread Raymond O'Donnell
On 23/06/2007 17:17, Gunther Mayer wrote: Any way I can achieve that on one line? I.e. I want it simpler than IF arg1 < arg2 THEN RETURN arg1; ELSE RETURN arg2; END IF; That looks pretty simple already, but why not enclose it in a pl/pgsql function - something like: create function m

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
On Sat, Jun 23, 2007 at 05:58:51PM +0200, cluster wrote: > >In any case, I think the answer to your original question is that the > >fan-out can be up to several hundred per level, but it's not fixed. > > OK, its beginning to make sense. So the fan-out is given by the key size > and each child no

[GENERAL] minimum function

2007-06-23 Thread Gunther Mayer
Hi there, I'm busy writing a trigger function in pl/pgsql and find myself in need of a minimum() function. I can't see how the builtin min() aggregate function can be of any use here since all I want to do is something like SELECT minimum(5,6) => 5 Any way I can achieve that on one line? I.e

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > On Fri, Jun 22, 2007 at 09:32:30PM +0200, cluster wrote: >> In B-trees all non-leaf nodes have a bunch of pointers to its child >> nodes. What is the size of such a pointer? > I imagine it's a page number, probably just a 32-bit integer. src/in

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread cluster
In any case, I think the answer to your original question is that the fan-out can be up to several hundred per level, but it's not fixed. OK, its beginning to make sense. So the fan-out is given by the key size and each child node is stored in its own page. Is that correct? Thanks in advance!

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
On Sat, Jun 23, 2007 at 04:11:52PM +0200, cluster wrote: > > >In postgres, everything is done in pages, so how ever many keys fit in > >a page. Bigs keys mean less. For integers you can fit an awful lot of > >keys. > OK, interesting. Does that mean, that when a node containing only small > values

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread cluster
In postgres, everything is done in pages, so how ever many keys fit in a page. Bigs keys mean less. For integers you can fit an awful lot of keys. OK, interesting. Does that mean, that when a node containing only small values (e.g. integers) is split, then it gets an awful lot of child node

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Joris Dobbelsteen
>-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of >Magnus Hagander >Sent: zaterdag 23 juni 2007 11:39 >To: Naz Gassiep >Cc: Tony Caduto; pgsql-general@postgresql.org >Subject: Re: [GENERAL] Proposed Feature > >Naz Gassiep wrote: >> Hey, >> I'm sure t

Re: [GENERAL] permission denied for schema

2007-06-23 Thread jef peeraer
Tom Lane schreef: jef peeraer <[EMAIL PROTECTED]> writes: Tom Lane schreef: That's a foreign-key check, which is supposed to be done as the owner of the table. You did not show us who owns table clienten, but I think that role must be missing the intended(?) membership in deterp_group. regi

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Naz Gassiep
Yo,     I'd have no problem with it being disabled by default. I ruthlessly pare my systray down and turn on the hide inactive icons function as well. But when I have PG running it is the sort of thing I'd want to be able to see at a glance, the same as with Apache. - Naz. Magnus Hagander wrot

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread Martijn van Oosterhout
On Fri, Jun 22, 2007 at 09:32:30PM +0200, cluster wrote: > What is the fan-out (number of child nodes) on each B-tree node in > postgresql? Is it dependent of the size of the keys being indexed? If > so: How? In postgres, everything is done in pages, so how ever many keys fit in a page. Bigs keys

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Raymond O'Donnell
On 23/06/2007 10:30, Magnus Hagander wrote: Does Delphi bring in any additional runtime requirements, though? I don't think we'd want to add a big extra runtime for such a small thing. Delhpi executables are completely self-contained - they don't need any extra runtime libraries or DLLs (unle

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Dave Page
> --- Original Message --- > From: Magnus Hagander <[EMAIL PROTECTED]> > To: Naz Gassiep <[EMAIL PROTECTED]> > Sent: 23/06/07, 10:39:01 > Subject: Re: [GENERAL] Proposed Feature > > Naz Gassiep wrote: > > Hey, > > I'm sure that'd be greatly appreciated, most other major servers and >

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Magnus Hagander
Naz Gassiep wrote: > Hey, > I'm sure that'd be greatly appreciated, most other major servers and > DBs have a similar feature, and that's what the systray is for, i.e., > viewing major user-installed services. Don't forget that the tray (or taskbar notification area as it's supposed to be call

Re: [GENERAL] Proposed Feature

2007-06-23 Thread Magnus Hagander
Tony Caduto wrote: > Bruce Momjian wrote: >> Naz Gassiep wrote: >> >>> I'm using PG on windows for the first time (as of about 6 minutes ago). >>> I was thinking that it would be great to have a system tray icon with a >>> running indicator, kind of like the way Apache2.x for windows has, or >>>

Re: [GENERAL] B-tree fan-out

2007-06-23 Thread cluster
I doubt this is in the documentation, but you can always read the source. I'd take a look around: > src/backend/access/nbtree/ Maybe its just me that is blind, but I couldn't find anything on this particular issue there. :-( Any other suggestions? ---(end of broadcas