Re: [GENERAL] Re: Updating views

2001-06-04 Thread Tom Lane
Rasmus Resen Amossen <[EMAIL PROTECTED]> writes: > OK, but I can't see how to make a single rule that allows me to update > an arbitray set of attributes from an arbitray where-clause. The reason the system doesn't do that for you is that it's *hard* to figure out what to do for an arbitrary wher

[GENERAL] Function RETURNS SETOF ???

2001-06-04 Thread Thalis A. Kalfigopoulos
Helloppl, I have a long query that (summerized) looks something like: SELECT A.a,B.b FROM A,B WHERE A.x=B.x AND (A.y=const1 OR A.y=const2 OR A.y=const3); where the user provides const1,2,3 at runtime. The problem is in creating a function out of it: CREATE FUNCTION myfunc(int4,int4,int4) RETUR

Re: [GENERAL] Re: Updating views

2001-06-04 Thread Stephan Szabo
On Tue, 5 Jun 2001, Rasmus Resen Amossen wrote: > > Problem is not 'where'. Views in Postgresql doesn't allows you insert, > > update or delete unless you define especila rules that explain Postgresql > > what to do in each case. > > Look Postgresql programming manual. You can see a few exam

[GENERAL] Re: Updating views

2001-06-04 Thread Rasmus Resen Amossen
> Problem is not 'where'. Views in Postgresql doesn't allows you insert, > update or delete unless you define especila rules that explain Postgresql > what to do in each case. > Look Postgresql programming manual. You can see a few examples of rules in > views. OK, but I can't see how to mak

Re: [GENERAL] subselects in check clauses

2001-06-04 Thread Stephan Szabo
On Mon, 4 Jun 2001, Rasmus Resen Amossen wrote: > I have a need to check if a certain condition holds for all rows that > matches a given criteria. But postgresql appearently doesn't support > subselects in check clauses. Here is an example: > > CREATE TABLE example (a int, b date, c date > CONS

Re: [GENERAL] Updating views

2001-06-04 Thread DaVinci
On Mon, Jun 04, 2001 at 11:12:56PM +0200, Rasmus Resen Amossen wrote: > If I add a "where" clause on my views, I can't insert or update them > anymore. Why? > > Example: > CREATE TABLE temp (a int); > CREATE VIEW tview AS SELECT a FROM temp WHERE a>10; > > INSERT INTO tview VALUES (13); > ERROR:

[GENERAL] Updating views

2001-06-04 Thread Rasmus Resen Amossen
If I add a "where" clause on my views, I can't insert or update them anymore. Why? Example: CREATE TABLE temp (a int); CREATE VIEW tview AS SELECT a FROM temp WHERE a>10; INSERT INTO tview VALUES (13); ERROR: Cannot update a view without an appropriate rule What is the appropriate rule? -- R

Re: [GENERAL] libpq and PostgreSQL NOTICEs

2001-06-04 Thread Tim Barnard
The 'client' side. Thanks, I'll give it a try. Tim - Original Message - From: "Tom Lane" <[EMAIL PROTECTED]> To: "Tim Barnard" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, June 04, 2001 1:40 PM Subject: Re: [GENERAL] libpq and PostgreSQL NOTICEs > "Tim Barnard" <[EMAIL

[GENERAL] subselects in check clauses

2001-06-04 Thread Rasmus Resen Amossen
I have a need to check if a certain condition holds for all rows that matches a given criteria. But postgresql appearently doesn't support subselects in check clauses. Here is an example: CREATE TABLE example (a int, b date, c date CONSTRAINT csname CHECK (1 >= ALL (SELECT count(*)

Re: [GENERAL] libpq and PostgreSQL NOTICEs

2001-06-04 Thread Tom Lane
"Tim Barnard" <[EMAIL PROTECTED]> writes: > Is there any way to force Postgre not to send NOTICEs to the console? Define "console" --- you mean the client's stderr? Or the postmaster's? Changing libpq's notice processor (see PQsetNoticeProcessor) would help if you want to filter notices on the

Re: [GENERAL] template1, can there be a template2/3/4?

2001-06-04 Thread Tom Lane
Jim Mercer <[EMAIL PROTECTED]> writes: > theoretically, if i nuked everything from SharedSystemRelationNames, then > each database would be wholly stand-alone, and the remaining code should just > work? Hmm. I do not know what would happen if pg_database were made database-local, but I doubt it

Re: [GENERAL] template1, can there be a template2/3/4?

2001-06-04 Thread Jim Mercer
On Mon, Jun 04, 2001 at 02:16:35PM -0400, Tom Lane wrote: > I wrote: > > Jim Mercer <[EMAIL PROTECTED]> writes: > >> where are these relations? is this a compile-time thing, or can it be done > >> on-the-fly? > > > Compile-time; see SharedSystemRelationNames in > > backend/utils/init/globals.c.

Re: [GENERAL] template1, can there be a template2/3/4?

2001-06-04 Thread Tom Lane
Jim Mercer <[EMAIL PROTECTED]> writes: > where are these relations? is this a compile-time thing, or can it be done > on-the-fly? Compile-time; see SharedSystemRelationNames in backend/utils/init/globals.c. You'd have to do an initdb after changing it, anyway. regards,

Re: [GENERAL] libpq and PostgreSQL NOTICEs

2001-06-04 Thread Tim Barnard
Hmm, well it is, or appears to be. Here's how postmaster starts: su - cvms -c "(/usr/local/pgsql/bin/postmaster -D/progs/db -B 256 2>&1 | logger -p local5.notice) &" > /dev/null 2>&1 & Problem is, NOTICE's still goes to the console. Any other ideas? This is really driving me bonkers!?!

[GENERAL] libpq and PostgreSQL NOTICEs

2001-06-04 Thread Tim Barnard
Is there any way to force Postgre not to send NOTICEs to the console? I have an ncurses app that from time to time gets notices stating that "begin is already a transaction in progress." Now I know I need to track down where I'm issuing a "begin" twice, but I would rather Postgre log these w

Re: [GENERAL] 7.1.2 packaging

2001-06-04 Thread Trond Eivind Glomsrød
Lamar Owen <[EMAIL PROTECTED]> writes: > On Monday 04 June 2001 10:56, Trond Eivind Glomsrød wrote: > > Lamar Owen <[EMAIL PROTECTED]> writes: > > > On Sunday 03 June 2001 13:05, Trond Eivind Glomsrød wrote: > > > > "Tim Mickol" <[EMAIL PROTECTED]> writes: > > > > > any word on 7.1.2 in RPM or SR

Re: [GENERAL] 7.1.2 packaging

2001-06-04 Thread Trond Eivind Glomsrød
Lamar Owen <[EMAIL PROTECTED]> writes: > On Sunday 03 June 2001 13:05, Trond Eivind Glomsrød wrote: > > "Tim Mickol" <[EMAIL PROTECTED]> writes: > > > any word on 7.1.2 in RPM or SRPM form? > > > An SRPM can be found at http://people.redhat.com/teg/pg/ > > NOTE: > While Trond's SRPM is very goo

Re: [GENERAL] PostgreSQL security concerns

2001-06-04 Thread Tom Lane
Francesco Casadei <[EMAIL PROTECTED]> writes: > # TYPE DATABASEIP_ADDRESSMASK AUTHTYPE MAP > localtemplate0trust > localtemplate1trust > localfunland

[GENERAL] Alternate database locations

2001-06-04 Thread Tauren Mills
I've sent this to both pgsql-general and pgsql-admin. Please advise which is the proper list for this type of question. I'm new to PostgreSQL and am trying to implement it in a shared web application hosting environment. Ideally, I'd like each customer to have their databases stored within thei

[GENERAL] Limiting simultaneous connections

2001-06-04 Thread Tauren Mills
Is there a way to limit the number of simultaneous connections that any given username can make to the database? For instance, I'd like user1 to be able to have no more than 5 simultaneous connections to the database server, but user2 can have 15 simultaneous connections. Also, can these connect