Re: [GENERAL] Compile of Pgmail function fails

2006-02-12 Thread Tom Lane
indu ss <[EMAIL PROTECTED]> writes: > Still i get this error > ERROR: syntax error at or near "set" > CONTEXT: compile of PL/pgSQL function "pgmail" near > line 1 Somehow, I don't think you are passing this function to the pltcl PL... either you mistyped the language attribute, or you've manage

Re: [GENERAL] "out of shared memory error" with temp tables

2006-02-12 Thread Tom Lane
A Gattiker <[EMAIL PROTECTED]> writes: > I have procedures that create temporary tables every time. When those > procedures are called many times in a single transaction I get an "out > of shared memory error". This happens even if the temporary tables are > correctly dropped as shown in the exampl

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Peter Eisentraut
Ken Winter wrote: > have a harder row to hoe: They have to figure out whether a view > really IS updatable - most presumably aren't, so if they provide > forms that offer to update views, most of the time these forms are > going to crash. First of all, it isn't all that hard to figure out whether

Re: [GENERAL] Compile of Pgmail function fails

2006-02-12 Thread indu ss
I'm using the pgmail function bundled in pgMail-1.1.tar. Tried select pgmail('<[EMAIL PROTECTED]>','<[EMAIL PROTECTED]>','Test pgmail','Test message '); Still i get this error ERROR: syntax error at or near "set" CONTEXT: compile of PL/pgSQL function "pgmail" near line 1 I have specifie

[GENERAL] "out of shared memory error" with temp tables

2006-02-12 Thread A Gattiker
I have procedures that create temporary tables every time. When those procedures are called many times in a single transaction I get an "out of shared memory error". This happens even if the temporary tables are correctly dropped as shown in the example below. Does postgres retain a lock to a dropp

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Stephan Szabo
On Sun, 12 Feb 2006, Ken Winter wrote: > > -Original Message- > > From: Stephan Szabo [mailto:[EMAIL PROTECTED] > > Sent: Sunday, February 12, 2006 8:47 PM > > To: Ken Winter > > Cc: 'Tom Lane'; 'PostgreSQL pg-general List' > > Subject: Re: [GENERAL] Why does an ON SELECT rule have to be n

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Ken Winter
> -Original Message- > From: Stephan Szabo [mailto:[EMAIL PROTECTED] > Sent: Sunday, February 12, 2006 8:47 PM > To: Ken Winter > Cc: 'Tom Lane'; 'PostgreSQL pg-general List' > Subject: Re: [GENERAL] Why does an ON SELECT rule have to be named > "_RETURN"? > > On Sun, 12 Feb 2006, Ken Wi

Re: [GENERAL] dumb question

2006-02-12 Thread Michael Glaesemann
On Feb 13, 2006, at 11:47 , Craig White wrote: seems to be a lot of work just for this...the problem is trying to use rubyonrails and their 'migrations' which cause this... psql:db/development_structure.sql:211: ERROR: must be owner of schema public So how can I just 'munge' the system t

Re: [GENERAL] dumb question

2006-02-12 Thread Craig White
On Mon, 2006-02-13 at 11:39 +0900, Michael Glaesemann wrote: > On Feb 13, 2006, at 11:27 , Craig White wrote: > > > th-db_test=> ALTER SCHEMA public OWNER TO tobyhouse; > > ERROR: syntax error at or near "OWNER" at character 21 > > > > # rpm -q postgresql-server > > postgresql-server-7.4.8-1.RHEL

Re: [GENERAL] dumb question

2006-02-12 Thread Michael Glaesemann
On Feb 13, 2006, at 11:27 , Craig White wrote: th-db_test=> ALTER SCHEMA public OWNER TO tobyhouse; ERROR: syntax error at or near "OWNER" at character 21 # rpm -q postgresql-server postgresql-server-7.4.8-1.RHEL4.1 The docs I referred you to are for the current release. For earlier relea

Re: [GENERAL] dumb question

2006-02-12 Thread Craig White
On Mon, 2006-02-13 at 11:07 +0900, Michael Glaesemann wrote: > On Feb 13, 2006, at 10:29 , Craig White wrote: > > > How do I change the owner of a schema? > > > > ALTER SCHEMA "public" OWNER to "some_user"; #? > > http://www.postgresql.org/docs/current/interactive/sql-alterschema.html > > The

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Tony Caduto
Ken, Why don't you tell us why you need updateable views? What exactly are you trying to accomplish? (you may have already mentioned it,but I must have missed it :-) Why don't you create a set returning function and then have the client do the updating? i.e. have another function to update t

Re: [GENERAL] dumb question

2006-02-12 Thread Michael Glaesemann
On Feb 13, 2006, at 10:29 , Craig White wrote: How do I change the owner of a schema? ALTER SCHEMA "public" OWNER to "some_user"; #? http://www.postgresql.org/docs/current/interactive/sql-alterschema.html The docs explain this very situation. HTML documentation ships with the PostgreSQL

[GENERAL] dumb question

2006-02-12 Thread Craig White
How do I change the owner of a schema? ALTER SCHEMA "public" OWNER to "some_user"; #? Craig ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Stephan Szabo
On Sun, 12 Feb 2006, Ken Winter wrote: > Hi Tom ~ > > You're right: I appealed to the PostgreSQL folks rather than the client > tool builders. I did so because my guess is that the latter have a harder > row to hoe: They have to figure out whether a view really IS updatable - > most presumably

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Ken Winter
Hi Tom ~ You're right: I appealed to the PostgreSQL folks rather than the client tool builders. I did so because my guess is that the latter have a harder row to hoe: They have to figure out whether a view really IS updatable - most presumably aren't, so if they provide forms that offer to upda

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-12 Thread Chris
What happens if that query returns 5,000 rows? Postgres does actually have to fetch all of those rows, and then php has to allocate memory etc to store them. It's not very efficient. Silas Justiniano wrote: Thank you very much. But what do you think of: select foobar from table where ; if (

Re: [GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Tom Lane
"Ken Winter" <[EMAIL PROTECTED]> writes: > * Why this constraint? > * Would anything break if I were allowed to get away with my little trick? > * Is there any way to get around the constraint? The reason why the table is converted to a view is that ancient pg_dump dumps used to create views i

[GENERAL] Why does an ON SELECT rule have to be named "_RETURN"?

2006-02-12 Thread Ken Winter
I'm trying to build something that behaves like an updatable view but that PostgreSQL (version 7.4) regards and presents to the world as a table. The reason I want to do this odd thing is that my front-end tools (phpPgAdmin and PostgreSQL Lightning Admin) have handy pre-made data entry and viewi

Re: [GENERAL] Last modification time

2006-02-12 Thread Johan Vromans
Karsten Hilbert <[EMAIL PROTECTED]> writes: > However, given your above description why does it not > suffice to regenerate the report whenever the report > generator connects ? If you want to do so only when the > table has actually changed you might add a last_modified > timestamp column with a

Re: [GENERAL] Insert more than one t-uple in a single sql

2006-02-12 Thread Silas Justiniano
Thank you very much. But what do you think of: select foobar from table where ; if (pgsql_num_rows($result) > 15) show_pages; show_only_15($result); Thank you! ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Sequence skipping values

2006-02-12 Thread Jean-Christophe Roux
Micheal,Thanks a lot for you very clear explanation. To solve the problem, I have created another table so that the table does not use a rule to update itself. It works fine now.RegardsJCRMichael Fuhr <[EMAIL PROTECTED]> wrote: On Sat, Feb 11, 2006 at 06:06:21AM -0800, Jean-Christophe Roux wrote:>

Re: [GENERAL] Limiting with a left outer join

2006-02-12 Thread Bill Moseley
On Sat, Feb 11, 2006 at 12:35:34AM -0700, Michael Fuhr wrote: > On Fri, Feb 10, 2006 at 11:59:30AM -0800, Bill Moseley wrote: > > How do I make a join on the class table but not effect the left outer > > join? > > Are you looking for something like this? > > LEFT OUTER JOIN (class INNER JOIN clas

Re: [GENERAL] Last modification time

2006-02-12 Thread Karsten Hilbert
On Sat, Feb 11, 2006 at 09:26:57PM +0100, Johan Vromans wrote: > Doug McNaught <[EMAIL PROTECTED]> writes: > > Yeah, LISTEN/NOTIFY is definitely a lighter-weight solution--I didn't > > think of that before. > > LISTEN/NOTIFY looks like a synchronisation mechanism. You can notify a > subscriber th

Re: [GENERAL] Last modification time

2006-02-12 Thread Doug McNaught
Johan Vromans <[EMAIL PROTECTED]> writes: > Doug McNaught <[EMAIL PROTECTED]> writes: >> Yeah, LISTEN/NOTIFY is definitely a lighter-weight solution--I didn't >> think of that before. > > LISTEN/NOTIFY looks like a synchronisation mechanism. You can notify a > subscriber that something happened. B

Re: [GENERAL] Each foo must have a bar

2006-02-12 Thread Michael Glaesemann
I haven't seen this hit the lists yet, though I sent it nearly 12 hours ago. Resending for completeness. On Feb 12, 2006, at 6:59 , Michael Fuhr wrote: On Sat, Feb 11, 2006 at 12:56:36PM -0800, David Fetter wrote: I'm trying to figure out how to enforce the following. Table foo has a prima

Re: [GENERAL] Seeking comments on schema design and data integrity

2006-02-12 Thread Joe Conway
Tim Hart wrote: I am by no means a DBA, but I'm developing a database app for our local little league. I would appreciate some comments regarding the following design. It is probably overkill, but you might want to take a look at XTOSS (XML Team Open Sports Schema): http://www.xtoss.