Re: [GENERAL] A function which returns all rolname from pg_roles.

2006-07-10 Thread Joe Conway
IN SELECT rolname FROM pg_roles LOOP RETURN NEXT rec.rolname; END LOOP; END; $$ LANGUAGE plpgsql; And simpler as an SQL function (although, again, why bother?): CREATE OR REPLACE FUNCTION test_sql() RETURNS SETOF name AS $$ SELECT rolname FROM pg_roles $$ LANGUAGE sql;

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Joe Conway
ibpq believes that the *other end* of the connection was terminated unexpectedly, but considering it was an Oracle instance that it was communicating with, I'm not sure what it could/should do better. In any case, the Oracle side of this connection is what "closed unexpectedly".

Re: [GENERAL] Problem creating a function

2006-07-19 Thread Joe Conway
access to /home/database/pgdata/cobis/bitvg? Try: su postgres cd /home/database/pgdata/cobis/bitvg Joe ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column&#

Re: [GENERAL] Problem creating a function

2006-07-19 Thread Joe Conway
Cornelia Boenigk wrote: Hi Joe > Try: > su postgres > cd /home/database/pgdata/cobis/bitvg Succeeds, ls -la shows all files in that directory and can open them with less. Kind of odd, particularly given your reply to Tom's question in a nearby post. Could it be an

Re: [GENERAL] Best Procedural Language?

2006-08-01 Thread Joe Conway
tions. I think only plpgsql does right now. Actually no. Plperl, plphp, plruby and I believe even pl/Tcl support set returning functions. and so does PL/R ;-) Joe ---(end of broadcast)--- TIP 3: Have you checked our extensiv

Re: [GENERAL] Well, Pervasive is now out....

2006-08-03 Thread Joe Audette
ant to pay for support for a free product. Joe joe_audette [at] yahoo dotcom http://www.joeaudette.com http://www.mojoportal.com - Original Message From: Nikolay Samokhvalov <[EMAIL PROTECTED]> To: pgsql-general@postgresql.org Sent: Thursday, August 3, 2006 2:58:03 PM Subje

[GENERAL] restoring a backup, incompatible with server

2006-08-08 Thread Joe Lester
I'm having a little trouble restoring a backup (from the production server to our development server). I recently updated both production and development servers to postgres 8.1.4 from 8.0.x. When I updated production, I did a fresh initdb and imported from a previous dump. This server is r

Re: [GENERAL] restoring a backup, incompatible with server

2006-08-08 Thread Joe Lester
Hi,Development is Mac OS 10.4.0 (PPC). Production is Mac OS 10.4.7 (Intel). Is that the kicker... PPC vs Intel?On Aug 8, 2006, at 1:46 PM, Talha Khan wrote:Hey Joe!! Which OS are you running on development server and  production server?? regards Talha Khan On 8/8/06, Joe Lester <[EMAIL PROTEC

Re: [GENERAL] pl/R problem

2006-08-23 Thread Joe Conway
ack from a business trip, and am trying to get caught up -- give me a few days and I'll see if I can help (i.e. I should be able to find time on the weekend)... Joe ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore

Re: [GENERAL] pl/R problem

2006-08-23 Thread Joe Conway
se, which will probably be sometime after postgres 8.2 beta starts. Joe ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your messag

[GENERAL] Large database design advice

2006-08-24 Thread Joe Kramer
Hello, I am designing database for a web product with large number of data records. - Few tables but number of objects is tens-hundreds of thousands. - less than 100 queries per second. The application has basically tens thousands of (user) accounts, every account has associated hundreds of it

Re: [GENERAL] [ADMIN] CMS - portal server Question

2006-08-25 Thread Joe Audette
PHP and Java are not the only options. My project, mojoPortal, is written in C# and runs under .NET on windows or Mono on nix It works with PostgreSQL or MySQL (or MS SQL or SQLite) Worth a look: http://www.mojoportal.com joe_audette [at] yahoo dotcom http://www.joeaudette.com http://

Re: [GENERAL] Dblink and connections to MySQL?

2006-08-30 Thread Joe Conway
on gborg or pgfoundry. Joe ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Determining what a user can access

2003-12-10 Thread Joe Conway
.objname); res.privs := priv; RETURN NEXT res; end if; end loop; for rec in select lanname as objname from pg_language loop priv := ''''; sep := ''''; if has_language_privilege(v_user, quote_ident(rec.objname), ''USAGE'') then priv := priv || sep || ''USAGE''; sep := '',''; end if; if priv != '''' then res.objtype := ''language''; res.objname := quote_ident(rec.objname); res.privs := priv; RETURN NEXT res; end if; end loop; for rec in select nspname as objname from pg_namespace loop priv := ''''; sep := ''''; if has_schema_privilege(v_user, quote_ident(rec.objname), ''CREATE'') then priv := priv || sep || ''CREATE''; sep := '',''; end if; if has_schema_privilege(v_user, quote_ident(rec.objname), ''USAGE'') then priv := priv || sep || ''USAGE''; sep := '',''; end if; if priv != '''' then res.objtype := ''schema''; res.objname := quote_ident(rec.objname); res.privs := priv; RETURN NEXT res; end if; end loop; return; end; ' language plpgsql; HTH, Joe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] Strange permission problem regarding pg_settings

2003-12-10 Thread Joe Conway
etails. Can you post a self-contained example that recreates the problem? Joe ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [GENERAL] Strange permission problem regarding pg_settings

2003-12-10 Thread Joe Conway
enerate any UPDATE query. Do you want me to take a look at this, or are you planning to? Joe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] functions returning sets

2003-12-17 Thread Joe Conway
Tom Lane wrote: Joe Conway <[EMAIL PROTECTED]> writes: Any guidance on the preferred fix? We cannot fix this by changing ExecScanSubPlan as you suggest. That would amount to saying that all plans have to be run to completion, which destroys LIMIT to name just one unpleasant conseque

Re: [GENERAL] functions returning sets

2003-12-18 Thread Joe Conway
. OK -- this one is a good bit simpler. Any more comments? Joe Index: src/backend/utils/fmgr/funcapi.c === RCS file: /opt/src/cvs/pgsql-server/src/backend/utils/fmgr/funcapi.c,v retrieving revision 1.12 diff -c -r1.12 funcapi.c

Re: [GENERAL] Strange permission problem regarding pg_settings

2003-12-26 Thread Joe Conway
e relname like 'table%'; oid | relname -+- 1245674 | table1 1245676 | table2 (2 rows) It seems that second pass through ExecCheckRTEPerms() is not doing the right thing. It ought to be checking table2 (not table1) for UPDATE as userid == 1 (not 101), shouldn

Re: [GENERAL] Hierarchical queries

2004-01-10 Thread Joe Conway
[EMAIL PROTECTED] wrote: RH> I could have sworn there was something in contrib/ too, but I can't see it RH> now. Yes it is gone. :) See contrib/tablefunc for a function called connectby(). Joe ---(end of broadcast)--- TIP 5: Have you

Re: [GENERAL] Support for functions returning mutliple result sets?

2004-01-22 Thread Joe Conway
[EMAIL PROTECTED] wrote: I know I can write plpgsql functions that return sets. Does postgres support returning multiple sets from a function? No. Joe ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] Predictive or scoring solution for PostgreSQL ?

2004-02-04 Thread Joe Conway
here for a variety of packages to do just about any kind of analysis you can think of: http://cran.r-project.org/ Some assembly required, but powerful and free. HTH, Joe ---(end of broadcast)--- TIP 7: don't forget to increase your free

Re: [GENERAL] dblink: rollback transaction

2004-02-05 Thread Joe Conway
nning). If the local transaction fails, send an ABORT to the remote side before closing the connection. However I can't offhand think of a way to do that in an automated fashion. Joe ---(end of broadcast)--- TIP 3: if posting/reading through Usen

Re: [GENERAL] dblink: rollback transaction

2004-02-05 Thread Joe Conway
Oleg Lebedev wrote: Agreed. I wonder if I should simulate local Xactions by using local dblink calls? What do you think, Joe? It is an interesting thought. Withing a single plpgsql function, open one local and one remote persistent, named dblink connection. Start a transaction in each. Go into

Re: [GENERAL] dblink - custom datatypes don't work

2004-02-05 Thread Joe Conway
s that would be unique enough to be sure same named types were actually the same. Joe ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Casting 'record' to a composite type.

2004-02-06 Thread Joe Conway
like this in the docs. Is there currently any way of doing this? are there any plans for it? There is no way to do this now, and no plans that I know of, but it does look useful. I'm not sure how painful it would be to make it happen though... Joe ---(e

Re: [GENERAL] how can I select into an array?

2004-02-06 Thread Joe Conway
= anyarray, initcond = '{}' ); array_append() is built-in in 7.4 -- and note both Pavel's solution and this one require 7.4.x HTH, Joe ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] how can I select into an array?

2004-02-06 Thread Joe Conway
.4 if arrays are important to you. Joe ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [GENERAL] connectby for BYTEA keys

2004-02-08 Thread Joe Conway
2 | row\134row\002row\005 row\011 | row\005 | 3 | row\134row\002row\005row\011 row\003 | row\\| 1 | row\134row\003 row\007 | row\003 | 2 | row\134row\003row\007 (9 rows) HTH, Joe Index: contrib/tablefunc/tablefunc.c ==

Re: [GENERAL] Increasing Max Connections Mac OS 10.3

2004-02-09 Thread Joe Lester
Joe Lester <[EMAIL PROTECTED]> writes: I installed Postgres 7.4.1 on a dual processor G5 running Mac OS 10.3.2. I'm trying to increase the max_connections to 300 and running into some trouble. Hmm, it WorksForMe (TM). You did reboot after changing /etc/rc, no? Yes, I did a "Restar

Re: [GENERAL] Increasing Max Connections Mac OS 10.3

2004-02-09 Thread Joe Lester
Joe Lester <[EMAIL PROTECTED]> writes: That's odd. It's giving me a -1 for the shmmax value. I assume that's NOT normal. Why would that be? It's not --- you should get back the same value you set. I speculate that you tried to set a value that exceeded some internal

Re: [GENERAL] Increasing Max Connections Mac OS 10.3

2004-02-10 Thread Joe Lester
Would this be kern.maxfiles? There's also one called kern.maxfilesperproc. Is it OK to set these before starting the server? Or should I set them in /etc/rc? On Feb 10, 2004, at 10:04 AM, Tom Lane wrote: Also look at increasing the kernel's limit on number of open files (I remember seeing it i

[GENERAL] Using NOTIFY... Slow Client Querys

2004-02-13 Thread Joe Lester
I'm using PostgreSQL 7.4.1. I have 140 clients connected on average using libpq. When one client sends "NOTIFY timeclock;" to the server all 140 clients are listening for it. After receiving a notification from libpq (PQnotifies), each client proceeds to execute a query for the last five record

Re: [GENERAL] How to determine current database?

2004-02-13 Thread Joe Conway
Ron St-Pierre wrote: I am using postgres 7.3.4 and need to be able to determine which database a query is being run in (from a script). pg_database lists databases but doesn't tell me which one is currently active. See: http://www.postgresql.org/docs/7.3/static/functions-misc.html HTH,

[GENERAL] Index storage question...

2004-02-14 Thread Joe Maldonado
Hello all, I am in the process of planning disk utilization for postgres and was wondering what was the storage size was for btree, rtree and hash indexes. Thanks, -Joe -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ ---(end of broa

Re: [GENERAL] Using NOTIFY... Slow Client Querys

2004-02-17 Thread Joe Lester
Yes, my client receives the notification and then it immediately executes a query that hangs for a while. On Feb 15, 2004, at 12:07 PM, Tom Lane wrote: Hmm. Are you certain that the clients have received the NOTIFY? Perhaps the bottleneck is in delivering the NOTIFY messages, not in executing th

Re: [GENERAL] Using NOTIFY... Slow Client Querys

2004-02-17 Thread Joe Lester
Thanks. I was kind of suspecting that. But it's nice to have it confirmed. I might try a random delay on the client side after receiving the notification, before I query. That may help to break up the load on the server. On Feb 16, 2004, at 10:27 AM, Mikhail Terekhov wrote: I'd say it is relat

Re: [GENERAL] Rows to columns

2004-02-24 Thread Joe Conway
300029002300 Any idea or suggestion? See contrib/tablefunc for a function called crosstab(). HTH, Joe ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHer

Re: [GENERAL] select statement against pg_stats returns inconsistent

2004-02-24 Thread Joe Conway
rray", and this type really needs to be marked as requiring double alignment so that arrays of double-aligned datatypes will come out correctly. anyarray has been defined this way since 7.3 -- any concerns there? I see that back then pg_statistic used text[] instead of anyarray, so pe

Re: [GENERAL] key = currval('tab_key_seq') choses SEQSCAN?!

2004-02-25 Thread Joe Conway
eq; CREATE SEQUENCE regression=# select nextval('seq'), currval('seq'), s from generate_series(1,4) as t(s); nextval | currval | s -+-+--- 1 | 1 | 1 2 | 2 | 2 3 | 3 | 3 4 | 4 | 4 (4 rows) Joe --

Re: [GENERAL] key = currval('tab_key_seq') choses SEQSCAN?!

2004-02-25 Thread Joe Conway
ATILE_VOLATILE'v' /* can change even within a scan */ OT: generate_series looks useful. Is this only in 7.5? Yes, new in 7.5. Joe ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[GENERAL] postmaster out of memory....

2004-02-28 Thread Joe Maldonado
;[SQL] How to avoid "Out of memory" using aggregate functions? ". Is this fixed? Why is the postmaster exceeding it's 102MB sort mem size when doing these queries and not paging out the data? -Joe Maldonado -- Using M2, Opera's revolutionary e-mail c

Re: [GENERAL] creating sequential timestamp

2004-03-08 Thread Joe Conway
ts 2004-03-08 00:00:00-08 2004-03-08 03:00:00-08 2004-03-08 06:00:00-08 2004-03-08 09:00:00-08 2004-03-08 12:00:00-08 2004-03-08 15:00:00-08 2004-03-08 18:00:00-08 2004-03-08 21:00:00-08 2004-03-09 00:00:00-08 (9 rows) HTH, Joe ---(end of

Re: [GENERAL] Q: How do I return differnt rows depending on values

2004-03-19 Thread Joe Conway
x27;'tigris'' then Second, you'll need to add a "return;" line after the "END IF" for the cases where there is no match. In fact, you can just move the one from within the IF...END IF to outside it. HTH, Joe ---(end of broadcast)-

Re: [GENERAL] Storing jpgs

2004-04-06 Thread Joe Lester
Would anyone have some example code they could share using libpq to encode an image into a text field? Right now, I'm converting my image into a hexadecimal string representation in my SQL statement. I'm sure there must be a better (faster) way. The hex encodeing/decoding slows things down for

Re: [GENERAL] concat strings but spaces

2004-04-06 Thread Joe Conway
varchar, varchar) returns varchar as ' select replace($1 || '' '' || $2 || '' '' || $3, '' '', '' '') ' language sql; regression=# select fconcat_name('John','','Doe'); fconc

Re: [GENERAL] Cursors and Transactions, why?

2004-04-06 Thread Joe Conway
Eric Ridge wrote: On Apr 6, 2004, at 11:54 AM, Jan Wieck wrote: And now you know why they are so good if you don't use all rows. This benefit I think goes away if you use Joe Conway's suggestion of WITH HOLD. Okay, so WITH HOLD is actually materializing the entire resultset (sequenti

[GENERAL] Optimal configuration to eliminate "out of file descriptors" error

2004-04-14 Thread Joe Lester
I'm trying to figure out what the optimal Postgres configuration would be for my server (with 200 connecting clients, even though I'd really like to get it up to 500). I've got a 700 MHz eMac running Mac OS 10.3.2 (Panther) with 512 MB of RAM. I've messed around with some settings but I'm still ge

Re: [GENERAL] Optimal configuration to eliminate "out of file descriptors" error

2004-04-16 Thread Joe Lester
Yeah. It was my shell that was the bottleneck. What did the trick was adding this line in /etc/profile: ulimit -n 8000 Thanks! Bruno Wolff III <[EMAIL PROTECTED]> writes: It sounds like what is really happening is that you are hitting an OS limit on the number of open files. You should be able

Re: [GENERAL] [OT] Tom's/Marc's spam filters?

2004-04-20 Thread Joe Conway
Marc G. Fournier wrote: do you force learn those spam that get through the cracks? I get about 20 or 30 messages that slip through the cracks, which I process through with sa-learn nightly ... No, I haven't been doing that, but I guess I ought to start. Thanks for the suggestion!

Re: [GENERAL] Connection reset by peer

2004-04-21 Thread Joe Lester
That makes sense since the "connection reset by peer" statement is always followed immediately by "unexpected EOF on client connection" I should have noticed that before :-0 Thanks! On Apr 20, 2004, at 10:04 PM, Doug McNaught wrote: Joe Lester <[EMAIL PROTECTED]>

Re: [GENERAL] [OT] Tom's/Marc's spam filters?

2004-04-21 Thread Joe Conway
urly cron job as follows: /usr/bin/sa-learn --mbox --spam /path/to/false-neg.mbox Now I just drop all false negatives into that mailbox, and clean them out periodically. Hopefully that will make a significant improvement. Joe ---(end of broadcast)-

Re: [GENERAL] Storing a file hash as primary key

2004-05-07 Thread Joe Conway
::DB to store binary data in a bytea column, by all means. Did you try using pg_escape_bytea()? Joe ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere"

Re: [GENERAL] C Functions, datatypes

2004-05-07 Thread Joe Conway
scalar return datums pg_conversion.c:get_generic_array_datum() conversion from multiple (char *values) to Datum using the gathered info for array return datums HTH, Joe ---(end of broadcast)--- TIP 6: Have you searched our list archives

Re: [GENERAL] Dblink question

2004-05-20 Thread Joe Conway
n" and show us the output of make make install make installcheck Joe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] Can you help me with this query?

2004-06-14 Thread Joe Conway
rule_and_refint_t3 | rule_and_refint_t2 | {id3a,id3c} | {id2a,id2c} fktable| pktable| {fk}| {id} clstr_tst | clstr_tst_s | {b} | {rf_a} (4 rows) HTH, Joe ---(end of broadcast)--- TI

Re: [GENERAL] Can you help me with this query?

2004-06-15 Thread Joe Conway
(please keep posts on the list so that others can follow along) [EMAIL PROTECTED] wrote: Joe, I'm sorry but I cannot create functions or anything like that, it's all has to be a select statement (or series of select statements). Users pull up our product and browse all the databases an

Re: [pgadmin-support] [GENERAL] Building pgadmin on Fedora core 2

2004-06-23 Thread Joe Conway
Adam H. Pendleton wrote: Joe Conway wrote: | Scot L. Harris wrote: |> Running Fedora Core 2 trying to build pgadmin3 from source. |> |> Build wxWindows from sources. Appeared to build and install no problem. |> |> But when building pgadmin get the following error as it tries to bu

Re: [GENERAL] minimum operators for b-tree, r-tree

2004-06-29 Thread Joe Conway
src/include/utils: builtins.h Log message: Add comparison operators and btree indexing support for type bytea. From Joe Conway. You could go through cvs web to find the actual diffs, given the date

Re: [GENERAL] Rounding in PGSQL

2004-08-07 Thread Joe Conway
), ballpark(11825.5540); ballpark | ballpark | ballpark | ballpark --+--+--+-- 15.6 | 1826 | 7130 |11830 (1 row) HTH, Joe ---(end of broadcast)--- TIP 8: explain analyze is your friend

[GENERAL] RFC: array literal syntax

2004-08-07 Thread Joe Conway
ainst calling this a bug? Now's the time to speak up, particularly if you depend on this as a feature. Thanks, Joe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] PgSQL 8.0.0 - contributed: problem compiling

2004-08-15 Thread Joe Conway
y the diff to your local copy of beta1: http://developer.postgresql.org/cvsweb.cgi/pgsql-server/contrib/dbsize/dbsize.c.diff?r1=1.10;r2=1.11 HTH, Joe ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index sc

Re: [GENERAL] shared_buffers Question

2004-08-17 Thread Joe Lester
Thanks for the suggestion Scott. I did a... find / -type f -size +10 -print The results contained 9 Gig! of swap files: /private/var/vm/swapfile0 /private/var/vm/swapfile1 /private/var/vm/swapfile10 [plus many more entries] That seems to indicate to me a memory "leak" of some sort. My s

Re: [GENERAL] Postgres filling up hard drive with swap files

2004-08-20 Thread Joe Lester
On Aug 20, 2004, at 2:28 PM, Tom Lane wrote: I think what you've found is an OS X bug. I was able to replicate this behavior on OS X 10.3.5. All I did was start the postmaster and then start a continuous loop in a shell window: while true do psql -c "select count(*) from tenk1" regression do

Re: [GENERAL] Postgres filling up hard drive with swap files

2004-08-20 Thread Joe Lester
On Aug 20, 2004, at 2:43 PM, Tom Lane wrote: Bill Moran <[EMAIL PROTECTED]> writes: Joe Lester <[EMAIL PROTECTED]> wrote: I'm wondering, however, if you have a connection leak instead. i.e. is it possible that your client application is opening a whole bunch of connections and n

Re: [GENERAL] Postgres filling up hard drive with swap files

2004-08-20 Thread Joe Lester
On Aug 20, 2004, at 3:01 PM, Bill Moran wrote: Please don't wrap machine-generated output ... it makes it VERY difficult to understand. This is usually caused by a setting in your mail client that reads something like "wrap lines at 72 characters" being turned on. You should wrap your text at 72 c

Re: [GENERAL] Is it possible...

2004-08-24 Thread Joe Conway
pointers will be appreciated. You can do what you want with set returning functions in contrib/tablefunc. See examples towards the end of my recent OSCON presentation: http://www.joeconway.com/pres_oscon_2004-r1.pdf and the source sql: http://www.joeconway.com/flex.sql HTH, Joe

Re: [GENERAL] Substring RegExp Extract path

2004-08-25 Thread Joe Conway
rt| index | time.jsp (1 row) See: http://www.postgresql.org/docs/current/static/functions-string.html On Postgres 8.0.0beta1 you could also do: select s.f[2], s.f[3], s.f[4] from (select string_to_array('/help/support/index/time.jsp','/') as f) as s; f |f

Re: R: R: [GENERAL] space taken by a row & compressed data

2004-08-27 Thread Joe Conway
Greg Stark wrote: How do you check to see how many records, or ideally which records, are being toasted and/or stored externally? I don't know of a builtin way to do that from SQL, but the attached seems to work for me. Joe checktoast.tar.gz Description: GNU Zip compressed

Re: R: R: [GENERAL] space taken by a row & compressed data

2004-08-27 Thread Joe Conway
Joe Conway wrote: Greg Stark wrote: How do you check to see how many records, or ideally which records, are being toasted and/or stored externally? I don't know of a builtin way to do that from SQL, but the attached seems to work for me. FWIW, this version has a bit more robust type che

[GENERAL] sequences in schemas

2004-08-31 Thread Joe Maldonado
Hello, How come within a create schema block I cannot create a sequence? I have entered in: CREATE SCHEMA joe CREATE SEQUENCE joe_seq start 1 CREATE TABLE joe_table (int id, varchar name) ; and I get a syntax error for SEQUENCE. though if it is just tables I do not -Joe

Re: [GENERAL] Large Databases

2004-08-31 Thread Joe Conway
0% in transactions per second. Very interesting. Whose SAN are you using that supports the 2.6 kernel? Thanks, Joe ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] how to query the size of an array in a table

2004-09-05 Thread Joe Conway
s/7.3/interactive/arrays.html Array support and documentation is significantly better in 7.4.x. Joe ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Returning Errors from User Defined C-functions

2004-09-15 Thread Joe Conway
Otto Blomqvist wrote: I have several functions that are compiled as .so and runs pretty well under PSQL. However I would like to be able to return errors (for debugging) using something like this See: http://www.postgresql.org/docs/current/static/error-message-reporting.html Joe

Re: [HACKERS] [GENERAL] Networking feature for postgresql...

2004-10-16 Thread Joe Conway
Katsaros Kwn/nos wrote: > Having taken a look at the dblink code I have some questions: ISTM that you might start with dblink_record() and modify it to suit using SPI and asynchronous libpq calls. See: http://www.postgresql.org/docs/current/static/libpq-async.html

[GENERAL] Undefined symbols: _poll

2004-09-30 Thread Joe Lester
anyone? My guess is that _poll is referenced somewhere in libpq.a. Anyone have any ideas on how to get the linking happening on Mac OS 10.3.5? Thanks! Joe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.post

Re: [GENERAL] trigger: NEW/OLD-error or nothing happens

2001-07-07 Thread Joe Conway
resql.org/idocs/index.php?plpgsql-trigger.html NEW Data type RECORD; variable holding the new database row on INSERT/UPDATE operations on ROW level triggers. OLD Data type RECORD; variable holding the old database row on UPDATE/DELETE operations on ROW level triggers. Hope this helps, Joe

Re: [GENERAL] Storing images in PG?

2001-08-16 Thread Joe Conway
27;) FROM imagetable WHERE ... And then convert from hex back to bin: function hex2bin($data) { $data = trim($data); $len = strlen($data); return pack("H" . $len, $data); } If PHP could open a binary cursor (which I don't think it can, but could be wrong)

Re: [GENERAL] Finding the number of rows affected by UPDATE or INSERT?

2001-08-29 Thread Joe Conway
cessed by the last SQL query sent down to the SQL engine; and RESULT_OID, the Oid of the last row inserted by the most recent SQL query. Note that RESULT_OID is only useful after an INSERT query. HTH, -- Joe ---(end of broadcast)--- TIP 3: if posti

Re: [GENERAL] query not using index

2001-09-03 Thread Joe Conway
id from history where event_type = 120::int8; See http://fts.postgresql.org/db/mw/msg.html?mid=1031765 for some further explanation/history. HTH, -- Joe ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command

Re: [GENERAL] SHOW

2001-09-03 Thread Joe Conway
tables. > > OK. That works for ./bin/psql, but NOT on the libpq's PQexec. > What do I have to type here? > > Thanx again and lots of greetings from cool Spain > Steve Start up psql with the -E on the command line. Then do \d TABLE. This will show you the actual SQL command

Re: [GENERAL] Primary keys and speed

2001-09-09 Thread Joe Conway
ware (dual ppro 200 with 512MB and RAID5) I got lookups times at around 10 milliseconds, from a table with 20 million records. The key was a 40 byte hex string. The timing was from running "set show_query_stats = true;" and then looking at the tail of the postgres serv

Re: [GENERAL] Query

2001-09-13 Thread Joe Conway
xecute the same query not using SELECT TOP ? > See the LIMIT clause: http://www.postgresql.org/idocs/index.php?sql-select.html Hope this helps, -- Joe ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [GENERAL] Numerical DB/Table Names

2001-09-14 Thread Joe Conway
README in contrib/oid2name for more information. I haven't used it myself, but the oid2name contib should let you more easily associate the OID names with the database object names. Hope this helps, -- Joe ---(end of broadcast)--- TIP 5:

Re: [GENERAL] Many Pl/PgSQL parameters -> AllocSetAlloc(128)?

2003-06-23 Thread Joe Conway
t sure of the best way to fix this yet, but I found that when calling the function with argument types matching the prototype perfectly, this code never gets executed. HTH, Joe p.s. here's a backtrace: #0 AllocSetAlloc (context=0x830a624, size=128) at aset.c:731 #1 0x081bcb14 in MemoryCont

Re: [GENERAL] Many Pl/PgSQL parameters -> AllocSetAlloc(128)?

2003-06-24 Thread Joe Conway
Joe Conway wrote: I get nanswers = 16777216, so right off the bat 67MB or so is allocated. Then there's this: /* compute the cross product from right to left */ for (;;) { oneres = (Oid *) palloc0(FUNC_MAX_ARGS * sizeof(Oid)); I'm guessing this gets executed nans

Re: [GENERAL] capturing and storing query statement with rules

2003-06-24 Thread Joe Conway
res the query statement so that I can place it in a insert query? Is there a variable in the server that holds the query statement as a string? I think this shows how to do what you want: http://archives.postgresql.org/pgsql-sql/2003-05/msg00301.php HTH, Joe ---(end

Re: [GENERAL] ERROR: language "c" is not trusted

2003-07-01 Thread Joe Conway
nt to allow non-superusers to execute C language functions, or create their own? The latter is a huge, gaping security hole, which is why the language is marked "untrusted". Joe ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] Performance question

2003-07-02 Thread Joe Conway
gresql.org with links from the home page? Joe ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] select null + 0 question

2003-07-13 Thread Joe Conway
more null values are eliminated, then a completion condition is raised: warning — null value eliminated in set function." I've never seen a database that emits the required warning, though. Joe ---(end of broadcast)--- TIP 5: Have

Re: [GENERAL] selects during vacuum

2003-07-15 Thread Joe Maldonado
Sorry forgot to mention we are running postgres 7.2.3. -Joe On Tue, 2003-07-15 at 16:15, scott.marlowe wrote: > On 15 Jul 2003, Joe Maldonado wrote: > > > Hello, > > Vacuum analyze is taking a really long time on a fairly small table and > > during the time the vacuu

Re: [GENERAL] dump_all/restore times?

2003-07-16 Thread Joe Conway
nk it took about 24 hours. Based on that experience, I'd say your 18 hours on a 133 Mhz machine is not bad. The exact same data, later loaded onto a dual 1.4GHz pentium III server took about an hour. HTH, Joe ---(end of broadcast)--- TI

Re: [GENERAL] selects during vacuum

2003-07-16 Thread Joe Maldonado
. Total CPU 0.00s/0.00u sec elapsed 0.00 sec. NOTICE: Analyzing We dropped the table and recreated it and things have seemed to be working right for now though I have an accelerated simulation of the conditions running on another db to see if we can reproduce... -Joe On Tue, 2003-07-15 at 16:35

Re: [GENERAL] Detoasting and memory usage

2003-07-19 Thread Joe Conway
* this, but we currently require that support functions for indexes * not leak memory. */ #define PG_FREE_IF_COPY(ptr,n) \ do { \ if ((Pointer) (ptr) != PG_GETARG_POINTER(n)) \ pfree(ptr); \ } while (0) Maybe you can use that or do something simi

Re: [GENERAL] Is there a way to pass more than 32 parameters to a

2003-07-19 Thread Joe Conway
ents using arrays is much easier. HTH, Joe ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] substring implementation (long string)

2003-07-30 Thread Joe Conway
key constraints on this table. You probably could do something like: UPDATE mytable SET somefield = somefield; Joe ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] hexadecimal to decimal

2003-07-30 Thread Joe Conway
get a few moments. Joe ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] hexadecimal to decimal

2003-07-30 Thread Joe Conway
Tom Lane wrote: Joe Conway <[EMAIL PROTECTED]> writes: I tried that after I posted, but only saw roughly 30% improvement (which is consistent with my earlier tests IIRC). Not bad, but this still left plperl initial call at ~40 msec versus plpgsql at ~4 msec. Hm. And the first call to a p

Re: [GENERAL] hexadecimal to decimal

2003-07-30 Thread Joe Conway
, I guess. Might as well make one in plpgsql too --- even if it does nothing today, it might be useful in the future, so the documentation ought to recommend "call 'plxxx_init' when preloading plxxx" as a general thing. OK -- I'll put a patch together. Thanks, Joe --

Re: [GENERAL] plPHP -- sort of an announcement.. but not commercial

2003-08-04 Thread Joe Conway
e PHP embed API instead of the PHP CLI (command line interface) 10.Fix license Joe ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

<    1   2   3   4   5   6   >