[GENERAL] protect a database

2007-07-17 Thread Zlatko Matić
Hello. Is there any way to hide database structure (at least functions and triggers) from a superuser/administrator? Regards, Zlatko

Re: [GENERAL] AutoVacuum Behaviour Question

2007-07-17 Thread Alvaro Herrera
Bruce Momjian wrote: > > Is this item closed? No, it isn't. Please add a TODO item about it: * Prevent long-lived temp tables from causing frozen-Xid advancement starvation -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company - Command Prom

Re: [GENERAL] AutoVacuum Behaviour Question

2007-07-17 Thread Bruce Momjian
Is this item closed? --- Alvaro Herrera wrote: > Tom Lane wrote: > > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > > Tom Lane wrote: > > >> Yeah, we had better investigate some way to clean them up. It was never > > >> obv

Re: [GENERAL] createing indexes on large tables and int8

2007-07-17 Thread mljv
On Tuesday 17 July 2007 17:47:01 Tom Lane wrote: > [EMAIL PROTECTED] writes: > > i think i got it fixed as i saw that i pushed my maintenance_work_mem too > > high. It was higher than physical ram :-( > > Ooops, that will definitely cause problems. yes it did! I ran it again. And now it takes 10 m

Re: [GENERAL] int8 vs int4

2007-07-17 Thread mljv
On Tuesday 17 July 2007 17:52:11 you wrote: > [EMAIL PROTECTED] wrote: > > I use int8 types in most PK or FK columns in a pg 8.1 database. > > > > Would int4 instead of int8 speed up creation of an index? > > Almost certainly, but by how much will depend on your hardware and size > of index. > > >

Re: [GENERAL] PHP pg_connect

2007-07-17 Thread Matthew Terenzio
On Jul 17, 2007, at 3:13 AM, Vince wrote: When this fails, I get a useful error print: $dbconn = pg_connect($connection_str); Ouput: Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "postgres1" in ... How do

Re: [GENERAL] yet another image: db or filesystem ? question

2007-07-17 Thread PFC
a) if the images are in the filesystem (and also under the web root), no problem. Just use b) if the images are in the database... You use and setup URL rewriting in your webserver so that a HTTP request on "images/filename.jpg" becomes "serve_image?fname=filename.jpg" with serve_im

Re: [GENERAL] ERROR: a column definition list is required for functions returning "record"

2007-07-17 Thread Zlatko Matić
OK. Thanks. Regards, Zlatko - Original Message - From: "Pavel Stehule" <[EMAIL PROTECTED]> To: "Zlatko Matić" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, July 17, 2007 12:14 PM Subject: Re: [GENERAL] ERROR: a column definition list is required for functions returning "record" Hello y

Re: [GENERAL] int8 vs int4

2007-07-17 Thread Richard Huxton
[EMAIL PROTECTED] wrote: I use int8 types in most PK or FK columns in a pg 8.1 database. Would int4 instead of int8 speed up creation of an index? Almost certainly, but by how much will depend on your hardware and size of index. int4 will reduze the size of the table, of course. Would this

Re: [GENERAL] createing indexes on large tables and int8

2007-07-17 Thread Tom Lane
[EMAIL PROTECTED] writes: > i think i got it fixed as i saw that i pushed my maintenance_work_mem too > high. It was higher than physical ram :-( Ooops, that will definitely cause problems. regards, tom lane ---(end of broadcast)--

Re: [GENERAL] yet another image: db or filesystem ? question

2007-07-17 Thread Steve Atkins
On Jul 17, 2007, at 8:09 AM, Rick Schumeyer wrote: I've read the earlier threads on whether to store images in the database or filesystem. I think I understand the pros and cons of each method, but I have a question on a specific use case. Let's say I have a web app, and I want to display

[GENERAL] int8 vs int4

2007-07-17 Thread mljv
I use int8 types in most PK or FK columns in a pg 8.1 database. Would int4 instead of int8 speed up creation of an index? int4 will reduze the size of the table, of course. Would this reduce size of index, too? By the same amount? How much speed up will i gain on queries? Postgresql Doc menti

Re: [GENERAL] yet another image: db or filesystem ? question

2007-07-17 Thread Richard Huxton
Rick Schumeyer wrote: I've read the earlier threads on whether to store images in the database or filesystem. I think I understand the pros and cons of each method, but I have a question on a specific use case. Let's say I have a web app, and I want to display the images in a web page. a) if

Re: [GENERAL] createing indexes on large tables and int8

2007-07-17 Thread mljv
Am Montag, 16. Juli 2007 16:19 schrieben Sie: > Janning Vygen <[EMAIL PROTECTED]> writes: > > After this i create the index and it took 10 hours just for one index > > (primary key). I have 100.000.000 rows with one PK (int8), two integer > > data values, and two FK (int8) > > What PG version is th

[GENERAL] yet another image: db or filesystem ? question

2007-07-17 Thread Rick Schumeyer
I've read the earlier threads on whether to store images in the database or filesystem. I think I understand the pros and cons of each method, but I have a question on a specific use case. Let's say I have a web app, and I want to display the images in a web page. a) if the images are in the

Re: [GENERAL] Update of table lags execution of statement by >1 minute?

2007-07-17 Thread Tom Lane
"Erik Peterson" <[EMAIL PROTECTED]> writes: > I'm having this issue where once or twice per day (out of ~100,000 = > queries) > the table doesn't reflect a committed update immediately. Usually when = > this > problem occurs the update takes 1-3 minutes to be reflected in SELECT > queries. Occasi

[GENERAL] Sylph-Searcher 1.0.0 released

2007-07-17 Thread Tatsuo Ishii
Hi, We are pleased to announce that Sylph-Searcher 1.0.0 is released. Sylph-Searcher is a client program for searching mail boxes. Supported mail box format is MH style, i.e. 1 mail = 1 file. Sylph-Searcher uses tsearch2 for full text search, thus searching is very fast. For example, ~300,000 ma

Re: [GENERAL] average/stddev on all values returned by a select distinct

2007-07-17 Thread ann hedley
Michael Fuhr wrote: On Tue, Jul 17, 2007 at 01:51:21PM +0100, ann hedley wrote: What I want is the average and stddev of the set of lengths returned by this query. Something like... select average(select distinct on (id) length(consensus) from cluster order by id,length(consensus) desc);

Re: [GENERAL] Limitations on 7.0.3?

2007-07-17 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > I think tag_hash (in /backend/utils/hash/hashfn.c) is responsible for > internal hash-tables (rather than hash indexes). It takes a pointer to a > key to hash and a keysize (in bytes), so either the pointer is bad or > the size is too long and it's re

Re: [GENERAL] average/stddev on all values returned by a select distinct

2007-07-17 Thread Michael Fuhr
On Tue, Jul 17, 2007 at 01:51:21PM +0100, ann hedley wrote: > What I want is the average and stddev of the set of lengths returned by > this query. Something like... > > select average(select distinct on (id) length(consensus) from cluster > order by id,length(consensus) desc); I think this is

[GENERAL] average/stddev on all values returned by a select distinct

2007-07-17 Thread ann hedley
I have this query which returns the length of the longest consensus for each id. lumbribase=# select distinct on (id) length(consensus) from cluster order by id,length(consensus) desc; length 647 680 273 384 1285 What I want is the average and stddev of the set of leng

Re: [GENERAL] What's the logical counterpart of the to_hex function?

2007-07-17 Thread Michael Nolan
On 7/16/07, Steve Atkins <[EMAIL PROTECTED]> wrote: On Jul 16, 2007, at 11:36 AM, Michael Nolan wrote: > I have data (from an external source) which is in text format as a > hex number (it's actually an IP address, but that's probably not > relevant.) It likely is relevant, as it means it's a

Re: [GENERAL] Limitations on 7.0.3?

2007-07-17 Thread ARTEAGA Jose
I have spent the last month battling and looking deeper into the issue, here's a summary of were I'm at: - Increasing shared buffers improved performance but did not resolve the backend FATAL disconnect error. - Dumping and recreating entire database also did not resolve the issue. - re-initializ

[GENERAL] Update of table lags execution of statement by >1 minute?

2007-07-17 Thread Erik Peterson
Running 8.2.4 on Debian stable (Etch). I'm having this issue where once or twice per day (out of ~100,000 queries) the table doesn't reflect a committed update immediately. Usually when this problem occurs the update takes 1-3 minutes to be reflected in SELECT queries. Occasionally, it has taken

[GENERAL] Altering a plan

2007-07-17 Thread Shruthi A
Hi, I want to take a plan generated by the postgres optimizer and insert a constant in place of another constant in the plan. There is a function OidOutputFunctionCall() to get the constant. Similarly, is there any function to set the value of the constant? What does OidInputFunctionCall() do?

Re: [GENERAL] The speed problem of Varchar vs. Char

2007-07-17 Thread Tim Tassonis
Once upon a time, in the days of 80-column punch cards and no variable-length character encodings, there were databases that could handle fixed-width character fields a bit faster than variable-width. That doesn't apply to Postgres. There is no, none, nada performance advantage to char(n), and

Re: [GENERAL] interaction with postgres defined types in custom c functions

2007-07-17 Thread Gregory Stark
"Jason Nerothin" <[EMAIL PROTECTED]> writes: > PG_FUNCTION_INFO_V1(par); > Datum par(PG_FUNCTION_ARGS) // pete and repeat! takes text struct pointer > { > text *t = PG_GETARG_TEXT_P(0); > text *new_t = (text*) palloc(VARSIZE(t)); > VARATT_SIZEP(new_t) = VARSIZE(t); > memcpy((void*) VARDATA

Re: [GENERAL] ERROR: a column definition list is required for functions returning "record"

2007-07-17 Thread Pavel Stehule
Hello you have to specify column names and column types. Like postgres=# create or replace function foog() returns setof record as $$ declare r record; begin r := row(10,20); return next r ; return; end; $$ language plpgsql; postgres=# select * from foog() t(a int, b int); a | b + 10

[GENERAL] ERROR: a column definition list is required for functions returning "record"

2007-07-17 Thread Zlatko Matić
I have a plpgsql function that returns dataset. First it was defined to return SETOF someview. Then I changed it to return SETOF RECORD, in order to be able to return dataset with varying number of columns. But, I get the following error:"ERROR: a column definition list is required for functions

Re: [GENERAL] pg_dump without blobs

2007-07-17 Thread Nis Jørgensen
Joshua D. Drake skrev: > Vivek Khera wrote: >> >> On Jul 16, 2007, at 9:26 AM, Francisco Reyes wrote: >> >>> I guess the next question is 'what does postgresql considers a blob'? >>> bytea fields? How about a large text with megabytes worth of data? >> >> bytea and text fields are NOT blobs. they

Re: [GENERAL] PHP pg_connect

2007-07-17 Thread Hannes Dorbath
On 17.07.2007 09:45, Hannes Dorbath wrote: This is a PHP, not a PostgreSQL question. Well, pg_last_error() might not return something in that case. You can create a custom error handler if the message is important for you. -- Regards, Hannes Dorbath ---(end of broad

Re: [GENERAL] PHP pg_connect

2007-07-17 Thread Hannes Dorbath
On 17.07.2007 09:13, Vince wrote: When this fails, I get a useful error print: $dbconn = pg_connect($connection_str); Ouput: Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "postgres1" in ... How do I capture

[GENERAL] interaction with postgres defined types in custom c functions

2007-07-17 Thread Jason Nerothin
I'm experiencing much trouble making use of the V1 custom c function definition framework built into postgres, probably by virtue of my lack of experience with C. In a nutshell, I've paid close attention to the documentation, have had some success getting useful code out of the version 0 naming c

[GENERAL] PHP pg_connect

2007-07-17 Thread Vince
When this fails, I get a useful error print: $dbconn = pg_connect($connection_str); Ouput: Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "postgres1" in ... How do I capture this error and handle the printing

Re: [GENERAL] Limitations on 7.0.3?

2007-07-17 Thread Richard Huxton
ARTEAGA Jose wrote: I have spent the last month battling and looking deeper into the issue, here's a summary of were I'm at: - Increasing shared buffers improved performance but did not resolve the backend FATAL disconnect error. - Dumping and recreating entire database also did not resolve the