Re: [GENERAL] Lost rows/data corruption?

2005-02-17 Thread Michael Fuhr
Is whatever problem that prompted this procedure being investigated so a permanent fix can be applied? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Checking of constraints via subqueries?

2005-02-17 Thread Michael Fuhr
d in simple tests; I don't know if it'll work in the general case. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Killing process through of a function

2005-02-17 Thread Michael Fuhr
rocess before execute this, to avoid the lock wait. Why does the Java program stay idle while it's in a transaction? Are you able to fix the application? If it's not doing anything then it should probably COMMIT or ROLLBACK its transactions to release any locks they hold

Re: [GENERAL] Checking of constraints via subqueries?

2005-02-17 Thread Michael Fuhr
On Thu, Feb 17, 2005 at 07:31:42PM +0100, Martijn van Oosterhout wrote: > On Thu, Feb 17, 2005 at 11:03:58AM -0700, Michael Fuhr wrote: > > > > In experiments I've defined a domain's CHECK expression to call a > > function that makes queries. It worked in simple t

Re: [GENERAL] change user password

2005-02-17 Thread Michael Fuhr
; anywhere. See the documentation for ALTER USER. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Killing process through of a function

2005-02-18 Thread Michael Fuhr
, that sends a signal to a client's backend process, but I think there's concern about how robust that is, which is why it hasn't become a standard function. See the following message and the messages it references: http://archives.postgresql.org/pgsql-general/2005-02/msg00426.php

Re: [GENERAL] Function name variable within a non-trigger function

2005-11-25 Thread Michael Fuhr
ere a similar set of special variables defined for "normal", i.e., > non-trigger functions, too? I'm not aware of a way for a non-trigger PL/pgSQL function to find out its name or oid. Functions written in C can do it. -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] GRANT question

2005-11-26 Thread Michael Fuhr
hat does "SELECT current_database();" show for each user? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] GRANT question

2005-11-26 Thread Michael Fuhr
e AS n ON n.oid = p.pronamespace WHERE p.proname ILIKE '%eden%'; -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: FW: [GENERAL] GRANT question

2005-11-26 Thread Michael Fuhr
ly need to grant at least USAGE on the public schema to certain users. That would imply that somebody has changed the default permissions on public, either in this database or in the template datbase from which it was created (template1 by default). -- Michael Fuhr ---(en

Re: FW: [GENERAL] GRANT question

2005-11-27 Thread Michael Fuhr
proc_usesysid('probauser'); > edenproc_usesysid > --- >118 > (1 row) Did you try these commands as the ordinary user? The above is evidence that it works for a superuser, which it did already according to your previous posts. -- Michael Fuhr

Re: [GENERAL] errors with 8.1 make on Solaris

2005-11-29 Thread Michael Fuhr
mbol in file isinf /var/tmp//cckdOuCS.o ld: fatal: Symbol referencing errors. No output written to conftest collect2: ld returned 1 exit status configure:14241: $? = 1 configure: failed program was: [...] configure:

Re: [GENERAL] errors with 8.1 make on Solaris

2005-11-29 Thread Michael Fuhr
x is /usr/local/lib/gcc/sparc-sun-solaris2.9. -- Michael Fuhr ---(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's datatypes do not match

Re: [GENERAL] strange behaviour in plpgsql:null arguments

2005-11-29 Thread Michael Fuhr
ql.org/pgsql-sql/2005-09/msg00137.php > I also find it quite difficult to unset an element from array in postgres. Consider starting a new thread with a subject relevant to that particular problem. An example showing what you mean by "unset an element" might make the problem easier

Re: [GENERAL] selecting a attribute from a function

2005-11-29 Thread Michael Fuhr
T (test_func()).col1; col1 -- 123 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] undefined behaviour for sub-transactions?

2005-11-30 Thread Michael Fuhr
are you referring to something else? -- Michael Fuhr ---(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's datatypes do not match

Re: [GENERAL] undefined behaviour for sub-transactions?

2005-12-01 Thread Michael Fuhr
ot; at character 1 LINE 1: roeiuqrepuqw; ^ test=> insert into foo values (123); INSERT 0 1 test=> commit; COMMIT test=> select * from foo; x - 123 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] 8.03 versus 8.04

2005-12-03 Thread Michael Fuhr
not like a new point release represents new development. BTW, the developers are talking about making new point releases next week, so you might want to consider 8.0.5 when it comes out. If you have a test environment then consider looking at the 8.1 branch. For certain queries yo

Re: [GENERAL] swap relations to be able to execute a left join

2005-12-09 Thread Michael Fuhr
_id) -> WHERE -> AR.revision_id = RTT.revision_id -> AND RTT.type_id = AT.type_id -> AND AR.revision_id = 28403; Empty set (0.00 sec) This leaves me wondering what the test case really was or if MySQL behaves differently under diffe

Re: [GENERAL] swap relations to be able to execute a left join

2005-12-09 Thread Michael Fuhr
On Fri, Dec 09, 2005 at 02:17:59PM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > Hmm...I get errors in MySQL 5.0.16 with the query as posted so I > > have to wonder what the real query was. > > (tries it...) After removing the bogus comma,

Re: [GENERAL] random delays

2005-12-09 Thread Michael Fuhr
u have stats_command_string enabled then you might be able to query pg_stat_activity and identify the query that holds the lock. Do you see any pattern to the slow queries? Do they always happen around a certain time of day, or during or shortly after a certain kind of activity (e.g

Re: [GENERAL] Update and bytea problem...

2005-12-09 Thread Michael Fuhr
nvolved. What language are you using and how are you escaping the bytea data? Could you post a code snippet so we can see exactly what you're doing? -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ig

Re: [GENERAL] Looking for information on PostgreSQL Stored Procedures

2005-12-10 Thread Michael Fuhr
I'd recommend trying it first on a test table or in a transaction that you can roll back in case it doesn't do what you want. See the SELECT documentation for a description of the non-standard DISTINCT ON clause that the above query uses: http://www.postgresql.org/docs/8.1/interactiv

Re: [GENERAL] TSearch2: Auto identify document language?

2005-12-11 Thread Michael Fuhr
-- but it might get better with more text to examine, and you can tell Lingua::Identify which languages to consider or ignore. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] [GENERAL] Looking for information on PostgreSQL Stored Procedures

2005-12-11 Thread Michael Fuhr
N testfunc() RETURNS void AS $$ DECLARE row record; BEGIN FOR row IN SELECT * FROM tablename ORDER BY whatever LOOP -- do stuff that refers to row.column_name END LOOP; RETURN; END; $$ LANGUAGE plpgsql; -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] timestamp <-> ctime conversion question...

2005-12-13 Thread Michael Fuhr
tz --- 2005-12-13 17:20:54.109306+00 (1 row) test=> SELECT settz('UTC', now())::timestamptz; settz --- 2005-12-13 10:20:54.109306-07 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] timestamp <-> ctime conversion question...

2005-12-13 Thread Michael Fuhr
On Tue, Dec 13, 2005 at 08:21:20PM +0100, Karsten Hilbert wrote: > On Tue, Dec 13, 2005 at 10:28:42AM -0700, Michael Fuhr wrote: > > As far as I know there isn't a way to defeat this. However, the > > developers' TODO file does have the following item: > > > &g

Re: [GENERAL] is this a bug or I am blind?

2005-12-16 Thread Michael Fuhr
ed or not, but did the following issue from a year ago ever get resolved? We were wondering then if the Hungarian locale on some platforms might be causing problems. http://archives.postgresql.org/pgsql-bugs/2004-12/msg00206.php http://archives.postgresql.org/pgsql-bugs/2004-12/msg00228.php --

Re: [GENERAL] Fetch statements

2005-12-16 Thread Michael Fuhr
TCH>LOG: duration: > 1855.818 ms statement: fetch 1 in cur65c Do your logs contain the DECLARE statement for the cur65c cursor? If not, are you logging all statements or only those that last longer than a certain amount of time (log_min_duration_statement)? -- Michael Fuhr ---

Re: [GENERAL] PL/pgSQL Function Help

2005-12-16 Thread Michael Fuhr
e_attribute (value=2231056, typeId=2230496, typeMod=2230376) at tuptoaster.c:830 -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Transacciones Anidadas

2005-12-16 Thread Michael Fuhr
guess you're using a client that has autocommit disabled. After you committed the first three inserts another transaction was started automatically, and that's what was rolled back. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Fetch statements

2005-12-16 Thread Michael Fuhr
the only way in my case is logging all statements... Am I > right? Or is there another way? Check the logging documentation to be sure, but I think you'll have to log all statements. -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] Views

2005-12-17 Thread Michael Fuhr
monitor' or devices.type_ = 'valve') and devices.fluid_id = process.fluid_id; -- Michael Fuhr ---(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's datatypes do not match

Re: [GENERAL] Views

2005-12-18 Thread Michael Fuhr
Expressions" in the "SQL Syntax" chapter of the documentation: http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-PRECEDENCE http://www.postgresql.org/docs/8.1/interactive/sql-expressions.html -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] sequence rollback?

2005-12-18 Thread Michael Fuhr
aqs.FAQ.html#item4.11.4 http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your join

Re: [GENERAL] One DB not backed up by pg_dumpall

2005-12-18 Thread Michael Fuhr
at I see other DBs were restored ok (At least > the ones I have checked so far). What are the exact commands you're using to dump and restore? Have you examined the output and the server's logs for errors and warnings? -- Michael Fuhr ---(end of broadca

Re: [GENERAL] Select list of table names for particular DB

2005-12-18 Thread Michael Fuhr
the "Data Definition" chapter). Databases aren't shown in pg_class. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] contrib extenstions

2005-12-21 Thread Michael Fuhr
rectory has one or more README files. If you've installed the contrib extensions via a pre-built package, then hopefully that package installed the README files somewhere. Check the package's file list to see if it did and where. -- Michael Fuhr ---

Re: [GENERAL] Sorting array field

2005-12-22 Thread Michael Fuhr
TRICT; SELECT data, sort(data) FROM foo; data | sort ---+--- {dd,cc,bb,aa} | {aa,bb,cc,dd} {zz,"xx yy",cc,aa,bb} | {aa,bb,cc,"xx yy",zz} (2 rows) I'm not sure if there are easier ways; these are what first came to

Re: [GENERAL] query for a time interval

2005-12-22 Thread Michael Fuhr
e to compare start_date against without hitting each row to find that row's time_to_live. But something like this should be able to use an expression index on (start_date + time_to_live): WHERE start_date + time_to_live < now() -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Problem creating stored procedure

2005-12-27 Thread Michael Fuhr
anual (around page 600), my > procedure ought to be fine, but clearly Postgres doesn't like it. What section of the manual are you looking at, and for what version of PostgreSQL (many of us use the online documentation so page numbers don't mean anything)? Are you mixing Oracle syntax wit

Re: [GENERAL] FW: deleted records

2005-12-28 Thread Michael Fuhr
| 368640 tuple_count| 5043 tuple_len | 161376 tuple_percent | 43.78 dead_tuple_count | 4957 dead_tuple_len | 158624 dead_tuple_percent | 43.03 free_space | 7736 free_percent | 2.1 -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] Validating User

2005-12-28 Thread Michael Fuhr
= 'userid' AND passwd = 'md5' || md5('passwd' || usename); > All I am after is to validate a user against pg_shadow table in version > 8.0.4. For what purpose? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Triggers and Audit Trail

2005-12-29 Thread Michael Fuhr
w you can't do this yet in PL/pgSQL, but you can in other languages like PL/Perl and PL/Tcl. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] alter column datatype with cast

2005-12-29 Thread Michael Fuhr
27;t know what it is. Some casts can be done implicitly and some not. For more information see the CREATE CAST and Type Conversion documentation: http://www.postgresql.org/docs/8.1/interactive/sql-createcast.html http://www.postgresql.org/docs/8.1/interactive/typeconv.html -- Michael Fuhr -

Re: [GENERAL] Data types

2005-12-30 Thread Michael Fuhr
s/8.1/interactive/information-schema.html -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Delete / F/K error

2005-12-30 Thread Michael Fuhr
ROM "sites" WHERE "id"='1' What are the table definitions for sites, templates, and types? I'd guess you have some ON DELETE CASCADE and ON DELETE SET NULL foreign key constraints in templates and types. Think through what happens when those constra

Re: [GENERAL] Delete / F/K error

2005-12-30 Thread Michael Fuhr
t; COMMIT; COMMIT And: test=> BEGIN; BEGIN test=> INSERT INTO foo VALUES (1); INSERT 0 1 test=> SAVEPOINT x; SAVEPOINT test=> INSERT INTO bar VALUES (1, 1); INSERT 0 1 test=> RELEASE x; RELEASE test=> DELETE FROM foo WHERE id = 1; DELETE 1 test=> COMMIT; COMMIT Any dev

Re: [GENERAL] 8.1 removed functions

2006-01-01 Thread Michael Fuhr
m | aclitem | oid, oid, text, boolean (2 rows) For examples look at standard views that use makeaclitem: SELECT * FROM pg_views WHERE definition ~* 'makeaclitem'; -- Michael Fuhr ---(end of broadcast)--- TIP 3

Re: [GENERAL] Casting issue with aggregated function

2006-01-02 Thread Michael Fuhr
s sum() returns bigint; you then feed that bigint to sum() so the result is numeric. Presumably the promotions are done to avoid overflow. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] pg_dump error codes

2006-01-02 Thread Michael Fuhr
example that might give you some ideas: #!/bin/sh dumpout=/tmp/dump.out.$$ dumperr=/tmp/dump.err.$$ erruser=root trap "rm -f $dumperr $dumpout; exit" 1 2 15 if ! pg_dump "$@" > $dumpout 2> $dumperr then rm -f $dumpout mail -s "Dump errors" $erruser < $

Re: [GENERAL] Query in postgreSQL version Windows

2006-01-02 Thread Michael Fuhr
version of PostgreSQL older than 8.1, or if it's running 8.1 then you've enabled add_missing_from. As the 8.1 Release Notes mention, that option is now disabled by default. Rather than trying to make the query work as-is, rewrite it to be proper SQL by adding pg_class to the FROM clause. -- Mi

Re: [GENERAL] who has some document about extending postgresql

2006-01-03 Thread Michael Fuhr
t help then please be more specific about what you'd like to do. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] copy from error

2006-01-04 Thread Michael Fuhr
gt; I'd guess that you're using tsearch2 but somehow the pg_ts_cfg table was created without oids. In 8.1 default_with_oids is off, but since tsearch2.sql creates the table "with oids" I'm wondering if you created the table by some other means (i.e., not by running the commands i

Re: [GENERAL] 'Official' definition of ACID compliance?

2006-01-05 Thread Michael Fuhr
acronym -- but do the concepts it represents really stand up to close examination? In this section, we present some evidence to suggest that the answer to this question is, in general, _no_. (485) -- Michael Fuhr ---(end of broadcast)--- TI

Re: [GENERAL] copy from error

2006-01-05 Thread Michael Fuhr
ave installed tsearch2 some other way. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] plpgsql question

2006-01-05 Thread Michael Fuhr
ifferent, e.g., getrecord(integer) and getrecord(integer, text). * You could rewrite the query, possibly using CASE or COALESCE to handle NULL values. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Data loading from a flat file...

2006-01-05 Thread Michael Fuhr
nces. > > Could anyone please let me know how I can upload the complete dataset into > the table? See the documentation for COPY (or \copy in psql). If you need to adjust sequence values after the load you can use ALTER SEQUENCE or the setval() function. -- Michael Fuhr -

Re: [GENERAL] Data loading from a flat file...

2006-01-05 Thread Michael Fuhr
RT with COPY? To use INSERT you'd need to read the data and generate the appropriate INSERT commands; that's another scripting job. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropria

Re: [GENERAL] Indexes works only on miss

2006-01-06 Thread Michael Fuhr
this happening? Is it because of the memory? I'm running on default > db settings, version 8.0 and SUSE 10. You can use various tuning guides to help adjust your settings. Here are a couple of links: http://www.powerpostgresql.com/PerfList http://www.revsys.com/writings/postgresql-performance

Re: [GENERAL] plpgsql question

2006-01-06 Thread Michael Fuhr
On Fri, Jan 06, 2006 at 01:14:38AM -0800, Matthew Peter wrote: > Michael Fuhr <[EMAIL PROTECTED]> wrote: > > On Thu, Jan 05, 2006 at 12:50:34AM -0800, Matthew Peter wrote: > > > Is it possible to skip the loop and just return all records in a > > > single quer

Re: [GENERAL] Strange behavior

2006-01-06 Thread Michael Fuhr
em logs? How repeatable is the problem? Does it happen with a one-line script that executes just a simple psql command? We've seen previous reports of "Broken pipe" that turned out to be caused by exhausted resources -- could that be the problem? -- Michael Fuhr -

Re: [GENERAL] calling stored procedure with array paramenter (for psql)

2006-01-09 Thread Michael Fuhr
what "does not work" means? Are you getting an error? If so, what's the error message? Are those the real function names? They don't match so that could be the problem (one is getlms, the other is get_lms). If that's not it then please post a simple but complete example

Re: [GENERAL] plpgsql question

2006-01-09 Thread Michael Fuhr
row to be of that type. 2. Declare the function to return SETOF record, declare row to be of type record, and provide a column definition list when you call the function. 3. Use OUT parameters (new in 8.1). -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Passing a list of values to a function

2006-01-09 Thread Michael Fuhr
('{1,2,3}'); Another way would be to build a query string in a PL/pgSQL function and use EXECUTE, but beware of embedding function arguments in query strings without quoting. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] calling stored procedure with array paramenter (for psql)

2006-01-09 Thread Michael Fuhr
lete example. The problem might be in the function body, not in how you're calling the function, so we need to see what the function is doing. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [GENERAL] Vacuum all tables unders under one schema (not under one database)

2006-01-09 Thread Michael Fuhr
logs and vacuum each table in a particular schema. Maybe that would be a useful option to add to vacuumdb. Another possibility would be to use autovacuum. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extens

Re: [GENERAL] cursors as table sources

2006-01-11 Thread Michael Fuhr
ght to. Is there a reason you'd want to use a cursor instead of, say, a view? Are you just curious or is there a problem you're trying to solve? If I've misunderstood what you're asking then please elaborate. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] Different exponent in error messages

2006-01-11 Thread Michael Fuhr
TAIL: The absolute value is greater than or equal to 10^7 for field with precision 9, scale 3. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PRO

Re: [GENERAL] getting access to geodistance (what do I need to install/enable) in an existing db install

2006-01-11 Thread Michael Fuhr
ource into the new database with CREATE FUNCTION, but maybe you'd be better off using one of the standard functions. What, if anything, does geodistance do that the standard PostGIS distance functions don't? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] getting access to geodistance (what do I need to install/enable) in an existing db install

2006-01-11 Thread Michael Fuhr
thdistance (you'll have to install contrib/cube first because earthdistance depends on it). If you're not sure how to install those modules then look around for files named cube.sql and earthdistance.sql and load them into your database (cube.sql first). -- Michael Fuhr ---

Re: [GENERAL] getting access to geodistance (what do I need to install/enable) in an existing db install

2006-01-11 Thread Michael Fuhr
ntributed modules; in the PostgreSQL source code they're under the contrib directory. If you're using pre-built packages then look through the available packages for something with a name like postgresql-contrib, pgsql-contrib, etc. The required SQL files and shared objects should be in that pa

Re: [GENERAL] getting access to geodistance (what do I need to install/enable) in an existing db install

2006-01-11 Thread Michael Fuhr
le's shared object (cube.so, or whatever it's called on your platform) isn't in that directory. Are you building from source or are you using pre-built packages? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] getting access to geodistance (what do I need to install/enable) in an existing db install

2006-01-11 Thread Michael Fuhr
trib directory is (I am following > directions from the postgis site) I'd recommend asking PostGIS-specific questions on the postgis-users mailing list where there's more PostGIS expertise. http://postgis.refractions.net/mailman/listinfo/postgis-users -- Michael Fuhr

Re: [GENERAL] cursors as table sources

2006-01-12 Thread Michael Fuhr
all from cursor1); is good > idea but it is not possible to use it in a function. >If I replace curs2set(pp) with (fetch all from pp) I get errors > 3. Of course 'pp' is function parameter > 4. I think there is at least one advantage in allowing cursors as table >

Re: [GENERAL] How to reset a sequence so it will start with 1 again?

2006-01-13 Thread Michael Fuhr
--- 1 (1 row) test=> SELECT nextval('foo'); nextval - 1 (1 row) test=> ALTER SEQUENCE foo RESTART WITH 1; ALTER SEQUENCE test=> SELECT nextval('foo'); nextval - 1 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Plans for 8.2?

2006-01-13 Thread Michael Fuhr
/docs/8.1/interactive/monitoring-stats.html -- Michael Fuhr ---(end of broadcast)--- TIP 1: 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] Plans for 8.2?

2006-01-13 Thread Michael Fuhr
On Fri, Jan 13, 2006 at 01:49:02AM -0700, Michael Fuhr wrote: > On Fri, Jan 13, 2006 at 09:30:22AM +0100, H.J. Sanders wrote: > > Just one request that would make the transition from another > > great database to PostgreSQL a lot easier: > > > > SET LOCK MODE TO WAIT

Re: [GENERAL] Temporary tables

2006-01-13 Thread Michael Fuhr
tion with OID # does not exist" errors when accessing temporary tables in PL/PgSQL functions?' in the FAQ: http://www.postgresql.org/docs/faqs.FAQ.html#item4.19 See also numerous past discussions in the list archives. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Plans for 8.2?

2006-01-13 Thread Michael Fuhr
subsequent query that just started. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] sort character data in arbitrary order?

2006-01-14 Thread Michael Fuhr
ers a-z and the desirability of states may not always be > in this order. How do you determine desirability? You could order by an expression that evaluates to a state's desirability. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] How to use parameters in stored procedures?

2006-01-14 Thread Michael Fuhr
postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS http://www.postgresql.org/docs/faqs.FAQ.html#item4.21 -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Ref cursor with Geometric Function

2006-01-16 Thread Michael Fuhr
e the problem and to work in some sense if the problem didn't happen, but no more code than that (some people post long, complex functions or queries when the real problem could be demonstrated in only a few lines; the extraneous code isn't relevant to the problem and just gets in the way

Re: [GENERAL] Plans for 8.2?

2006-01-16 Thread Michael Fuhr
s/7.4/interactive/monitoring-stats.html -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Is there a way to list runaway queries and kill them?

2006-01-17 Thread Michael Fuhr
tml http://www.postgresql.org/docs/8.1/interactive/runtime-config-client.html http://www.postgresql.org/docs/8.1/interactive/functions-admin.html (These links are for 8.1; use the documentation for whatever version you're running.) -- Michael Fuhr ---(end

Re: [GENERAL] Distance calculation

2006-01-17 Thread Michael Fuhr
be to the postgis-users mailing list: http://postgis.refractions.net/mailman/listinfo/postgis-users -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] prepared statement results don't clear?

2006-01-17 Thread Michael Fuhr
st a simple test case? I can provoke "hard limit on result handles reached" by not clearing results, but so far I haven't seen that error if I do clear all results. What versions of PostgreSQL, Tcl, and pgtcl are you using, and on what platform? I tested with PostgreSQL 8.1.2, T

Re: [GENERAL] Stored Procedues in C

2006-01-18 Thread Michael Fuhr
ll have trouble then please post the details (what you're trying to do, what your Makefile looks like, what error messages you're getting, etc.). -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] create plperlu langage fails

2006-01-19 Thread Michael Fuhr
a symbol itself. How did you obtain libplperl.so -- did you built it yourself or install it from a package? Do you have multiple versions of Perl installed? What platform are you using? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you

Re: [GENERAL] Privilege for seeing queries using pg_stat_get_backend_activity

2006-01-19 Thread Michael Fuhr
On Thu, Jan 19, 2006 at 09:17:12AM -0800, Marc Munro wrote: > I've tried tricks with security definer functions but this does not help > as pg_stat_get_backend_activity explicitly checks for the caller being a > superuser. Works here. Could you post an example? --

Re: [GENERAL] A tale of two similar databases

2006-01-19 Thread Michael Fuhr
See the section on vacuuming in "Routine Database Maintenance Tasks" in the documentation: http://www.postgresql.org/docs/7.3/interactive/routine-vacuuming.html -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usen

Re: [GENERAL] out parameters and SETOF

2006-01-19 Thread Michael Fuhr
FUNCTION foo(OUT x integer, OUT y integer) RETURNS SETOF record AS $$ BEGIN x := 1; y := 2; RETURN NEXT; x := 3; y := 4; RETURN NEXT; x := 4; y := 5; RETURN NEXT; END; $$ LANGUAGE plpgsql; SELECT * FROM foo(); x | y ---+--- 1 | 2 3 | 4 4 | 5 (3 rows) -- Mich

Re: [GENERAL] What is the maximum length of an IN(a,b,c....d) list in PostgreSQL

2006-01-19 Thread Michael Fuhr
tic/runtime-config.html#RUNTIME-CONFIG-RESOURCE -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] selecting array slice problem

2006-01-19 Thread Michael Fuhr
Delphi 5. Release versions of 8.0 have been available for a year and the latest is 8.0.6. Running an old early beta isn't a good idea; lots of bugs have been fixed since then. > I access the database through the BDE. What happens if you run the same query in psql? If it works in

Re: [GENERAL] auto increment within a compound key

2006-01-19 Thread Michael Fuhr
; INSERT INTO foo (y) VALUES (1), (1), (2); Query OK, 3 rows affected (0.06 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM foo; +---+---+ | x | y | +---+---+ | 1 | 1 | | 2 | 1 | | 3 | 2 | +---+---+ 3 rows in set (0.01 sec) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Connected user in a triggerfunction

2006-01-19 Thread Michael Fuhr
I get the > connected user in a triggerfunction? Use SESSION_USER or CURRENT_USER. They're usually the same but see the documentation for how they can differ: http://www.postgresql.org/docs/8.1/interactive/functions-info.html -- Michael Fuhr ---

Re: [GENERAL] What is the maximum length of an IN(a,b,c....d) list in PostgreSQL

2006-01-20 Thread Michael Fuhr
ine 1-character values should be fine (tested on my 7.4.11 system). I think the same applies to 8.0 and later with max_stack_depth: the limit depends on the number of expressions, not on the lengths of the elements. At least that's what my tests seem to show. -- Michael Fuhr

Re: [GENERAL] standard normal cumulative distribution function

2006-01-20 Thread Michael Fuhr
ut around the GNU Scientific Library's gsl_cdf_ugaussian_P() function. I can post an example of how to do that if it's what you're looking for. -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner wi

Re: [GENERAL] standard normal cumulative distribution function

2006-01-20 Thread Michael Fuhr
it into a PgFoundry project. Would there be any interest in a PostgreSQL interface to the GNU Scientific Library? Or has somebody already done that and I simply overlooked it? -- Michael Fuhr ---(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's datatypes do not match

Re: [GENERAL] standard normal cumulative distribution function

2006-01-21 Thread Michael Fuhr
On Fri, Jan 20, 2006 at 04:54:00PM -0700, Michael Fuhr wrote: > On Sat, Jan 21, 2006 at 12:00:49AM +0100, SunWuKung wrote: > > Does somebody have/know of a function for pg returning the standard > > normal cumulative distribution for a Z score? > > Are you looking fo

<    5   6   7   8   9   10   11   12   13   14   >