Re: [GENERAL] Creating a database with psql

2005-07-20 Thread Michael Fuhr
information: http://www.postgresql.org/docs/8.0/static/admin.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] Trigger problem

2005-07-20 Thread Michael Fuhr
g, then we'll need to see a self-contained example, i.e., all SQL statements that somebody could execute in an empty database to reproduce the problem. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Seg fault in postgres 7.4.7?

2005-07-20 Thread Michael Fuhr
t; that prevents them from happening. If so, then it might be useful to adjust that limit so you can get core dumps. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropria

Re: [GENERAL] IN subquery not using a hash

2005-07-20 Thread Michael Fuhr
why. Tom? Why different types, and why numeric for one of them? Why not integer for both? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] [HACKERS] No user being created during initdb for OS X

2005-07-21 Thread Michael Fuhr
On Thu, Jul 21, 2005 at 02:38:51PM +1000, Jamie Deppeler wrote: > I am doing it right > /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data How are you determining that "no user is being created"? What are you doing and what's the exact error message? -- Michael Fuh

Re: [GENERAL] Strange input/cast semantics for inet

2005-07-21 Thread Michael Fuhr
inet(3) manual page documents that interpretation, and on most (all?) systems I've ever used, "ping 127.1" is a shortcut for pinging the loopback address. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Strange input/cast semantics for inet

2005-07-21 Thread Michael Fuhr
On Thu, Jul 21, 2005 at 10:14:42PM -0400, Greg Stark wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > > I don't know if it's ever been blessed by a formal standard > > It's blessed by POSIX: > > http://www.opengroup.org/onlinepubs/009695399

Re: [GENERAL] Dumb question about count()

2005-07-21 Thread Michael Fuhr
gt; > Except that it counts 0s for seats/students. > > Why can't I recall/find how to do this particular join? Sounds like you're looking for an outer join. http://www.postgresql.org/docs/8.0/static/tutorial-join.html http://www.postgresql.org/docs/8.0/static/queries-table-ex

Re: [GENERAL] problem casting varchar to inet

2005-07-22 Thread Michael Fuhr
to NULLIF: select cast(coalesce(nullif(trim(callingip), ''), '127.0.0.1') as inet); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Query planner refuses to use index

2005-07-22 Thread Michael Fuhr
68138 > speed_pkey | i|1000 |1 That's odd -- why aren't there more tuples and pages in the speed_pkey index? Those look like never-been-vacuumed defaults. Are you sure you've been vacuuming this table, or have you just been

Re: [GENERAL] testing castability of VARCHAR data to INET/CIDR

2005-07-23 Thread Michael Fuhr
.org/docs/8.0/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joini

Re: [GENERAL] \dt gives ERROR: did not find '}' at end of input node

2005-07-24 Thread Michael Fuhr
atch. Is that what you're using? If so then you might want to read the messages in the following thread: http://archives.postgresql.org/pgsql-general/2005-06/msg00031.php -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)---

Re: [GENERAL] Query planner refuses to use index

2005-07-25 Thread Michael Fuhr
you tried and the corresponding EXPLAIN ANALYZE outputs? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] constraint problem

2005-07-25 Thread Michael Fuhr
error on the first NULL. Use IS NOT NULL instead of NOT NULL. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] transaction timeout

2005-07-26 Thread Michael Fuhr
locks strong enough to "lock up the entire database"? Why does the client hang? Since the database doesn't currently have a way to detect and handle these situations, it might be worthwhile to find out what's happening to see if it can be prevented. -- Michael

Re: [GENERAL] dropping non-existent tables

2005-07-26 Thread Michael Fuhr
autocommit mode). Also, if you're using psql then make sure you don't have ON_ERROR_STOP set. In PostgreSQL 8.1, psql will have an ON_ERROR_ROLLBACK setting that uses savepoints to automatically roll back failed statements while allowing the rest of the transaction to continue. -- Michael

Re: [GENERAL] Select for update

2005-07-28 Thread Michael Fuhr
ALUES (7, 'seven'); SELECT pid FROM pidtest WHERE pid > 5 FOR UPDATE; pid - 6 7 (2 rows) SELECT * FROM pidtest; pid | szoveg -----+---- 3 | three 4 | four 5 | five 6 | six 7 | seven (5 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] problem inserting with sequence

2005-07-28 Thread Michael Fuhr
RRENT > req_num integer DEFAULT > nextval('acq_requests_req_num_seq') NOT NULL, This sequence name doesn't match the name of the sequence you created, at least not the one you showed. Is there an acq_requests_req_num_seq sequence? -- Michael Fu

Re: [GENERAL] problem inserting with sequence

2005-07-28 Thread Michael Fuhr
wwrun; Granting update on a sequence allows the use of nextval() and setval() on that sequence; granting select allows currval(). http://www.postgresql.org/docs/7.4/static/sql-grant.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Select for update

2005-07-28 Thread Michael Fuhr
isn't supposed to happen, but we can't do much to investigate the problem unless we can see how to reproduce it. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] how to select

2005-07-29 Thread Michael Fuhr
ry buffer with \r: test=> SELECT project_name FROM project_group_list test-> \r Query buffer reset (cleared). test=> SELECT project_name FROM project_group_list; project_name -- Project A Project B Project C (3 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -

Re: [GENERAL] Strange delete behaviour

2005-08-01 Thread Michael Fuhr
and execute "EXPLAIN ANALYZE DELETE ..."? Do other tables have foreign key references to t_node? If so, are there indexes on those tables' foreign key columns? How many records are in t_node and any tables that reference it? Do you keep the tables vacuumed and ana

Re: [GENERAL] Strange delete behaviour

2005-08-01 Thread Michael Fuhr
as to use a sequential scan instead of considering an index scan, so those searches are likely to be slow. Try creating indexes on the referencing columns (ann_startnode_id and ann_endnode_id) and on any other columns that refer to other tables. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] Problem with dropping a tablespace

2005-08-01 Thread Michael Fuhr
base 595675173 has objects in the tablespace? What platform are you using? If some flavor of Unix, what's the output of the following command? ls -alR /path/to/tablespace/directory (Replace the path with the tablespace's directory; you'll probably need to be the directory owner or

Re: [GENERAL] Check postgres compile-time options

2005-08-01 Thread Michael Fuhr
en the options pg_config reports might not match those that the postmaster was built with (somebody please correct me if I'm mistaken). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: In versions below 8.0, t

Re: [GENERAL] Problem with dropping a tablespace

2005-08-02 Thread Michael Fuhr
On Tue, Aug 02, 2005 at 08:00:28AM +0200, Oliver Siegmar wrote: > On Monday 01 August 2005 22:15, Michael Fuhr wrote: > > On Mon, Aug 01, 2005 at 09:28:07PM +0200, Oliver Siegmar wrote: > > > How may I delete the tablespace manually? > > > > Perhaps a bette

Re: [GENERAL] Problem with dropping a tablespace

2005-08-02 Thread Michael Fuhr
On Tue, Aug 02, 2005 at 03:25:53PM +0200, Oliver Siegmar wrote: > On Tuesday 02 August 2005 15:16, Michael Fuhr wrote: > > > This directory indeed contains a subdirectory named 595675173 (the > > > ghost's database oid ;-)) > > > > Does that subdirectory c

Re: [GENERAL] indexes are farked

2005-08-02 Thread Michael Fuhr
will be in the documentation for 8.1 when it's released, but I think it largely applies to earlier versions as well. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Have you searched our list archives?

Re: [GENERAL] Internal catalogs error in log file

2005-08-03 Thread Michael Fuhr
t;\df +" in psql. Shouldn't be anything to worry about. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] weirdness with the a sql update

2005-08-04 Thread Michael Fuhr
ostgreSQL finds room for them. This is one of the reasons for doing regular vacuuming: if you're deleting or updating rows from a table, the table will continue to grow unless you free up the old rows (aka "dead tuples") so their space can be reused. Aside from wasting spa

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
find out exactly what and where the problem is before looking for a solution. But if DNS is the problem, why not fix it instead of working around it? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: if posting/reading t

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
up to test whether DNS indeed has a problem? That wouldn't answer why different versions of psql apparently behave differently, but it should at least tell us whether DNS is really a problem. Have you used a sniffer like tcpdump or ethereal to watch DNS queries and PostgreSQL connections? -

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
e differently on the same machine. If that's the case, then such behavior isn't easily explained by differing nsswitch.conf configurations. Even if mucking around with nsswitch.conf did appear to fix things, we'd still have the mystery of why the two versions of psql behave d

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
hostname.subdomain.domain" fails. I seldom find such queries useful and I do occasionally find them problematic, so if my resolver has such an option then I usually enable it (e.g., "options no_tld_query" in /etc/resolv.conf on FreeBSD). -- Michael Fuhr ---(e

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
t;hostname.domain" fail. You might also want to examine your domain search list. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] What causes lock?

2005-08-04 Thread Michael Fuhr
olved in the lock? You can get the relation name by casting the relation column to regclass: SELECT relation::regclass AS relname, * FROM pg_locks; Note that this will resolve only relation names in the current database. -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
On Thu, Aug 04, 2005 at 04:30:52PM -0600, Michael Fuhr wrote: > The response to 7.2 has an ANCOUNT (number of records in the answer > section) of 1 and an NSCOUNT (number of records in the authority > section) of 2, whereas the response to 8.0 has an ANCOUNT of 0 and > an NSCOUNT

Re: [GENERAL] DNS vs /etc/hosts

2005-08-04 Thread Michael Fuhr
On Thu, Aug 04, 2005 at 06:29:46PM -0600, Michael Fuhr wrote: > Anybody know if queries can be disabled in Linux? Lowell, if > nobody answers here then you might need to seek help in a different > forum. Or you could just hack the code and change AF_UNSPEC to > AF_INET ;-) L

Re: [GENERAL] How to write jobs in postgresql

2005-08-05 Thread Michael Fuhr
On Wed, Aug 03, 2005 at 09:08:48AM +0530, chiranjeevi.i wrote: > Is it possible to write jobs in postgresql & if possible how should I > write .please help me. Please explain what you mean by "job." What are you trying to do? -- Michael Fuhr

Re: [GENERAL] How to write jobs in postgresql

2005-08-05 Thread Michael Fuhr
should investigate and fix those problems. The pgAdmin folks have been working on a scheduler called pgAgent. Use a search engine to find more information about it. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Going beyond sql

2005-08-05 Thread Michael Fuhr
onditionals like CASE expressions), so you'll have to write a server-side function in a language like PL/pgSQL or do the control in client-side code. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Why pgsql function is working on vers 8.0/windows and not on ver 7.3.2/rad hat?

2005-08-05 Thread Michael Fuhr
s than previous versions; it also has better syntax checking for PL/pgSQL functions. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED]

Re: [GENERAL] DNS vs /etc/hosts

2005-08-06 Thread Michael Fuhr
. In summary, several things would be desirable: 1. Disable queries if the box doesn't use IPv6. 2. Disable top-level domain queries in the resolver search algorithm when looking up an unqualified hostname. 3. Fix the DNS servers so that if top-level domai

Re: [GENERAL] timestamp default values

2005-08-06 Thread Michael Fuhr
erbosity: so we could see where the error is being raised. -- 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 me

Re: [GENERAL] timestamp default values

2005-08-06 Thread Michael Fuhr
_timezones to off; select 'Sat Aug 06 12:00:43.668919 2005 EST'::timestamp; timestamp ---- 2005-08-06 12:00:43.668919 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] postgresql Secure Mode

2005-08-08 Thread Michael Fuhr
in the postmaster logs: LOG: invalid entry in file ".../pg_hba.conf" at line 72, token "MD5" -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an ind

Re: [GENERAL] Query stucked in pg_stat_activity

2005-08-09 Thread Michael Fuhr
ross this situation a while ago, where high load caused pg_stat_activity to have stale entries. Tom Lane wondered if the stats subsystem was under a high enough load that it was dropping messages, as it's designed to do. http://archives.postgresql.org/pgsql-bugs/2004-10/msg0

Re: [GENERAL] Query stucked in pg_stat_activity

2005-08-09 Thread Michael Fuhr
But I don't recall seeing them either. > In any case it seems my system can readily reproduce the issue whenever > I place a bigger load on it... I was also able to reproduce the behavior when running pgbench with sufficiently high settings. -- Michael Fuhr ---

Re: [GENERAL] pgsql and php with ssl mode.

2005-08-10 Thread Michael Fuhr
uire" invalid when SSL support is not compiled in ". Looks like the underlying libpq wasn't compiled with SSL support. If you built PostgreSQL yourself then do a fresh build and configure it with the --with-openssl option. If you installed from a package then complain to whoeve

Re: [GENERAL] function accepting a row

2005-08-10 Thread Michael Fuhr
you'll have to work within its limitations. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] NULL value without indicator in line 250.

2005-08-10 Thread Michael Fuhr
ere's a link to the latest version: http://www.postgresql.org/docs/8.0/static/ecpg-variables.html#AEN25258 If that's not what you're doing, then please provide more information. -- Michael Fuhr ---(end of broadcast)--- TIP 4: H

Re: [GENERAL] insert performance riddle

2005-08-10 Thread Michael Fuhr
RETURN; END; ' LANGUAGE plpgsql VOLATILE STRICT; EXPLAIN ANALYZE SELECT insert_foo(1000); -- 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] function accepting a row

2005-08-11 Thread Michael Fuhr
pgSQL functions can *accept* these types of arguments, but in versions earlier than 8.0 they have trouble *passing* such arguments to another function. The documentation should probably be more clear about that. -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] Exceptions in PL/Perl?

2005-08-11 Thread Michael Fuhr
On Thu, Aug 11, 2005 at 10:15:11AM -0400, Jeff Boes wrote: > How does one raise an exception from a PL/Perl function? Specifically, > this is a trigger function. Is it as simple as "die "? Use elog: http://www.postgresql.org/docs/8.0/static/plperl-database.html

Re: [GENERAL] new Perl Server-Side Language in 8.0

2005-08-11 Thread Michael Fuhr
shared storage area, triggers, returning records and arrays of records, and SPI calls to access the database." For details you might need to look through the pgsql-hackers and pgsql-committers archives. -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] insert performance riddle

2005-08-11 Thread Michael Fuhr
4 or IPv6 socket) connections. A couple of months ago, Tom Lane noticed that benchmarks using DBD::Pg make PostgreSQL look worse than it deserves: http://archives.postgresql.org/pgsql-interfaces/2005-06/msg3.php -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] insert performance riddle

2005-08-11 Thread Michael Fuhr
er performance 2-3 orders of magnitude better on > other roughly comparable or inferior boxes. I'd suggest contacting the module's maintainer -- see the AUTHORS section of the DBD::Pg manual page for contact info. -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] Seeking PL/PGSQL example

2005-08-12 Thread Michael Fuhr
plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING For row counts you can use COUNT; if an estimate will suffice, you could use pg_class.reltuples. http://www.postgresql.org/docs/8.0/static/functions-aggregate.html http://www.postgresql.org/docs/8.0/static/catalog-pg-class.html -- Michael F

Re: [GENERAL] insert performance riddle

2005-08-12 Thread Michael Fuhr
a DBI/DBD::Pg, Pg, and C/libpq. I'm now > investigating the possibility of simple old intermittent I/O > congestion... How consistent were the results before? I got the impression that you saw consistently bad performance with DBD::Pg when other methods perfo

Re: [GENERAL] insert performance riddle

2005-08-12 Thread Michael Fuhr
On Fri, Aug 12, 2005 at 05:37:22PM -0600, Ed L. wrote: > On Friday August 12 2005 5:27 pm, Michael Fuhr wrote: > > How consistent were the results before? I got the impression > > that you saw consistently bad performance with DBD::Pg when > > other methods performed well. &

Re: [GENERAL] insert performance riddle

2005-08-12 Thread Michael Fuhr
On Fri, Aug 12, 2005 at 06:20:27PM -0600, Ed L. wrote: > On Friday August 12 2005 6:11 pm, Michael Fuhr wrote: > > Has anything changed on the system since the results were > > consistently slow? New hardware, new versions of anything, > > reboot, etc.? Did you do any profi

Re: [GENERAL] append to the current search_path

2005-08-12 Thread Michael Fuhr
the current value and just append to it. You could use the set_config() and current_setting() functions. http://www.postgresql.org/docs/8.0/static/functions-admin.html I'm not aware of a way to append to a variable's current setting with SET, but I'd be happy to be

Re: [GENERAL] pl/pgsql frustration

2005-08-13 Thread Michael Fuhr
N statements. You might also want to create the functions as STRICT (aka RETURNS NULL ON NULL INPUT). See the CREATE FUNCTION documentation for more info: http://www.postgresql.org/docs/7.4/interactive/sql-createfunction.html -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Question about the NAME type used in pg_proc and pg_class

2005-08-15 Thread Michael Fuhr
es can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63." -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Serial Unique question

2005-08-15 Thread Michael Fuhr
million values per second, it'll take about 300,000 years for the sequence to cycle. -- 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] Question about the NAME type used in pg_proc and pg_class

2005-08-15 Thread Michael Fuhr
s it is looking at an 80-character > operator name, you've probably messed up the syntax somewhere along the > line. Comments? An error sounds reasonable to me. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] converting curly apostrophes to standard apostrophes

2005-08-15 Thread Michael Fuhr
LE foo (testval text); INSERT INTO foo VALUES ('ABCDEFG'); SELECT substr(testval, 4, 1), ascii(substr(testval, 4, 1)) FROM foo; substr | ascii ----+--- D |68 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] converting curly apostrophes to standard apostrophes

2005-08-15 Thread Michael Fuhr
nly the special characters along with their ASCII codes: CREATE FUNCTION special_chars(text) RETURNS text AS ' return join(" ", map {"$_:" . ord($_)} $_[0] =~ /[\200-\377]/g); ' LANGUAGE plperl IMMUTABLE STRICT; SELECT id, special_chars(body) FROM news WHERE body ~ &#x

Re: [GENERAL] trigger question

2005-08-16 Thread Michael Fuhr
t pair of single quotes having a closing pair? Where are the closing parenthesis and statement-terminating semicolon? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] syntax error foreign key

2005-08-16 Thread Michael Fuhr
he part that talks about quoted identifiers. Here's a link for the latest version: http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Set autocommit to off

2005-08-17 Thread Michael Fuhr
ommit was removed from the server and added to individual client APIs as appropriate." -- 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 jo

Re: [GENERAL] trigger question

2005-08-17 Thread Michael Fuhr
ple, the first argument to date_part() should be in single quotes (doubled or escaped since you're already inside a quoted string), not double quotes. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please se

Re: [GENERAL] Weird performance hit

2005-08-18 Thread Michael Fuhr
kes about 10. Could you post the query and the EXPLAIN ANALYZE output for both systems? -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTEC

Re: [GENERAL] Weird performance hit

2005-08-18 Thread Michael Fuhr
On Thu, Aug 18, 2005 at 06:26:41AM -0600, Michael Fuhr wrote: > On Thu, Aug 18, 2005 at 10:03:38AM +0300, WireSpot wrote: > > However, one application is for some weird reason taking a serious > > performance hit on certain pages. There are some intensive joins and > > selec

Re: [GENERAL] Same database, different query plans

2005-08-18 Thread Michael Fuhr
cs? If you have and get the same results, then it might be interesting to see the output of the following on both systems: SET enable_mergejoin TO off; SET enable_nestloop TO on; EXPLAIN ANALYZE SELECT ... SET enable_mergejoin TO on; SET enable_nestloop TO off; EXP

Re: [GENERAL] How to determine table schema in trigger function

2005-08-18 Thread Michael Fuhr
On Thu, Aug 18, 2005 at 05:02:58PM +0300, Andrus wrote: > How to determine schema name where table TG_RELNAME belongs in trigger > function ? You could use TG_RELID to query the system catalogs. See the documentation for pg_class and pg_namespace. -- Michae

Re: [GENERAL] How disable context view in RAISE

2005-08-19 Thread Michael Fuhr
e to silence the CONTEXT messages: test=> \set VERBOSITY terse test=> SELECT foo(); NOTICE: test notice foo --- 12345 (1 row) If that's not what you're looking for then please provide more information. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] question about plpgsql replace function

2005-08-19 Thread Michael Fuhr
es not work. Your slashes are leaning the wrong direction. Try this: thearray := replace(mandi_notifications, '\r\n', ','); Sometimes the number of backslashes (\) matters; see "Tips for Developing in PL/pgSQL" in the documentation for discuss

Re: [GENERAL] Postgresql Function Language question

2005-08-20 Thread Michael Fuhr
stead of "Reply To". If you *are* using "New Message" then your mail client (Thunderbird 1.0.2 on Windows, or so it claims) appears to be broken. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Beginner - Help for pgsql 8.0.3 win32 platform

2005-08-20 Thread Michael Fuhr
p://www.postgresql.org/docs/8.0/static/plpgsql-cursors.html If the documentation doesn't answer your questions, then please post specific examples of what you're trying to do and describe the difficulties you're having. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] CSV import issue - please help

2005-08-20 Thread Michael Fuhr
s have been talking about making new releases soon. If you'd like the fix before then, you could fetch the source code from CVS and build it yourself. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Help with plperl

2005-08-21 Thread Michael Fuhr
what's wrong: PL/Perl expects you to return a hash reference because the return type is "sometype"; the code returns an array reference so you get an error. Since you're pushing hash references onto the array, I'm guessing you meant to return "SETOF sometype". -- M

Re: [GENERAL] pg_restore and schema's

2005-08-22 Thread Michael Fuhr
ntifiers must be quoted to preserve case, I'd say the -O behavior is a bug. You might wish to report this to pgsql-bugs. I tested 8.0.3 and it doesn't have this problem. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have y

Re: [GENERAL] ctid access is slow

2005-08-23 Thread Michael Fuhr
width=4) (actual time=0.412..0.412 rows=0 loops=1) -> Subquery Scan "IN_subquery" (cost=0.00..0.26 rows=10 width=4) (actual time=0.063..0.336 rows=10 loops=1) -> Limit (cost=0.00..0.16 rows=10 width=4) (actual time=0.048..0.218 rows=10 loops=1)

Re: [GENERAL] How to limit database size

2005-08-23 Thread Michael Fuhr
ly monitor the database's disk usage so you can take action before the quota is exceeded. -- 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] Question about Foreign key constraint causes "costly sequential scans"?

2005-08-23 Thread Michael Fuhr
ol3) to speed up referential integrity checks when modifying the referred-to table (B). -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Import File

2005-08-23 Thread Michael Fuhr
; -- this might be faster anyway because it involves less disk I/O. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Question about Foreign key constraint causes "costly

2005-08-23 Thread Michael Fuhr
and see if the warning is > still there. That's a good idea, but it's not the condition that elicits the "will require costly sequential scans" warning. That warning is caused by the keys being of different types (see ATAddForeignKeyConstraint() in src/backend/commands/tablecmds.c i

Re: [GENERAL] ERROR: database is being accessed by other users

2005-08-23 Thread Michael Fuhr
r rename a database if somebody else is using it. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] PQConnectdb SSL (sslmode): Is this a bug

2005-08-26 Thread Michael Fuhr
nst a 7.4.8 libpq. If your system has ldd, which libpq does it show your program linked against? If the certificates work with psql, which libpq does ldd show psql linked against? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Altering functions cast

2005-08-26 Thread Michael Fuhr
l IMMUTABLE STRICT; SELECT nullif_bool(''); nullif_bool - (1 row) SELECT nullif_bool('t'); nullif_bool - t (1 row) SELECT nullif_bool('f'); nullif_bool - f (1 row) Is that what you're looking for? -- Michael Fuhr --

Re: [GENERAL] PQConnectdb SSL (sslmode): Is this a bug

2005-08-26 Thread Michael Fuhr
local/pgsql/lib/libpq.so.3? If so, what's the output of the following command? ls -l /usr/local/pgsql/lib/libpq.so* I'm wondering if you have PostgreSQL 7.4's libraries installed in /usr/lib and 8.0.1's libraries in /usr/local/pgsql/lib. Is that what you've done? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] PQConnectdb SSL (sslmode): Is this a bug

2005-08-26 Thread Michael Fuhr
onnection first. If the server permits non-SSL connections then "allow" will get you connected as non-SSL without ever attempting SSL. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appro

Re: [GENERAL] About "ERROR: must be *superuser* to COPY to or from a file"

2005-08-26 Thread Michael Fuhr
at SESSION_USER has appropriate permissons on the table being copied to or from. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that

Re: [GENERAL] An update rule affecting an after insert trigger

2005-08-27 Thread Michael Fuhr
ntentionally broken the stored procedure just to see if > I was making it to that logic but nothing. Adding RAISE statements with debugging messages might be preferable to breaking the code. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have

Re: [GENERAL] boolean default value

2005-08-28 Thread Michael Fuhr
of pgAdmin III? If you see the problem with psql then please post a self-contained example (and state what version of PostgreSQL you're using). -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] stack depth limit exceeded

2005-08-28 Thread Michael Fuhr
> return null; > end; > $body$ > LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; What's the trigger definition look like? I'd guess that the update on contacts.person has a trigger that somehow gets back to this function, which update

Re: [GENERAL] update functions locking tables

2005-08-29 Thread Michael Fuhr
ault btree. In general, writers shouldn't block readers. Have you examined pg_locks? Do you know exactly what the blocked queries are, or can you find out from pg_stat_activity (stats_command_string must be enabled)? Are you doing any explicit locking (LOCK statement)? -- Michael Fuh

Re: [GENERAL] PQConnectdb SSL (sslmode): Is this a bug

2005-08-29 Thread Michael Fuhr
er LD_LIBRARY_PATH to be an ugly hack anyway and recommend against its use except for testing purposes. You might want to consider using linker options that tell the executable where to find its shared libraries at run time; see your build tools' documentation for details. -- Michael Fuhr

Re: [GENERAL] stack depth limit exceeded

2005-08-29 Thread Michael Fuhr
to one of NEW's columns and have the function return NEW. In such a case the function will need to be called in a BEFORE trigger. See "Triggers" and "Trigger Procedures" in the documentation for more information: http://www.postgresql.org/docs/8.0/static/triggers.html

<    1   2   3   4   5   6   7   8   9   10   >