Re: [GENERAL] Question about accessing current row data inside trigger

2005-03-13 Thread Michael Fuhr
nguage Functions" in the documentation. Here are links to documentation for the latest version of PostgreSQL: http://www.postgresql.org/docs/8.0/interactive/trigger-interface.html http://www.postgresql.org/docs/8.0/interactive/xfunc-c.html -- Michael Fuhr http://www.fuhr.org/~mf

Re: [GENERAL] pg_restore: [custom archiver] could not uncompress data: incorrect data check

2005-03-14 Thread Michael Fuhr
a: incorrect data check "incorrect data check" appears to be a zlib error. Is there any chance the file got corrupted? Can you duplicate the problem if you do another dump? What OS and version of zlib are you using on each server? -- Michael Fuhr http

Re: [GENERAL] plpython function problem workaround

2005-03-14 Thread Michael Fuhr
e any problems with doing this? Is a VALIDATOR function permitted to modify the function it's validating? This wouldn't work if plpythonu ever installs a VALIDATOR, but you might be able to use it until such time (barring objections about why it's a Bad Ide

Re: [GENERAL] free space map settings

2005-03-14 Thread Michael Fuhr
PostgreSQL": http://www.powerpostgresql.com/Downloads/annotated_conf_80.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] plpython function problem workaround

2005-03-14 Thread Michael Fuhr
/8.0/interactive/sql-createlanguage.html http://www.postgresql.org/docs/8.0/interactive/xplang.html Note that my idea to use the validator function was just a brainstorm, not thoroughly tested or thought out. Maybe one of the developers will comment about the wisdom of (ab)using it the way I suggested.

Re: [GENERAL] plpython function problem workaround

2005-03-14 Thread Michael Fuhr
patch, at least not yet. Just throwing out an idea that somebody might be able to build on. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] plpython function problem workaround

2005-03-14 Thread Michael Fuhr
On Mon, Mar 14, 2005 at 08:14:42PM +0100, Marco Colombo wrote: > On Mon, 14 Mar 2005, Michael Fuhr wrote: > > >Would we? My understanding is that code passed to PyRun_String() > >and friends must be free of line-ending CRs on all platforms, and > >that the code that

Re: [GENERAL] plpython function problem workaround

2005-03-15 Thread Michael Fuhr
On Tue, Mar 15, 2005 at 01:40:23PM +0100, Marco Colombo wrote: > On Mon, 14 Mar 2005, Michael Fuhr wrote: > > >Hmmm...I think that would be inconsistent with previous reports. > >For example, in the following message, the poster said that everything > >(PostgreSQL, pgAdmin

Re: [GENERAL] plpython function problem workaround

2005-03-15 Thread Michael Fuhr
On Tue, Mar 15, 2005 at 06:03:01PM +0100, Marco Colombo wrote: > On Tue, 15 Mar 2005, Michael Fuhr wrote: > >I'll postpone commenting on the rest until we find out how the > >example programs run on Windows. If nobody follows up here then > >maybe I'll wander over

Re: [GENERAL] Wierd error message

2005-03-15 Thread Michael Fuhr
Does anything else show up in the web server or database logs? > but why the "in > ignored" then? Can you tell us more about the setup? What are all the pieces involved and their versions? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-15 Thread Michael Fuhr
d also be interested in seeing what happens if you run the programs in the following messages: http://archives.postgresql.org/pgsql-general/2005-01/msg00876.php http://archives.postgresql.org/pgsql-general/2005-03/msg00630.php Any test results or comments you can provide

Re: [GENERAL] plpython function problem workaround

2005-03-15 Thread Michael Fuhr
= 123\nreturn x\n' LANGUAGE plpythonu; CREATE OR REPLACE FUNCTION test_r() RETURNS integer AS 'x <- 123\nreturn(x)\n' LANGUAGE plr; SELECT test_python(); test_python - 123 (1 row) SELECT test_r(); test_r 123 (1 row) -- Michael Fuhr htt

Re: [GENERAL] plpython function problem workaround

2005-03-15 Thread Michael Fuhr
On Tue, Mar 15, 2005 at 06:03:01PM +0100, Marco Colombo wrote: > On Tue, 15 Mar 2005, Michael Fuhr wrote: > > >I'll postpone commenting on the rest until we find out how the > >example programs run on Windows. If nobody follows up here then > >maybe I'

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-15 Thread Michael Fuhr
On Tue, Mar 15, 2005 at 10:46:09PM +, Paul Moore wrote: > The long and short of it is that I believe you just use \n to delimit > lines on Windows, just like anywhere else. Many thanks -- your test results contain the info we've been seeking. -- Michael Fuhr http://www.fuhr

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-16 Thread Michael Fuhr
fferent line endings on different platforms. That would mean the programmer couldn't simply do this: PyRun_SimpleString("x = 1\n" "print x\n"); Instead, the programmer would have to do a compile-time or run-time check and build the

Re: [GENERAL] generating statistics

2005-03-16 Thread Michael Fuhr
Did you restart the database after making the configuration changes? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PR

Re: [GENERAL] New user: Windows, Postgresql, Python

2005-03-16 Thread Michael Fuhr
Does C runtime support in Windows convert > \n into \r\n automatically in printf()? If so, I'm on the wrong track. > It may do the same with scanf() and other stdio functions. I think that's exactly what happens with I/O streams in "text mode." -- Michael Fuhr http

Re: [GENERAL] plpython function problem workaround

2005-03-16 Thread Michael Fuhr
if (*sp == '\n') { *mp++ = *sp++; *mp++ = '\t'; } else *mp++ = *sp++; } *mp++ = '\n'; *mp++ = '\n'; *mp = '\0'; How about them apples? The PL/Python handler is alre

Re: [GENERAL] generating statistics

2005-03-16 Thread Michael Fuhr
OW to verify that the variables are indeed set? As Tom Lane suggested, if you're on a *nix system, did you use "ps" to see if the stats buffer process and stats collector process are running? (I'm not sure how to check that if you're on Windows.) Have you looked for errors

Re: [GENERAL] help with plpgsql function called by trigger

2005-03-16 Thread Michael Fuhr
, users_id) VALUES (bdid, NEW.uid); RETURN NULL; END; ' LANGUAGE plpgsql VOLATILE; See the "Trigger Procedures" section of the PL/pgSQL chapter in the documentation to learn more about NEW (and OLD, TG_ARGV, etc.), and see the "Sequence Manipulation Functions&

Re: [GENERAL] GUID data type support

2005-03-17 Thread Michael Fuhr
t is slow to use GUID as varchar... What is "it" and why do you think that "it" is slow? What problem are you trying to solve? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] plpython function problem workaround

2005-03-17 Thread Michael Fuhr
o send the right thing. That doesn't address the indentation munging, though. That appears to be a matter of knowing whether you're inside a quote or not when a LF appears. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] plpython function problem workaround

2005-03-17 Thread Michael Fuhr
On Thu, Mar 17, 2005 at 09:48:51PM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > Line-ending CRs stripped, even inside quotes; mid-line CRs converted > > to LF. Tests done with Python 2.4 on FreeBSD 4.11-STABLE; I wonder > > what

Re: [GENERAL] plpython function problem workaround

2005-03-17 Thread Michael Fuhr
On Fri, Mar 18, 2005 at 12:35:07AM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > then concerns about CR conversions potentially messing up a user's > > strings might be unfounded. > > Yeah, it looks like you are right: > > http:/

Re: [GENERAL] plpython function problem workaround

2005-03-18 Thread Michael Fuhr
iming at removing the > need for extra indentation. Sounds good too, if that'll work. Looking forward to seeing what you find out. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] plpython function problem workaround

2005-03-18 Thread Michael Fuhr
On Fri, Mar 18, 2005 at 10:33:01AM -0500, Tom Lane wrote: > > I think it would be reasonable to back-patch a small fix to convert CRLF. > The sort of rewrite Marco is considering, I wouldn't back-patch. I just submitted a small patch to convert CRLF => LF, CR => LF. -

Re: [GENERAL] Help with transactions

2005-03-18 Thread Michael Fuhr
before triggers firing after it. An operation ain't over 'til it's over: if an after trigger doesn't like what it sees, it can still abort the operation by raising an exception. That doesn't defeat the purpose -- it's part of the purpose. -- Michael Fuhr http://www.f

Re: [GENERAL] no IF - am I missing something ?

2005-03-20 Thread Michael Fuhr
#x27;t (unless I've overlooked it in the SQL:2003 draft). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Copression

2005-03-21 Thread Michael Fuhr
.0.1.22 > 127.0.0.1.3767: P 5104:5192(88) ack 3688 win 57344 Only the last case, a PostgreSQL connection over a compressed SSH tunnel, showed any compression in the response. It looks like OpenSSL supports compression but the application has to enable it: http://www.openssl.org/docs/ss

Re: [GENERAL] PHP SQL

2005-03-22 Thread Michael Fuhr
unction to avoid passing the data back and forth between the client and the server? Are you familiar with constructs like CREATE TABLE AS and INSERT...SELECT? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the planner

Re: [GENERAL] bit varying(512) vs bytea(64)

2005-03-22 Thread Michael Fuhr
nd 1? Actual bits, so manipulating the data in C should be the same for both types. Bit strings take an extra 4 bytes of storage, but if that doesn't matter then you might want to consider which type would be easier to manipulate in SQL (bytea functions vs. bit string functions).

Re: [GENERAL] Constraint problem

2005-03-22 Thread Michael Fuhr
stgreSQL 8.0). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] contrib module intagg crashing the backend

2005-03-22 Thread Michael Fuhr
448 in ExecAgg (node=0x839d188) at nodeAgg.c:674 Line 583 in mcxt.c is: (*header->context->methods->free_p) (header->context, pointer); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/rea

Re: [GENERAL] Help with transactions

2005-03-22 Thread Michael Fuhr
tations with constraints like foreign keys. > Also, in my original schema I'm getting an increment of 2 every time I > run nextval. I can't duplicate this yet but I'm looking into it. > Possibly my error somewhere in the function. Could be one of the "gotchas"

Re: [GENERAL] inherited table and rules

2005-03-22 Thread Michael Fuhr
M ONLY in the inheritance > statement? What are you trying to do that a simple INHERITS won't do? > What does GUC stand for? ;) Grand Unified Configuration. http://www.postgresql.org/docs/8.0/static/runtime-config.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] Delay INSERT

2005-03-23 Thread Michael Fuhr
currency Control (MVCC) so readers and writers don't block each other? http://www.postgresql.org/docs/8.0/static/mvcc.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the u

Re: [GENERAL] I'm OWNER of the db but I get `permission denied` when

2005-03-23 Thread Michael Fuhr
r pg_shadow | r pg_tablespace | r pg_toast_1260 | t pg_toast_1261 | t pg_toast_1262 | t pg_xactlock | s (8 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send a

Re: [GENERAL] debug_print_plan

2005-03-23 Thread Michael Fuhr
t. What's your log_min_messages setting? According to the documentation, debug_print_* needs DEBUG1 or lower. http://www.postgresql.org/docs/8.0/static/runtime-config.html#RUNTIME-CONFIG-LOGGING-WHAT -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] Changing constraints to deferrable

2005-03-23 Thread Michael Fuhr
n a single ALTER TABLE ALTER CONSTRAINT would be, but it's less hackish than updating the system catalogs directly. Or am I missing something? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the planner will ignore you

Re: [GENERAL] relid and relname

2005-03-24 Thread Michael Fuhr
) > indexrelname (name) indexrelid = object ID (oid) of the index indexrelname = name of the index See the "Indexes" chapter in the documentation for more information about indexes. http://www.postgresql.org/docs/8.0/static/indexes.html Studying the "System Catalogs" chapter mi

Re: [GENERAL] Stuck with references

2005-03-25 Thread Michael Fuhr
payway_profile AS pp JOIN location AS la ON (pp.location_a = la.location_id) JOIN location AS lb ON (pp.location_b = lb.location_id); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please se

Re: [GENERAL] syntax issue with custom aggregator

2005-03-25 Thread Michael Fuhr
STYPE = "_int4", > > FINALFUNC = "property"."ag_pos_avg_final", INITCOND = "'{0,0}'"); > > Too many quotes ... try INITCOND = '{0,0}' Also, check the array subscripts in your functions. By default, PostgreSQL array subscripts start a

Re: [GENERAL] help w/ a little naive brainstorming ...

2005-03-25 Thread Michael Fuhr
se, etc.). See for example DBI-link: http://pgfoundry.org/projects/dbi-link With views and rules you might be able to implement update/delete operations as well, although you wouldn't get transaction semantics. -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] TSearch2 FreeBSD

2005-03-25 Thread Michael Fuhr
arch/V2/ Is there a reason you're using PostgreSQL 7.3 instead of upgrading to a newer release? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] unsupported types in 8.0.1

2005-03-26 Thread Michael Fuhr
VALUES (20); SELECT x FROM foo WHERE x < now()::abstime::integer; x 10 (1 row) ANALYZE foo; SELECT x FROM foo WHERE x < now()::abstime::integer; ERROR: unsupported type: 23 -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] unsupported types in 8.0.1

2005-03-26 Thread Michael Fuhr
On Sat, Mar 26, 2005 at 10:24:06AM -0700, Michael Fuhr wrote: > > SELECT x FROM foo WHERE x < now()::abstime::integer; > ERROR: unsupported type: 23 \set VERBOSITY verbose SELECT x FROM foo WHERE x < now()::abstime::integer; ERROR: XX000: unsupported ty

Re: [GENERAL] unsupported types in 8.0.1

2005-03-26 Thread Michael Fuhr
re a reason you're using integer instead of timestamp or timestamp with time zone? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Debugging deadlocks

2005-03-27 Thread Michael Fuhr
ent implementation supports only exclusive row-level locks (SELECT FOR UPDATE), but I think Alvaro might be working on shared row-level locks for a future release. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] After Insert or Update Trigger Issues!

2005-03-27 Thread Michael Fuhr
t-level trigger or an AFTER row-level trigger is always ignored; it may as well be null. http://www.postgresql.org/docs/8.0/interactive/triggers.html http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -

Re: [GENERAL] plpython function problem workaround

2005-03-27 Thread Michael Fuhr
On Fri, Mar 18, 2005 at 10:12:05PM -0700, Michael Fuhr wrote: > > I just submitted a small patch to convert CRLF => LF, CR => LF. This patch is in 8.0.2beta1, so PL/Python users might want to test it before 8.0.2 is released. See the recent "8.0.2 Beta Available&quo

Re: [GENERAL] Linux Filesystem for PG

2005-03-27 Thread Michael Fuhr
angement avoids problems on platforms that have file size limitations. http://www.postgresql.org/docs/8.0/interactive/storage.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] Linux Filesystem for PG

2005-03-27 Thread Michael Fuhr
2. Unless my memory fails me, it died trying to load the data into > the table. The 7.2 source code appears to have this logic; I don't know if there are any problems with it. "It died" doesn't mean much -- a load could have failed for a number of reasons, so without the e

Re: [GENERAL] problem with set autocommit to off

2005-03-28 Thread Michael Fuhr
O OFF is no longer supported Server-side autocommit was removed in 7.4 so now it's just a client-side behavior. In psql you can use "\set AUTOCOMMIT off"; otherwise see the documentation for your client interface. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [GENERAL] Can't pg_dumpall, claims database exists twice

2005-03-28 Thread Michael Fuhr
datfrozenxid FROM pg_database ORDER BY datname, oid; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] Merging item codes using referential integrity

2005-03-28 Thread Michael Fuhr
xists, so he gets a duplicate key error. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your mess

Re: [GENERAL] Table partition for very large table

2005-03-28 Thread Michael Fuhr
he problem before guessing how to fix it. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] 8.0.2beta1

2005-03-29 Thread Michael Fuhr
t; somebody help me? > > Unfortunately we haven't prepared release notes yet. For the gory details, you could search for "REL8_0_STABLE" in the pgsql-committers archives for the last few months. http://archives.postgresql.org/ -- Michael Fuhr http://www

Re: [GENERAL] Postgres mystery

2005-03-29 Thread Michael Fuhr
x27;',''||quote_literal(RECORDNAME.column2)||'')''; One of the operands to || is probably NULL, so the entire INSERT string ends up being NULL. Example: SELECT 'abc' || 'def'; ?column? -- abcdef (1 row) S

Re: [GENERAL] Debugging deadlocks

2005-03-30 Thread Michael Fuhr
On Wed, Mar 30, 2005 at 10:59:52PM +0200, [EMAIL PROTECTED] wrote: > On Sun, Mar 27, 2005 at 01:37:44AM -0700, Michael Fuhr wrote: > > The current implementation supports only > > exclusive row-level locks (SELECT FOR UPDATE), but I think Alvaro > > might be working on shared

Re: [GENERAL] plpgsql array initialization, what's the story?

2005-03-31 Thread Michael Fuhr
ELECT foo(); foo - {1,2,3} (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] table permissions

2005-03-31 Thread Michael Fuhr
tors" chapter of the documentation. Here's a link to the latest version: http://www.postgresql.org/docs/8.0/interactive/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [GENERAL] SELECT INTO Array?

2005-03-31 Thread Michael Fuhr
Selecting multiple columns into an array doesn't work in SQL or PL/pgSQL -- that could cause problems in the general case because columns might have different types and arrays contain elements of the same type. However, some other languages' interfaces to PostgreSQL can re

Re: [GENERAL] inherited type

2005-04-01 Thread Michael Fuhr
--+- parent | 1 child | 2 (2 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] Postgres order by into a RECORD, not ordering

2005-04-01 Thread Michael Fuhr
aybe somebody can explain what's wrong. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

Re: [GENERAL] SELECT INTO Array?

2005-04-01 Thread Michael Fuhr
ions if we knew the "what" rather than focusing on a particular "how." -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] join error?

2005-04-02 Thread Michael Fuhr
ot; chapter in the documentation for more info. http://www.postgresql.org/docs/8.0/interactive/runtime-config.html#GUC-ADD-MISSING-FROM There's been a proposal to disable add_missing_from by default in a future version of PostgreSQL. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] Debugging deadlocks

2005-04-02 Thread Michael Fuhr
= 'fruit'::regtype; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message c

Re: [GENERAL] How to copy from Table to table

2005-04-02 Thread Michael Fuhr
hen you can use TRUNCATE or DELETE to empty it, then INSERT ... SELECT to insert the results of a query. Another possibility would be to DROP the table and use CREATE TABLE AS or SELECT INTO, but then you'd have to recreate any indexes, constraints, triggers, etc. -- Michael

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread Michael Fuhr
On Mon, Apr 04, 2005 at 11:18:08AM +0400, go wrote: > > Tell me please is there any way to dump data from current session > (instead of using pg_dump) ? What exactly are you trying to do? Will COPY (or psql's \copy) do what you want? -- Michael Fuhr http://www.f

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread Michael Fuhr
in a procedural language like PL/Perl, PL/Python, or PL/Tcl that runs pg_dump, but why do you need to do this from SQL? Why can't you just run pg_dump from outside the database? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)---

Re: [GENERAL] How to dump data from database?

2005-04-04 Thread Michael Fuhr
L? Why can't you just run pg_dump from > MF> outside the database? > > Pls, write a small sample of the function . Could you tell us why you want to run pg_dump from SQL? What problem are you trying to solve? -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] contrib/dbsize

2005-04-05 Thread Michael Fuhr
elation_size() correctly showed the on-disk size of the file that stores the index. Are you expecting something different? Or have you found a case where relation_size() returns the wrong value? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] contrib/dbsize

2005-04-05 Thread Michael Fuhr
, compiled by GCC gcc (GCC) 3.4.2 (1 row) test=> SELECT relation_size('pg_am_oid_index'); relation_size --- 16384 (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] contrib/dbsize

2005-04-05 Thread Michael Fuhr
On Tue, Apr 05, 2005 at 01:43:56PM -0400, Joseph Shraibman wrote: > > Can I take the new .c file, do a make install, and have it work in 7.4.7 ? Not unmodified, since it uses features new to 8.0 (e.g., tablespaces). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(

Re: [GENERAL] client interfaces

2005-04-12 Thread Michael Fuhr
(AF_UNIX) sockets if your system does. They still use the socket interface, but they're typically faster than a TCP connection. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] psql performance

2005-04-14 Thread Michael Fuhr
orks: http://www.postgresql.org/docs/7.4/interactive/queries-union.html "Furthermore, it eliminates all duplicate rows, in the sense of DISTINCT, unless UNION ALL is used." -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Division by zero

2005-04-16 Thread Michael Fuhr
l that function instead of using the / operator. I'd avoid any temptation to change the behavior of the operator itself because that could cause problems in other code that isn't expecting it. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [GENERAL] Help with a plperl function

2005-04-18 Thread Michael Fuhr
= $rv->{rows}[$rn]; push @$res, {item_id => $row->{item_id}, description => $row->{item_descr}, order_date => $row->{start_date}}; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [GENERAL] How to include "EXCEPTION" handling block in PL/TCL function.

2005-04-18 Thread Michael Fuhr
ails, especially section 4.2 SMTP Replies and section 4.3 Sequencing of Commands and Replies: ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searche

Re: [GENERAL] "pltcl" function.

2005-04-18 Thread Michael Fuhr
this error: > > ERROR: wrong # args: should be "set varName ?newValue?" You're mixing languages: you're using the SQL concatenation operator (||) in a Tcl function. See a Tcl reference for the details of Tcl syntax. The following should work: set var "SENDING EMAIL

Re: [GENERAL] Datatypes in PL/PSQL functions with multiple arguments

2005-04-19 Thread Michael Fuhr
ents. Please post an example of what you're doing: a simple function, how you're invoking it, and the error message(s). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] What means Postgres?

2005-04-19 Thread Michael Fuhr
ive/history.html According to "The design of POSTGRES" by Stonebreaker and Rowe, POSTGRES means "POST inGRES" (the successor to INGRES). Various other sources say that INGRES means "INteractive Graphics (and) REtrieval System." -- Michael Fuhr http://www.fuhr.o

Re: [GENERAL] substring and POSIX re's

2005-04-19 Thread Michael Fuhr
hem in 7.3.9, 7.4.7, 8.0.2, or 8.1devel. What's different about your 7.4 installation? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command

Re: [GENERAL] substring and POSIX re's

2005-04-19 Thread Michael Fuhr
On Tue, Apr 19, 2005 at 12:39:52PM -0400, Alvaro Herrera wrote: > On Tue, Apr 19, 2005 at 10:03:45AM -0600, Michael Fuhr wrote: > > On Tue, Apr 19, 2005 at 11:17:46AM -0500, Don Isgitt wrote: > > > > > > Thanks, Tom. Interestingly enough, neither my original query o

Re: [GENERAL] lots of puzzling log messages

2005-04-20 Thread Michael Fuhr
doing it under the hood. If you're logging queries then you should be able to figure out where this is happening in the application. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through

Re: [GENERAL] Regular expression. How to disable ALL meta-character in a regular expression

2005-04-20 Thread Michael Fuhr
'; ?column? -- f (1 row) SELECT 'test[* string' ~ '***=test[*'; ?column? -- t (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-21 Thread Michael Fuhr
akes a zone-less time stamp and interprets it as UTC time to produce a UTC time stamp, which is then rotated to PDT (UTC-7) for display. Perhaps this is what you want: SELECT timezone('UTC', timeofday()::timestamptz); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-21 Thread Michael Fuhr
ting it to timestamptz puts it in your local time zone: SELECT '2005-04-21 23:25:12.868212'::timestamptz; timestamptz --- 2005-04-21 23:25:12.868212-07 (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(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] Record as a parameter to a function

2005-04-21 Thread Michael Fuhr
test=> INSERT INTO test (c1) VALUES ('Test'); NOTICE: Test INSERT 0 1 Hope this helps. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-21 Thread Michael Fuhr
21 15:00:00-07', 'PST8PDT') AS pacific, tzconvert('2005-04-21 15:00:00-07', 'UTC') AS utc; pacific | utc ----+ 2005-04-21 15:00:00-07 | 2005-04-21 22:00:00+00 (1 row) Maybe somebody knows of an easier way to do that. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Table modifications with dependent views - best practices?

2005-04-21 Thread Michael Fuhr
ons: so that a mistake doesn't leave me with half-done work (any error will cause the entire transaction to roll back), and to make the changes atomic for the benefit of other transactions. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] Regular expression. How to disable ALL meta-character

2005-04-21 Thread Michael Fuhr
7;) in lower('aBcDeF')); position -- 0 (1 row) You might also want to look at the contrib/pg_trgm module to see if it would be useful. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] listing all tables

2005-04-21 Thread Michael Fuhr
resql.org/docs/8.0/interactive/catalogs.html http://www.postgresql.org/docs/8.0/interactive/information-schema.html One way to learn more about the system catalogs is to run "psql -E" or execute "\set ECHO_HIDDEN" from within psql so you can see the queries psql sends for commands like

Re: [GENERAL] Table modifications with dependent views - best practices?

2005-04-22 Thread Michael Fuhr
s back, then nobody else will ever have seen the changes; if it commits then the changes all become visible at the same time. Try it and see what happens. You might see blocking and you might be able to cause deadlock, but you shouldn't ever see some changes but not

Re: [GENERAL] Record as a parameter to a function

2005-04-22 Thread Michael Fuhr
On Fri, Apr 22, 2005 at 03:31:59AM +0100, Carlos Correia wrote: > Michael Fuhr wrote: > | On Fri, Apr 22, 2005 at 01:44:24AM +0100, Carlos Correia wrote: > | > |>carlos=# insert into test (c1) values( 'test'); > |>ERROR: NEW used in query that is not in a rule

Re: [GENERAL] Table modifications with dependent views - best practices?

2005-04-23 Thread Michael Fuhr
a lock that conflicts with T1's lock on foo. Both transactions are waiting for the other to release a lock, so we get deadlock. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] pg_dump serial UNIQUE NOT NULL PRIMARY KEY

2005-04-22 Thread Michael Fuhr
E ONLY cases ADD CONSTRAINT cases_pkey PRIMARY KEY (id); Presumably that's because adding the primary key constraint after populating the table is more efficient than populating the table with the constraint (and the associated index) in place. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -

Re: [GENERAL] [Question]batch execute sql command

2005-04-24 Thread Michael Fuhr
"psql -f filename" or, if your shell supports redirection, "psql < filename". See the psql documentation for details: http://www.postgresql.org/docs/8.0/interactive/app-psql.html If that's not what you're looking for, then please provide more informatio

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-24 Thread Michael Fuhr
21 22:00:00+00 > > Doesn't "at time zone" do what you need ? Not as far as I can tell, because if the result is timestamp with time zone then it's rotated to the local time zone for display. If you can post a counterexample then I'd b

Re: [GENERAL] timezone() with timeofday() converts the wrong direction?

2005-04-24 Thread Michael Fuhr
SET show time zone; TimeZone -- 02:00:00 (1 row) insert into test (f) values (now()); INSERT 0 1 SELECT * from test; f -- 2005-04-25 00:28:33.34721+02 (1 row) select f, f::timestamp at time zone

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