Re: [GENERAL] Extraordinarily slow!!

2005-09-24 Thread Peter Fein
to deduce the compile time options based on USE flags. Heck, you've even got full compile/install logs if you want them... Just saying. ;) -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman

Re: [GENERAL] Asychronous database replication

2005-09-16 Thread Peter Fein
version control, but I'm not entirely sure how one would use it in this case. See svk.elixus.org. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast

[GENERAL] Code Tables: varchar or serial pkey?

2005-09-13 Thread Peter Fein
reasons? I'm thinking about switching to using the varchar col as the pkey/fkey just to make my coding easier. How do people do this sort of thing? TIA. --Pete -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck

Re: [GENERAL] back references using regex

2005-09-08 Thread Peter Fein
is have a slice function like Python, where I can slice out items from a \s, \. or \n\n separated list. You could always just write it in pl/python... -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J

Re: [GENERAL] plpython function with dictionary as function argument?

2005-08-19 Thread Peter Fein
. Marshal is *very* fast. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ

[GENERAL] Timing out connections?

2005-08-18 Thread Peter Fein
been able to find an answer. The best we could come up with was tunneling over SSH and lowering sshd's timeout setting, but this seems less than ideal. TIA. --Pete -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck

Re: [GENERAL] Finding nearest numeric value

2005-08-17 Thread Peter Fein
), try: select *,(number_column - CONSTANT)^2 as d from tablename order by d limit 1; Save yourself some cycles - use abs() instead of exponentiation. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J

Re: [GENERAL] Finding nearest numeric value

2005-08-17 Thread Peter Fein
to handle two values in the application layer. Ahh, should that be = and = ? ;) -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast

Re: [GENERAL] No PUBLIC access by default?

2005-08-12 Thread Peter Fein
Tom Lane wrote: Peter Fein [EMAIL PROTECTED] writes: If I read my ACL's correctly, =UC/postgres means full access for PUBLIC. Why is that happening? Because that's the way it's set up in template1. CREATE DATABASE just copies the source database, it doesn't editorialize on the contents

Re: [GENERAL] No PUBLIC access by default?

2005-08-12 Thread Peter Fein
Martijn van Oosterhout wrote: On Fri, Aug 12, 2005 at 08:34:23AM -0500, Peter Fein wrote: Ok. ;) A little further investigation revealed that template0 gives the same result. It's potentially confusing that template0 is initialized this way - I couldn't find any indication

[GENERAL] No PUBLIC access by default?

2005-08-11 Thread Peter Fein
Hi all- Is there any way to disable PUBLIC access by default? When I create a new object (table, function, etc.), it has no ACL, as expected. However, the first time I run: GRANT ALL ON FUNCTION foo() to GROUP developers; Postgress seems to do: GRANT ALL ON FUNCTION foo() to PUBLIC; I assume

Re: [GENERAL] No PUBLIC access by default?

2005-08-11 Thread Peter Fein
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Actually, that last grant is implicit. When an ACL is found to be null, it's considered to have a grant to public. No, it's considered to be whatever the default for the object type is. Read the GRANT manual page. I'm obviously

Re: [GENERAL] Note on scalar subquery syntax

2005-08-03 Thread Peter Fein
Kevin Murphy wrote: I thought this might be helpful in the future to other duffers such as myself. The following is my big contribution to the documentation of the use of scalar subqueries ;-): You have to wrap a scalar subquery in its own parentheses even where you might think it to be

Schema Pivileges was Re: [GENERAL] Alter privileges for all tables

2005-08-01 Thread Peter Fein
on a schema sufficient to prevent users (or, say, group public) from accessing anything w/i that schema, or do I need to explicitly set rights on all of the objects w/i the schema? -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist

[GENERAL] Privileges needed by pg_autovacuum?

2005-07-23 Thread Peter Fein
set of privileges needed by pg_autovacuum? I've searched extensively can't find an answer. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast

Re: [GENERAL] Privileges needed by pg_autovacuum?

2005-07-23 Thread Peter Fein
Peter Fein wrote: I've password protected the 'postgres' account (to enable secure remote access) and I don't want to store the password on the local file system. I therefore want to create a separate account for use by pg_autovacuum (locked down in pg_hba.conf and perhaps with a password

[GENERAL] Return SETOF or array from pl/python

2005-07-15 Thread Peter Fein
- ['one', 'two', 'three'] (1 row) SELECT srf(); Never returns. I can obviously use something like arf2 (manually stringifying w/i python) but this seems ugly. I'd really prefer to return a set, rather than an array. -- Peter Fein [EMAIL PROTECTED] 773-575-0694

Re: [GENERAL] Return SETOF or array from pl/python

2005-07-15 Thread Peter Fein
Joshua D. Drake wrote: Peter Fein wrote: Is it possible to return a SETOF text or a text[] from pl/python? I've got the following test cases: CREATE OR REPLACE FUNCTION arf() RETURNS text[] LANGUAGE plpythonu AS $$return [one, two, three]$$; SELECT arf(); ERROR: missing dimension

Re: [GENERAL] Return SETOF or array from pl/python

2005-07-15 Thread Peter Fein
VALUES construct being unimplemented. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ

Re: [GENERAL] Return SETOF or array from pl/python

2005-07-15 Thread Peter Fein
. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire

Re: [GENERAL] Quotation marks in queries

2005-07-14 Thread Peter Fein
with quotes all over the place. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast)--- TIP 4: Have you searched our list archives

Re: [GENERAL] How to compare the schemas ?

2005-06-23 Thread Peter Fein
message can get through to the mailing list cleanly -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast)--- TIP 5: Have you

[GENERAL] Error column sys does not exist

2005-06-17 Thread Peter Fein
On logging in from PGAdmin over SSL, one of my fellow developers gets the following message: Error column sys does not exist He can see a list of databases, but no schemas. I'm not able to replicate the problem. TIA. --Pete -- Peter Fein [EMAIL PROTECTED] 773

Re: [GENERAL] Error column sys does not exist

2005-06-17 Thread Peter Fein
Peter Fein wrote: On logging in from PGAdmin over SSL, one of my fellow developers gets the following message: Error column sys does not exist He can see a list of databases, but no schemas. I'm not able to replicate the problem. TIA. Solved. From my coworker: I checked System objects

Re: [GENERAL] Hash Function: MD5 or other?

2005-06-14 Thread Peter Fein
Alex Stapleton wrote: On 13 Jun 2005, at 23:49, Peter Fein wrote: Hi- I wanted to use a partially unique index (dependent on a flag) on a TEXT column, but the index row size was too big for btrees. See the thread index row size 2728 exceeds btree maximum, 2713 from the beginning

[GENERAL] Hash Function: MD5 or other?

2005-06-13 Thread Peter Fein
? Figures on collision rates would be nice as well - the typical chunk of text is probably 1k-8k. Thanks! -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end

Re: [GENERAL] Version Control?

2005-06-11 Thread Peter Fein
Karsten Hilbert wrote: On Fri, Jun 10, 2005 at 10:38:52AM -0500, Peter Fein wrote: This is interesting... You'd want to be able to generate either a bunch of CREATEs to create a schema from scratch or a 'patch' of ALTER commands to move b/w arbitrary revisions or to a working copy (ie

Re: [GENERAL] Version Control?

2005-06-11 Thread Peter Fein
Peter Fein wrote: As an uninformed, off-the-wall idea, could one compare snapshots of the system tables to generate these diffs? I know next-to-nothing about these, but it seems like they'd contain the info you'd need. Here's another nutty idea: Could one create a (carefully designed) audit

Re: [GENERAL] Version Control?

2005-06-10 Thread Peter Fein
be able to route a few dollars their way... please contact me off list. -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're not a utopianist, you're a schmuck. -J. Feldman ---(end of broadcast)--- TIP 9

[GENERAL] Version Control?

2005-06-09 Thread Peter Fein
Hi- Any general tips on using version control (CVS, SVN) while doing database design? My thought was to do a text-mode dump (including populated code tables) from PGAdmin. How do people do this? -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically, if you're

[GENERAL] Test for array slice?

2005-06-03 Thread Peter Fein
Hi- I want to do something like this (pardon my pseudocode): A=ARRAY[4, 5, 6, 7, 8] B=ARRAY[5, 6] is_sliceof(A, B), i.e., there exists a slice of A that equals B. My best thought ATM is to convert both to strings and use pattern matching - any better ideas? --Pete

Re: [GENERAL] Test for array slice?

2005-06-03 Thread Peter Fein
Sean Davis wrote: On Jun 3, 2005, at 12:32 PM, Joe Conway wrote: Peter Fein wrote: I want to do something like this (pardon my pseudocode): A=ARRAY[4, 5, 6, 7, 8] B=ARRAY[5, 6] is_sliceof(A, B), i.e., there exists a slice of A that equals B. My best thought ATM is to convert both

[GENERAL] Preventing Multiple Inheritance

2005-06-03 Thread Peter Fein
was to add a column inherits_to to B with a value indicating whether that row is really a D1 or a D2 and enforce it with appropriate CHECK constraints on each of the derived tables. Sorry if this is unclear... -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically

Re: [GENERAL] JOIN on set of rows?

2005-05-11 Thread Peter Fein
On 05/11/05 08:22 AM CDT, Richard Huxton dev@archonet.com said: Peter Fein wrote: Hiya- I need to do something like this: SELECT t1.symbol AS app_name, t2.outside_key AS app_id FROM t2 LEFT JOIN t1 ON t1.t2_id=t2.id AS my_join LEFT JOIN rows of arbitrary (app_name, app_id

[GENERAL] JOIN on set of rows?

2005-05-10 Thread Peter Fein
from my app ;). I can't figure out how to create something that acts like a table with rows specified in the text of the query. A temporary table perhaps? I don't know much (anything) about these... Thanks! -- Peter Fein [EMAIL PROTECTED] 773-575-0694 Basically

Re: [GENERAL] JOIN on set of rows?

2005-05-10 Thread Peter Fein
On 05/10/05 06:17 PM CDT, Peter Fein [EMAIL PROTECTED] said: Hiya- I need to do something like this: SELECT t1.symbol AS app_name, t2.outside_key AS app_id FROM t2 LEFT JOIN t1 ON t1.t2_id=t2.id AS my_join LEFT JOIN rows of arbitrary (app_name, app_id) ON my_join.app_name=rows.app_name

[GENERAL] Function to return number of words in a string?

2005-05-09 Thread Peter Fein
Hiya- I'm looking for a function to return the number of words in a string, split on whitespace. I'm coming from python, so I may just write it in that but I wanted to check first. In python, one would write: s=some string or other len(s.split()) Thanks! -- Peter Fein [EMAIL

Re: [GENERAL] Function to return number of words in a string?

2005-05-09 Thread Peter Fein
On 05/09/05 11:21 AM CDT, Peter Fein [EMAIL PROTECTED] said: Hiya- I'm looking for a function to return the number of words in a string, split on whitespace. I'm coming from python, so I may just write it in that but I wanted to check first. In python, one would write: s=some string