Re: [GENERAL] temp_buffers

2005-08-30 Thread Michael Fuhr
ntation. Here's a link to the beta documentation: http://developer.postgresql.org/docs/postgres/runtime-config.html -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose a

Re: [GENERAL] update functions locking tables

2005-08-30 Thread Michael Fuhr
is acquired no other transactions will be able to access the table until this transaction commits or rolls back. DELETE is slower than TRUNCATE but it won't block readers in other transactions. -- Michael Fuhr ---(end of broadcast)--- TIP 4:

Re: [GENERAL] detection of VACUUM in progress

2005-08-30 Thread Michael Fuhr
- the table might become available immediately after you decide that it isn't. What problem are you trying to solve? If we knew what you're really trying to do then we might be able to make suggestions. -- Michael Fuhr ---(end of broadcast)

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

2005-08-30 Thread Michael Fuhr
On Tue, Aug 30, 2005 at 10:40:26AM -0700, vishal saberwal wrote: > Root user: > /root/.postgressql: Is this the actual directory name? It's misspelled: it should be ".postgresql", not ".postgressql". -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] Help with SPI...

2005-08-30 Thread Michael Fuhr
t know the length of the string with the scape characters > added. You could use SPI_prepare() and SPI_execp() without having to transform the bytea value into a string; see the SPI documentation and look around for examples that use numbered parameters ($1, $2, etc.

Re: [GENERAL] newbie - postgresql or mysql

2005-08-31 Thread Michael Fuhr
ple of links you might want to read are: http://sql-info.de/mysql/gotchas.html http://sql-info.de/postgresql/postgres-gotchas.html -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] newbie - postgresql or mysql

2005-08-31 Thread Michael Fuhr
10:50:02'), > >> (6, 'Hardware - Terminal', 2, '2004-10-12 10:50:02'), PostgreSQL doesn't support this form of INSERT; you'll have to use a separate INSERT per record or use COPY. Another method, although probably not useful in this

Re: [GENERAL] Problem running or executing a function in Postgresql

2005-09-01 Thread Michael Fuhr
sults from EXECUTE. Aside from that, EXECUTE isn't necessary in this case. Try this: new_id := currval(''mydata_id_seq''); -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] newbie - postgresql or mysql

2005-09-01 Thread Michael Fuhr
rote: > On Wed, 31 Aug 2005, Michael Fuhr wrote: > >On Wed, Aug 31, 2005 at 03:17:29PM -0400, Frank wrote: > >>>>insert into category values > >>>>(4, 'Hardware - Monitor', 2, '2004-10-12 10:50:01'), > >>>>(5, 'Hardware

Re: [GENERAL] Order By for aggregate functions (Simulating Group_concat)

2005-09-01 Thread Michael Fuhr
aintained as rows are fed to the aggregate, or is that just an accident of the current implementation? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Don't understand transaction error

2005-09-01 Thread Michael Fuhr
n you should be able to find out which command failed and why. -- 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

Re: [GENERAL] Schema problems RedHat / SuSE 9.3 for version 7.4.8

2005-09-01 Thread Michael Fuhr
the last argument to set_config(). > I can reproduce the result not only from my own code, but also from psql. Are you saying that the query works as expected with psql on the old server, but not on the new server? If you run "\set" in psql, what are the two servers

Re: [GENERAL] query

2005-09-01 Thread Michael Fuhr
fetch the entire remote result set before the local database could do any restrictions. In some cases, however, it can be worthwhile to call dblink directly with an appropriate WHERE clause in the query string. -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] Schema problems RedHat / SuSE 9.3 for version 7.4.8

2005-09-01 Thread Michael Fuhr
to connect to both servers? > OK, next question, how do I get rid of the autocommit in my application? I > tried set autocommit to off; but that is deprecated. Using "SET autocommit" attempts to change the server-side setting, which was only supported in 7.3 (the developers removed it after deciding it had been a bad idea). How to disable autocommit on the client side depends on your client interface. What language and API are you using? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Trouble with bytea in SPI...

2005-09-01 Thread Michael Fuhr
hints that something's wrong here). Try something like this: Datum values[1]; values[0] = PointerGetDatum(val); ret = SPI_execp(plan, values, NULL, 1); That works for me in simple tests. If anybody sees a problem with it then please make corrections. -- Michael Fuhr -

Re: [GENERAL] Question regarding FOUND

2005-09-02 Thread Michael Fuhr
On Fri, Sep 02, 2005 at 08:51:41AM -0400, Terry Lee Tucker wrote: > > Will the FOUND variable be set, when using EXECUTE, as it would be with a > normal UPDATE statement? What happened when you tried it? -- Michael Fuhr ---(end of

Re: [GENERAL] LOG: unexpected EOF within message length word

2005-09-02 Thread Michael Fuhr
ed a debugger or process trace to see what the program is doing? -- 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] Check if SELECT is granted

2005-09-02 Thread Michael Fuhr
ege("unknown", "unknown") does not exist > HINT: No function matches the given name and argument types. You may > need to add explicit type casts. It helps if you spell "privilege" correctly ;-) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Schema overlay question

2005-09-02 Thread Michael Fuhr
ot;overlay"? As far as the database is concerned, you can create tables any time you want: today, tomorrow, or a year from now. Is there some specific case you're concerned about? If so then please elaborate. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Schema overlay question

2005-09-02 Thread Michael Fuhr
and use another set of tables. Apparently there's something about creating that later set of tables that concerns you, but we don't know what that concern is based on. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked

Re: [GENERAL] LOG: unexpected EOF within message length word

2005-09-02 Thread Michael Fuhr
If the latter, have you run a sniffer on the connection to see if it shows anything unusual (e.g., a closed window)? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] LOG: unexpected EOF within message length word

2005-09-03 Thread Michael Fuhr
d. How long did you wait before killing the client? What does a trace on the server process show when the client is blocked? What does a trace of the same client code on a PA machine (one that works) show? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Schema problems RedHat / SuSE 9.3 for version 7.4.8

2005-09-03 Thread Michael Fuhr
, you can use psql's \z command to see permissions (you might need use "\z schemaname." or set your search_path to see what you're interested in). -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] concatenate text

2005-09-04 Thread Michael Fuhr
('Carol'); INSERT INTO foo VALUES ('Dave'); SELECT array_to_string(ARRAY(SELECT name FROM foo), ''); array_to_string --- AliceBobCarolDave (1 row) If you need an aggregate then search the archives; examples have been posted before. -- Michae

Re: [GENERAL] Basic locking question

2005-09-06 Thread Michael Fuhr
LATILE STRICT; This function should handle race conditions, and it should only block when multiple transactions try to insert the same key. If the key already exists then the expensive exception-handling code won't be entered. Alternatively, you could try the INSERT first and then

Re: [GENERAL] back references using regex

2005-09-07 Thread Michael Fuhr
o three 4 | one two three 5 | one two three 6 | one two three (6 rows) In PostgreSQL 7.4 and later you could shorten the regular expression: SELECT id, substring(content FROM '((\\S+\\s*){1,3})') FROM article; If this example isn't what you&#

Re: [GENERAL] back references using regex

2005-09-07 Thread Michael Fuhr
) FROM article; See "String Functions and Operators" and "Pattern Matching" in the documentation for more information. If you need to get fancy then consider writing a function in a language like PL/Perl. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] Partial commit within the trasaction

2005-09-08 Thread Michael Fuhr
ved? One way would be to use contrib/dblink to open another connection to the database so the status messages could be inserted in a separate transaction. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] back references using regex

2005-09-08 Thread Michael Fuhr
theses (i.e., the subexpression with the second opening parenthesis); the outer set is used here for capturing. And again, note the escaped backslashes because we're using ordinary quotes. With dollar quotes the above query would be: SELECT substring('abc.foo.foo.xyz' FROM $$(([[:alp

Re: [GENERAL] Partial commit within the trasaction

2005-09-08 Thread Michael Fuhr
On Thu, Sep 08, 2005 at 03:39:50PM +0200, Bohdan Linda wrote: > On Thu, Sep 08, 2005 at 02:53:47PM +0200, Michael Fuhr wrote: > > One way would be to use contrib/dblink to open another connection > > to the database so the status messages could be inserted in a > > separate t

Re: [GENERAL] back references using regex

2005-09-08 Thread Michael Fuhr
here's ample material covering them elsewhere. See for example _Mastering Regular Expressions_ by Jeffrey Friedl. I'm sure a search engine would yield many free tutorials on the subject. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] back references using regex

2005-09-08 Thread Michael Fuhr
xtract multiple items. CREATE TABLE foo (t text); INSERT INTO foo VALUES ('one.two.three.four.five.six.'); SELECT (string_to_array(t, '.'))[3:5] FROM foo; string_to_array --- {three,four,five} (1 row) SELECT array_to_string((string_to_array(t, '.&#x

Re: [GENERAL] Is this a bug or am I doing something wrong?

2005-09-09 Thread Michael Fuhr
only tried it once? When it's (apparently) hung, what output do you get if you run the following query in another session? SELECT relation::regclass, * FROM pg_locks; What version of PostgreSQL are you using? -- Michael Fuhr ---(end of broadcast)--- T

Re: [GENERAL] Partial commit within the trasaction

2005-09-09 Thread Michael Fuhr
On Thu, Sep 08, 2005 at 05:35:40PM +0200, Bohdan Linda wrote: > On Thu, Sep 08, 2005 at 04:35:51PM +0200, Michael Fuhr wrote: > > On Thu, Sep 08, 2005 at 03:39:50PM +0200, Bohdan Linda wrote: > > commit it now." You have to do some extra bookkeeping and you can't &g

Re: [GENERAL] constraints on composite types

2005-09-09 Thread Michael Fuhr
On Fri, Sep 09, 2005 at 10:39:58AM -0400, Tom Lane wrote: > I don't believe you need the function -- this should be enough: > > CREATE UNIQUE INDEX t1_b_uniq ON t1 ((attr.foo)); I was expecting that to work too, but it doesn't: ERROR: relation "attr" doe

Re: [GENERAL] constraints on composite types

2005-09-09 Thread Michael Fuhr
need that schema-qualified as well, IOW (schema.table.col).subcol This works: CREATE UNIQUE INDEX t1_b_uniq ON t1 (((attr).foo)); -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] ecpg -C INFORMIX

2005-09-09 Thread Michael Fuhr
xit status > make: *** [temp_fcstPg] Error 1 Try linking with -lecpg_compat instead of -lecpg. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] ERROR: bogus varno

2005-09-09 Thread Michael Fuhr
roblem, report it to pgsql-hackers. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] ERROR: bogus varno

2005-09-09 Thread Michael Fuhr
On Fri, Sep 09, 2005 at 03:50:28PM -0600, Michael Fuhr wrote: > Grab the latest code from CVS or wait until 8.1beta2 comes out. It looks like snapshots are available here: http://www.postgresql.org/ftp/dev/ -- Michael Fuhr ---(end of broadc

Re: [GENERAL] back references using regex

2005-09-10 Thread Michael Fuhr
anything that matches the same regular expression. Usenet junkies might find it amusing to use back references to search their new server's list of newsgroups: egrep '([^.]+)\.\1\.\1' newsgroups -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] back references using regex

2005-09-10 Thread Michael Fuhr
e in the RE. Subexpressions are numbered in the order of their leading parentheses. Non-capturing parentheses do not define subexpressions. http://www.postgresql.org/docs/8.0/static/functions-matching.html#POSIX-ESCAPE-SEQUENCES -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] Tricky SELECT question involving subqueries

2005-09-10 Thread Michael Fuhr
istory (filespec) VALUES ('abc.def.123.456'); INSERT INTO changehistory (filespec) VALUES ('ghi.jkl.789'); SELECT t.pathname, count(c.*) FROM trackedpaths AS t LEFT OUTER JOIN changehistory AS c ON c.filespec <@ t.pathname GROUP BY t.pathname ORDER BY t.pathname; pathname

Re: [GENERAL] back references using regex

2005-09-11 Thread Michael Fuhr
might be interested in following the discussion, either to learn from it or to provide answers, might miss it if the new topic hijacks an old thread. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] list manipulation at column level

2005-09-11 Thread Michael Fuhr
- [0:7]={foo,some,values,in,a,list,12,34} (1 row) SELECT array_append(a, 'foo') FROM foo; array_append --- {some,values,in,a,list,12,34,foo} (1 row) SELECT array_cat(a[1:2], a[6:7]) FRO

Re: [GENERAL] If an index is based on 3 columns will a query using two of the columns utilize the index?

2005-09-12 Thread Michael Fuhr
ill* use it) then you could execute "SET enable_seqscan TO off" and then run EXPLAIN (don't forget to RESET enable_seqscan or SET it back to "on" when you're done testing). -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] If an index is based on 3 columns will a query using two of the columns utilize the index?

2005-09-12 Thread Michael Fuhr
'first' element of the index? In released versions of PostgreSQL, yes. Version 8.1 will remove that restriction. -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to c

Re: [GENERAL] how to list rules?

2005-09-14 Thread Michael Fuhr
ows a table's rules; otherwise you could query the pg_rules system view. http://www.postgresql.org/docs/8.0/interactive/view-pg-rules.html -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] Deadlock

2005-09-15 Thread Michael Fuhr
r so) What are the symptoms of this "freeze"? Do only some queries block? Do all queries block, even queries such as "SELECT now()"? Are you able to connect to the database at all? If you can connect, have you examined pg_locks? If you can't connect, have you done a

Re: [GENERAL] Deadlock

2005-09-15 Thread Michael Fuhr
r locks that haven't been granted, then look for the process that holds locks on that table and see what that process is doing. If that doesn't help track down the problem then you might need to log every statement so you can see exactly who is doing what. -- Michael Fuhr -

Re: [GENERAL] Create a pg table from CSV with header rows

2005-09-15 Thread Michael Fuhr
, then issue a COPY command and send the rest of the file. Determining the columns' data types would be a different matter: if they weren't specified in the header then you'd have to guess or perhaps make them all text. -- Michael Fuhr ---

Re: [GENERAL] pg_ctl reload breaks our client

2005-09-16 Thread Michael Fuhr
oblem? What version of PostgreSQL are you using, and on what platform? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] pg_ctl reload breaks our client

2005-09-16 Thread Michael Fuhr
start will terminate client connections, but a reload shouldn't. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] pg_ctl reload breaks our client

2005-09-16 Thread Michael Fuhr
On Fri, Sep 16, 2005 at 04:34:46PM -0700, Marc Munro wrote: > On Fri, 2005-09-16 at 17:10 -0600, Michael Fuhr wrote: > > Can you reproduce the problem with a reload? A stop and start will > > terminate client connections, but a reload shouldn't. > > This is not current

Re: [GENERAL] Divide a float4 by 1 - what is going on???????

2005-09-16 Thread Michael Fuhr
olumn? ------ 2.45668 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] PDF Documentation?

2005-09-17 Thread Michael Fuhr
On Sat, Sep 17, 2005 at 06:45:35PM -0700, Warren Bell wrote: > Is there a pdf version of the documentation ? I find HTML version much > harder to read than a printed copy. Look under Documentation -> Manuals on the PostgreSQL web site. http://www.postgresql.org/ -- Mic

Re: [GENERAL] Contraint Trigger Permissions

2005-09-17 Thread Michael Fuhr
s the error message? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] How to modify a tuple returned by SPI_copytuple?

2005-09-19 Thread Michael Fuhr
you want? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] plperl function to return nulls

2005-09-19 Thread Michael Fuhr
://www.postgresql.org/docs/8.0/interactive/plperl.html Is that what you're looking for? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Problem with libpq3 & postgresql8

2005-09-21 Thread Michael Fuhr
ck? Have you used a debugger or added print statements immediately before and after the connection attempt? Have you done a process trace or network sniff to see what's happening when the program hangs? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] returning the primary key value

2005-09-21 Thread Michael Fuhr
SERIAL insert?" in the FAQ: http://www.postgresql.org/docs/faqs.FAQ.html#4.11.2 -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] date_trunc('week', '2005-01-01'::TIMESTAMP)

2005-09-22 Thread Michael Fuhr
Which version? This bug was fixed in 8.0.2: http://archives.postgresql.org/pgsql-committers/2005-04/msg8.php A similar bug is fixed in CVS, so it'll be in 8.0.4: http://archives.postgresql.org/pgsql-committers/2005-07/msg00144.php -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] ORDER BY results

2005-09-22 Thread Michael Fuhr
riginal location (read up on MVCC to see how this works). -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] SQL command to dump the contents of table failed: PQendcopy() failed. Error message from server: socket not open

2005-09-23 Thread Michael Fuhr
dumps elsewhere) -- can you use a debugger to get a stack trace from it? What exact version of PostgreSQL are you running and on what operating system? Do you have any non-standard extensions to PostgreSQL (custom types, third-party modules, etc.)? -- Michael Fuhr ---(

Re: [GENERAL] COPY - permission denied

2005-09-23 Thread Michael Fuhr
the user postgres. I am > logged into to psql as postgres. The files are owned > by postgres and are -rw---. They are being found - > it isn't a "file not found" error. Have you checked the permissions on the parent directory, the grandparent directory, etc.? -- M

Re: [GENERAL] SQL command to dump the contents of table failed: PQendcopy() failed. Error message from server: socket not open

2005-09-23 Thread Michael Fuhr
;\d tablename" show for the table in question? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] question about to return two diferent tables from a function

2005-09-23 Thread Michael Fuhr
005-09-22| 31 This doesn't look like a join of the two tables; it looks instead like a union. Is this the query you're looking for? SELECT doc, date, id_customer AS id FROM first_one UNION ALL SELECT doc, date, id_code AS id FROM second_one; -- Michael Fuhr ---

Re: [GENERAL] int values from PQExecParams in binary result mode

2005-10-03 Thread Michael Fuhr
or me (error and NULL checking omitted): res = PQexecParams(conn, "SELECT 123456::integer", 0, NULL, NULL, NULL, NULL, 1); ival = ntohl(*(int *)PQgetvalue(res, 0, 0)); -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Or selection on index versus union

2005-10-04 Thread Michael Fuhr
LAIN ANALYZE SELECT something FROM foo WHERE fase = '1' OR fase = '2'; SHOW random_page_cost; SHOW effective_cache_size; SELECT version(); \x SELECT * FROM pg_stats WHERE tablename = 'foo' AND attname = 'fase'; BTW, pgsql-performance

Re: [GENERAL] Isolated transactions?

2005-10-04 Thread Michael Fuhr
INTO bar (id, fooid) VALUES (2, 1); then Transaction B will block even though there's no apparent conflict. This is a gotcha that can cause deadlock errors (8.1 will acquire a weaker lock, which should reduce the likelihood of deadlock). -- Michael Fuhr ---(end of

Re: [GENERAL] Syntax for use of point

2005-10-05 Thread Michael Fuhr
inside a box centered on the target point, then calculate the distance to only those points). PostGIS adds spatial features to PostgreSQL that allow such queries to use indexes so they can be fast even on large data sets. http://postgis.refractions.net/ -- Michael Fuhr ---

Re: [GENERAL] PostgreSQL 8.1 vs. MySQL 5.0?

2005-10-06 Thread Michael Fuhr
MySQL is MyISAM, which doesn't support foreign key contraints at all, but which will silently allow you to declare them. If you haven't changed the default table type, then you must remember to specify that you want an InnoDB table, or else your REFERENCES clauses are nothing but

Re: [GENERAL] PostgreSQL Gotchas

2005-10-06 Thread Michael Fuhr
ouple of days ago in the "Avoiding evaluating functions twice" thread: http://archives.postgresql.org/pgsql-general/2005-10/msg00107.php -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] SELECT FOR SHARE and FOR UPDATE

2005-10-07 Thread Michael Fuhr
owed for a single SELECT statement to include both FOR UPDATE and FOR SHARE, nor can different parts of the statement use both NOWAIT and normal waiting mode." -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] SELECT FOR SHARE and FOR UPDATE

2005-10-08 Thread Michael Fuhr
what you're doing? Maybe there's another way to achieve it. -- 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

Re: [GENERAL] Duplicate primary keys/rows

2005-10-09 Thread Michael Fuhr
E id >= 585 AND id <= 587; > Wow, how is this possible? I'm using PG 8.0.3 on > Windows XP. This computer has been crashing repeatedly > lately, if that could be blamed (bad memory? hard > disk? I haven't quite figured out why.) Faulty hardware

Re: [GENERAL] brain-teaser with CONSTRAINT - any SQL experts?

2005-10-09 Thread Michael Fuhr
y reference seems like a better solution. You could probably implement this without changing the structure of the existing table aside from adding the foreign key constraint and perhaps a trigger to automatically add records to the other table, so you shouldn't need any application changes

Re: [GENERAL] PostgreSQL 8.1 vs. MySQL 5.0?

2005-10-10 Thread Michael Fuhr
t deal of respect for both their technical abilities and the professionalism with which they run the project. I hope their employers appreciate what they've got. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] error in SELECT from store procedure

2005-10-10 Thread Michael Fuhr
ing a composite type and declaring employee to be of that type, and perhaps also declare the function to return that type. Another possibility would be to assign employee via a SELECT INTO statement. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Duplicate primary keys/rows

2005-10-10 Thread Michael Fuhr
On Mon, Oct 10, 2005 at 04:28:57PM -0400, Tom Lane wrote: > It's really highly annoying that we can't see the contents of the > infomasks for the rows. Any particular reason there isn't an infomask system column? -- Michael Fuhr ---

Re: [GENERAL] exceptions

2005-10-11 Thread Michael Fuhr
ows don't raise a "no data" exception. To check whether any rows were returned you can use FOUND in an ordinary IF statement. -- 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] \dD does not show check constraint for domain on version 8.0.4?

2005-10-11 Thread Michael Fuhr
tch was not applied to PostgreSQL version 8.0.4 Point releases (e.g., 8.0.3 to 8.0.4) generally have only bug fixes and conservative changes, not new features. The pgsql-committers archives show this patch being applied only to the development code that's now becoming 8.1. -- Michael Fuhr

Re: [GENERAL] Row level locking

2005-10-12 Thread Michael Fuhr
ocks to show tuple locks in certain cases but it won't show all tuple locks. Why do you want to know? What are you trying to do? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Row level locking

2005-10-12 Thread Michael Fuhr
Is that right? Have you investigated what's causing the blocking? Do the rows you're inserting have foreign key references? Let's find out what the problem is before suggesting how to solve it. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] How to track exceptions in PL/pgSQL

2005-10-12 Thread Michael Fuhr
on you were handling. > 2. How can I trace the exception in a table although an implicit > rollback is done when a exception occurs (the trace will be rollbacked > too) ? You should be able do inserts from the handler code. It worked for me in simple tests, so apparently the

Re: [GENERAL] Limitations of PostgreSQL

2005-10-12 Thread Michael Fuhr
t; SELECT INTERVAL(10, 1, 10, 100, 1000); -> 2 mysql> SELECT INTERVAL(22, 23, 30, 44, 200); -> 0 -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Row level locking

2005-10-13 Thread Michael Fuhr
;re using 8.0 or later then you could use a savepoint to roll back a timed-out operation without aborting the entire transaction. If that doesn't help then perhaps you could give us a higher-level description of the problem you're trying to solve. -- Michael Fuh

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-19 Thread Michael Fuhr
perlu IMMUTABLE STRICT; You could then do something like: SELECT * FROM foo WHERE NOT is_valid_email(email_address); Again, be aware that passing this or any other test doesn't necessarily mean that an address is truly valid -- it's just an attempt to identify addresses that are obvi

Re: [GENERAL] NULL != text ?

2005-10-19 Thread Michael Fuhr
column? -- (1 row) test=> SELECT NULL IS DISTINCT FROM 'abc'; ?column? -- t (1 row) test=> SELECT NULL IS DISTINCT FROM NULL; ?column? -- f (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] NULL != text ?

2005-10-20 Thread Michael Fuhr
On Thu, Oct 20, 2005 at 03:57:41PM +0900, Michael Glaesemann wrote: > On Oct 20, 2005, at 15:44 , Michael Fuhr wrote: > > expression IS DISTINCT FROM expression > > > > For non-null inputs this is the same as the <> operator. However, > > when both inputs a

Re: [GENERAL] Tables

2005-10-20 Thread Michael Fuhr
ly also want a foreign key constraint in table 2. http://www.postgresql.org/docs/8.0/interactive/tutorial-fk.html http://www.postgresql.org/docs/8.0/interactive/ddl-constraints.html#DDL-CONSTRAINTS-FK If that doesn't help then please provide more information. An example that illustrates

Re: [GENERAL] insert a value into a table

2005-10-21 Thread Michael Fuhr
and take particular note of what it says regarding backslashes: http://www.postgresql.org/docs/8.0/interactive/sql-syntax.html#SQL-SYNTAX-CONSTANTS -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-21 Thread Michael Fuhr
bc' ~ 'a\\.c'; ?column? -- f (1 row) test=> SELECT 'a.c' ~ 'a\\.c'; ?column? -- t (1 row) test=> SELECT 'abc' ~ $$a\.c$$; ?column? -- f (1 row) test=> SELECT 'a.c' ~ $$a\.c$$; ?column? -- t (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-21 Thread Michael Fuhr
ve regular expression considers the following address valid: [EMAIL PROTECTED] Even with that correction the regular expression is still wrong, especially the [EMAIL PROTECTED]@ part at the beginning. See this group's archives and numerous other sources for further discussion on th

Re: [GENERAL] Large Table Performance

2005-10-21 Thread Michael Fuhr
t for the date and maybe the transaction_status columns. Or you might just need to analyze the table to update its statistics, and possibly vacuum it to get rid of dead tuples. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-22 Thread Michael Fuhr
function do any error trapping? Maybe you need GetTopTransactionId() instead of GetCurrentTransactionID(). Why do you need the transaction ID at all? Might the xmin system column serve your purpose? -- Michael Fuhr ---(end of broadcast)--- TIP 1

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Michael Fuhr
tion. However, I can't say whether this will work for you without seeing your code. It would be easier for us to help -- and you'd get a solution sooner -- if you'd post a minimal but complete example that shows what you're doing and that exhibit

Re: [GENERAL] Transaction IDs not the same in same transaction?

2005-10-23 Thread Michael Fuhr
) code? Your first message suggests that somebody named Magnus might have sent it to you. If you don't have the means to build the code yourself then perhaps that person could help again. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] pg_dump, MVCC and consistency

2005-10-24 Thread Michael Fuhr
re of newly-created transactions due to wraparound. I'd have to dig into the source code to find out if that's possible, and if so, what happens. Maybe one of the developers will comment. -- Michael Fuhr ---(end of broadcast)--- TIP 1: i

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-24 Thread Michael Fuhr
tions: use text or varchar for the email address, don't embed newlines in the regular expression, and if you use dollar quotes and the regular expression ends with a dollar sign then quote with a character sequence other than $$. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Generic Q about max(id) vs ORDER BY ID DESC LIMIT 1

2005-10-24 Thread Michael Fuhr
x for MIN() or MAX() was to rewrite the query as SELECT col FROM tab ORDER BY col LIMIT 1. Index usage now happens automatically. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

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