Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Karel Zak
On Mon, Apr 19, 2004 at 08:41:18PM -0400, Bruce Momjian wrote: With initdb written now in C, we don't need a pg_encoding binary anymore. By the way, what change the name of initdb to pg_initdb. The current name is really too common (like some others things in pgsql/src/bin)

[HACKERS] Unable to create an array of a domain

2004-04-20 Thread Mark Gibson
Hi, I've recently been trying to make use of domains but have encountered some violations of the rule of least surprise. (PostgreSQL 7.4.2) I couldn't create an array of a domain, eg: CREATE DOMAIN mydomain AS integer; CREATE TABLE mytable ( stuff mydomain[] ); results in:

Re: [HACKERS] Unable to create an array of a domain

2004-04-20 Thread Rod Taylor
Is there any reason why a domain cannot use another domain as it's base type? It hasn't been written yet, but Tom has spent some time ensuring the system could be expanded to deal with this. And why isn't an array type created for a domain? (Is there a way to create an array for a domain

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Bruce Momjian
Karel Zak wrote: On Mon, Apr 19, 2004 at 08:41:18PM -0400, Bruce Momjian wrote: With initdb written now in C, we don't need a pg_encoding binary anymore. By the way, what change the name of initdb to pg_initdb. The current name is really too common (like some others

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Karel Zak
On Tue, Apr 20, 2004 at 08:59:20AM -0400, Bruce Momjian wrote: Karel Zak wrote: On Mon, Apr 19, 2004 at 08:41:18PM -0400, Bruce Momjian wrote: With initdb written now in C, we don't need a pg_encoding binary anymore. By the way, what change the name of initdb to pg_initdb.

[HACKERS] COPY CSV keywords

2004-04-20 Thread Bruce Momjian
[ discussion moved to hackers.] Peter Eisentraut wrote: Bruce Momjian wrote: I have applied the attached patch that complete TODO item: o -Allow dump/load of CSV format This adds new keywords to COPY and \copy: CSV - enable CSV mode QUOTE - specify quote

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Andrew Dunstan
Bruce Momjian wrote: Karel Zak wrote: On Mon, Apr 19, 2004 at 08:41:18PM -0400, Bruce Momjian wrote: With initdb written now in C, we don't need a pg_encoding binary anymore. By the way, what change the name of initdb to pg_initdb. The current name is really too common

[HACKERS] ERROR action extension for rules?

2004-04-20 Thread Fabien COELHO
Dear hackers, I'm trying to use some RULE as simple and maybe slower TRIGGER, so as to make it impossible for a row to be modified once a boolean is set to lock it. CREATE TABLE foo(data TEXT, locked BOOLEAN NOT NULL DEFAULT FALSE); This cannot be done with a CHECK constraint as it is not

Re: [HACKERS] Prepared select

2004-04-20 Thread Robert Turnbull
There are several production issues related to the proposed solution. For example, what happens when the result set exceeds the swap space of the server or client machine? My original question is how to get a cursor from a prepared select so a subset of the result can be returned to the client for

Re: [HACKERS] Why are these ARC variables per-backend?

2004-04-20 Thread Kenneth Marshall
On Mon, Apr 19, 2004 at 02:58:11PM -0400, Tom Lane wrote: Jan Wieck [EMAIL PROTECTED] writes: Tom Lane wrote: I've got a problem with these variables in freelist.c: static int strategy_cdb_found; static int strategy_cdb_replace; These two most definitely are per

Re: [HACKERS] Triggers on system tables

2004-04-20 Thread Bruce Momjian
Added to TODO: * Allow AFTER triggers on system tables --- Gavin Sherry wrote: On Thu, 12 Feb 2004, Tom Lane wrote: Gavin Sherry [EMAIL PROTECTED] writes: Do you have an example at hand of a system

Re: [HACKERS] COPY CSV keywords

2004-04-20 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: Bruce Momjian wrote: LITERAL - prevent NULL checks for specific columns NO NULL CHECK I considered going this direction, but it broke the WITH clause style of COPY. Huh? Many of the other options

Re: [HACKERS] COPY CSV keywords

2004-04-20 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Peter Eisentraut wrote: Bruce Momjian wrote: LITERAL - prevent NULL checks for specific columns NO NULL CHECK I considered going this direction, but it broke the WITH clause style of COPY. Huh? Many of the other options are already potentially two

Re: [HACKERS] ERROR action extension for rules?

2004-04-20 Thread Rod Taylor
CREATE RULE PasTouche AS ON UPDATE TO foo WHERE old.locked=TRUE DO INSTEAD ERROR; I think this simple new rule action could be added to pg. I'm planning to do it, if there is no opposition. Any comments on this proposed new rule action? Or did I missed something obvious

[HACKERS] pl/j looking for alpha testers

2004-04-20 Thread Dave Cramer
Hi, Pl/J is a java procedural language for postgres. We are looking for alpha testers to help us find bugs, and get feedback. The project can be found at http://plj.codehaus.org/ Bugs can be reported at http://jira.codehaus.org/secure/BrowseProject.jspa?id=10430 Regards, Dave -- Dave

Re: [HACKERS] [PATCHES] CSV patch applied

2004-04-20 Thread Bruce Momjian
Andrew Dunstan wrote: Bruce and I tossed this around quite a bit. The problem is that using QUOTE or NULL in these phrases might look confusing, e.g. COPY mytable TO 'mytable.csv' CSV QUOTE '' FORCE QUOTE field1,field2; COPY mytable FROM 'mytable.csv' NULL '' CSV NO NULL CHECK

[HACKERS] Probably security hole in postgresql-7.4.1

2004-04-20 Thread Ken Ashcraft
I work at Coverity where we use static analysis to find bugs in software. I ran a security checker over postgresql-7.4.1 and I think I found a security hole. I'm not familiar with the postgres source, so this report may be false. My interpretation of the code follows. I'd appreciate your

Re: [HACKERS] Prepared select

2004-04-20 Thread Cyril VELTER
libpq doesn't have enought support to allow executing a prepared statement in a named portal (current libpq only works wuth the unnamed portal). But the V3 protocol have it. I solved this problem by adding the following functions. They let you prepare a named statement, execute this statement in a

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Bruce Momjian
Andrew Dunstan wrote: past. I think createuser is much worse. :-) Agreed. Actually, the big problem with the name initdb is that the name is misleading, and newbies often get confused by it. You are preparing a data store for many databases, not a single database. But I think it

Re: [HACKERS] COPY CSV keywords

2004-04-20 Thread Andrew Dunstan
Bruce Momjian wrote: [ discussion moved to hackers.] Peter Eisentraut wrote: Bruce Momjian wrote: I have applied the attached patch that complete TODO item: o -Allow dump/load of CSV format This adds new keywords to COPY and \copy: CSV - enable CSV mode QUOTE -

[HACKERS] Multiple statements in one prepare

2004-04-20 Thread Robert Turnbull
How canmultiple SQL statements be included in one prepare command? The goal is toreduce chatter between the client and serverby submitting an atomictranasaction set.My interface is libpq.

Re: [HACKERS] user-defined default public acl

2004-04-20 Thread James Robinson
[ discussion re/ default state of minimal rights, as opposed to the more generous situation today snipped ] Just to add fuel to the fire, as an ex-college sys-admin having had to deploy both Oracle and postgres, I would have to say that Oracle allowed me to deploy a database container shared

[HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Bruce Momjian
I looked into this and I see a number of cases where pg_autovacuum calls send_query(), but doesn't test for a NULL return from the function. Matthew, would you look into this and submit a patch? Thanks. --- Jeff Boes

[HACKERS] Accessing RelOptInfo structure from the executor module

2004-04-20 Thread Shalu Gupta
Hello, I am trying to work with the Postgresql-7.3.4 and can you please help me with it. I have the following problem: I want to access the RelOptInfo data structure from the executor module. Basically I have added a flag to the RelOptInfo data structure and at the time of execution I

Re: [HACKERS] Multiple statements in one prepare

2004-04-20 Thread Tom Lane
Robert Turnbull [EMAIL PROTECTED] writes: How can multiple SQL statements be included in one prepare command? They can't. Consider using a plpgsql function, instead. regards, tom lane ---(end of broadcast)--- TIP 6: Have

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Andrew Dunstan
Joshua D. Drake wrote: g a data store for many databases, not a single database. But I think it is far too sanctified by history to change now, just as Ken Thompson now wishes he had put an 'e' on the end of 'creat' but can't go back and fix it. Maybe we should think about a symlink/hardlink

Re: [HACKERS] pg_autovacuum crashes when query fails for temp

2004-04-20 Thread Matthew T. O'Connor
Bruce Momjian wrote: Should pg_autovacuum be vacuuming temporary tables? This is a good question, and I would like some opinions from some other people more informed than I. Secondly, why would a temporary table for another session be visible to pg_autovacuum? I know these may sound like

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread Joshua D. Drake
g a data store for many databases, not a single database. But I think it is far too sanctified by history to change now, just as Ken Thompson now wishes he had put an 'e' on the end of 'creat' but can't go back and fix it. Maybe we should think about a symlink/hardlink to use a better name.

Re: [HACKERS] [Pgreplication-general] converting the DBMirror as peer-to-peer

2004-04-20 Thread Bruce Momjian
Where are we on this? Is it something that can be added to dbmirror as a patch? --- merino silva wrote: Hi all, The method I've used to convert DBMirror to a peer-to-peer replicator was two DBMirror instances with

Re: [HACKERS] pg_encoding not needed anymore

2004-04-20 Thread scott.marlowe
On Tue, 20 Apr 2004, Bruce Momjian wrote: Andrew Dunstan wrote: past. I think createuser is much worse. :-) Agreed. Actually, the big problem with the name initdb is that the name is misleading, and newbies often get confused by it. You are preparing a data store for many

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Thomas Swan
Bruce Momjian wrote: I looked into this and I see a number of cases where pg_autovacuum calls send_query(), but doesn't test for a NULL return from the function. Matthew, would you look into this and submit a patch? Thanks. Should pg_autovacuum be vacuuming temporary tables? Secondly, why

[HACKERS] Reporting a security hole

2004-04-20 Thread ken
I work at Coverity where we make a static analysis tool to find bugs in software at compile time. I think I found a security hole in postgresql-7.4.1, but I don't want to just report it to a public list. I sent email to [EMAIL PROTECTED], hoping that the address existed, but I got no response.

Re: [HACKERS] ERROR action extension for rules?

2004-04-20 Thread Tom Lane
Fabien COELHO [EMAIL PROTECTED] writes: I'm trying to use some RULE as simple and maybe slower TRIGGER, so as to make it impossible for a row to be modified once a boolean is set to lock it. ... However I thing that this would look much better to write simply: CREATE RULE PasTouche AS

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Bruce Momjian
Matthew T. O'Connor wrote: Yeah, I will, I just don't know when. I have been trying to get to this and lots of other pg_autovacuum tasks, but my schedule has been quite crazy as of late. Anyway, this should probably be a pretty simple patch, so I can probably find some time to look at it

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Matthew T. O'Connor
Yeah, I will, I just don't know when. I have been trying to get to this and lots of other pg_autovacuum tasks, but my schedule has been quite crazy as of late. Anyway, this should probably be a pretty simple patch, so I can probably find some time to look at it soon. Any idea on the 7.4.3

Re: [HACKERS] Reporting a security hole

2004-04-20 Thread Bruce Momjian
You can send it to [EMAIL PROTECTED], but I already saw your report on the hackers list. --- [EMAIL PROTECTED] wrote: I work at Coverity where we make a static analysis tool to find bugs in software at compile time. I

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Christopher Kings-Lynne
I looked into this and I see a number of cases where pg_autovacuum calls send_query(), but doesn't test for a NULL return from the function. Matthew, would you look into this and submit a patch? Thanks. Does pg_autovacuum vacuum and analyze system catalog and TOAST tables properly? Chris

[HACKERS] pgbench written in Pro*C

2004-04-20 Thread Bruce Momjian
I received a copy of pgbench rewritten in Pro*C, which is similar to embedded C. I think it was done so the same program could be tested on Oracle and PostgreSQL. Are folks interested in this code? Should it be put on gborg or in our /contrib/pgbench? -- Bruce Momjian

Re: [HACKERS] [PERFORM] pgbench written in Pro*C

2004-04-20 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: I received a copy of pgbench rewritten in Pro*C, which is similar to embedded C. I think it was done so the same program could be tested on Oracle and PostgreSQL. Are folks interested in this code? Should it be put on gborg or in our

Re: [HACKERS] pg_autovacuum crashes when query fails for temp

2004-04-20 Thread Tom Lane
Matthew T. O'Connor [EMAIL PROTECTED] writes: Bruce Momjian wrote: Should pg_autovacuum be vacuuming temporary tables? This is a good question, and I would like some opinions from some other people more informed than I. You *can not* vacuum other sessions' temp tables; you don't have access

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Matthew T. O'Connor
Christopher Kings-Lynne wrote: Does pg_autovacuum vacuum and analyze system catalog and TOAST tables properly? Properly? I think so, that is to the best of my knowledge which is a bit limited :-) Toast Tables: pg_autovacuum doesn't do anything to toast tables explicitly. I am not aware

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Matthew T. O'Connor
Bruce Momjian wrote: No, I have not heard of a 7.4.3 timeline, but we certainly want your eventual fixes in that release. Right, and along these lines there are a few other pg_autovacuum bugs that were fixed just after 7.4.2. ---(end of

Re: [HACKERS] pg_autovacuum crashes when query fails for temp

2004-04-20 Thread Matthew T. O'Connor
Tom Lane wrote: Matthew T. O'Connor [EMAIL PROTECTED] writes: This is a good question, and I would like some opinions from some other people more informed than I. You *can not* vacuum other sessions' temp tables; you don't have access to the data. (You have no way to get at pages that

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Christopher Kings-Lynne
No, I have not heard of a 7.4.3 timeline, but we certainly want your eventual fixes in that release. Right, and along these lines there are a few other pg_autovacuum bugs that were fixed just after 7.4.2. A rollable log solution would be nice :) Syslog? :) Chris ---(end

Re: [HACKERS] pg_autovacuum crashes when query fails for temp

2004-04-20 Thread Tom Lane
Matthew T. O'Connor [EMAIL PROTECTED] writes: Just to be sure, I can do this by avoiding anything found in the pg_temp schemea, or is there a better way? Is it possible that a user could or would put a non-temp table the pg_temp schemea? The pg_temp_NN schemas are the temp objects, by

[HACKERS] Duplicate variable declared?

2004-04-20 Thread mike g
Hello, In file postgresql-7.4.2/src/backend/utils/fmgrtab.c line 336 and line 337 are both equal to extern Datum array_push (PG_FUNCTION_ARGS); I have created a simple perl script that examines files line by line and if 2 in a row match prints a result. Sometimes it catches bad cvs checkins or

Re: [HACKERS] pg_autovacuum crashes when query fails for temp tables

2004-04-20 Thread Tom Lane
Matthew T. O'Connor [EMAIL PROTECTED] writes: System Tables: pg_autovacuum treats non-shared system tables just like any other table. It monitors the activity and vacuums when it deems it appropriate. As for shared system tables: In user databases they are only analyzed by pg_autovacuum,

Re: [HACKERS] pg_autovacuum crashes when query fails for temp

2004-04-20 Thread Christopher Kings-Lynne
Ok, so I will change pg_autovacuum to explicitly ignore temp tables. Just to be sure, I can do this by avoiding anything found in the pg_temp schemea, or is there a better way? Is it possible that a user could or would put a non-temp table the pg_temp schemea? There's no such thing as the

Re: [HACKERS] Duplicate variable declared?

2004-04-20 Thread Joe Conway
mike g wrote: In file postgresql-7.4.2/src/backend/utils/fmgrtab.c This is an automatically generated file. The reason for duplicate array_push declarations is that one-and-the-same array_push function is used to implement two SQL functions, array_append and array_prepend. I don't imagine the

Re: [HACKERS] [PERFORM] pgbench written in Pro*C

2004-04-20 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: I received a copy of pgbench rewritten in Pro*C, which is similar to embedded C. I think it was done so the same program could be tested on Oracle and PostgreSQL. Are folks interested in this code? Should it be put on gborg or in