Re: [GENERAL] Data corruption zero a file - help!!

2006-03-08 Thread Michael Fuhr
" and "invalid memory alloc request size"; but "invalid page header in block" means the block itself is bad. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Data corruption zero a file - help!!

2006-03-08 Thread Michael Fuhr
the PostgreSQL web site (Community -> In The Real World -> Case studies). http://www.postgresql.org/about/casestudies/ Some users and potential users might be interested in reading about how you're using PostgreSQL with a 100G+ database. Post a message to pgsql-www if yo

Re: [GENERAL] view creation question

2006-03-09 Thread Michael Fuhr
> > Is there some way to wrap these two independent queries in a "CREATE VIEW > myview AS" statement? Use UNION or UNION ALL. http://www.postgresql.org/docs/8.1/interactive/queries-union.html -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] NULL TIMESTAM problem

2006-03-09 Thread Michael Fuhr
s a NULL option that allows you to specify what string should be interpreted as NULL. Recent versions also have a CSV option that interprets empty strings as NULL. http://www.postgresql.org/docs/8.1/interactive/sql-copy.html (Use the documentation for whatever version you're runn

Re: [GENERAL] Data corruption zero a file - help!!

2006-03-09 Thread Michael Fuhr
NING: invalid page header in block 30 of relation "foo"; zeroing out page count --- 9445 (1 row) test=# set zero_damaged_pages to off; SET -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Baffled by failure to use index when WHERE uses a function

2006-03-10 Thread Michael Fuhr
e documentation. http://www.postgresql.org/docs/8.1/interactive/xfunc-volatility.html -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so

Re: [GENERAL] Creating a function that acept any data type

2006-03-10 Thread Michael Fuhr
test=> SELECT ifnull('abc', 'xyz'::text); ifnull ---- abc (1 row) test=> SELECT ifnull(NULL, 'xyz'::text); ifnull xyz (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Schema is Missing

2006-03-10 Thread Michael Fuhr
that time? Any hardware problems? Full disk? Has anything else out of the ordinary happened on that system lately? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Possible infinite loop in query using bitmap scans

2006-03-13 Thread Michael Fuhr
g again? If so, after how long? How did you determine that the restart is relevant? Do you consistently see different (presumably better) performance after a restart than if you don't restart? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Dynamic function execution?

2006-03-14 Thread Michael Fuhr
alls to those functions with a first argument of PROCOID. Why do you need to do this? What problem are you trying to solve? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Utility of GRANT EXECUTE

2006-03-14 Thread Michael Fuhr
r1 You are now connected as new user "user1". test=> select foo(); foo - 1 (1 row) test=> \c - user2 You are now connected as new user "user2". test=> select foo(); ERROR: permission denied for function foo -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Utility of GRANT EXECUTE

2006-03-14 Thread Michael Fuhr
particular problem you're trying to solve? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Dynamic function execution?

2006-03-14 Thread Michael Fuhr
On Tue, Mar 14, 2006 at 07:21:51AM -0800, Nick Johnson wrote: > On 14/03/2006, at 12:05 AM, Michael Fuhr wrote: > >Why do you need to do this? What problem are you trying to solve? > > I want to associate Postgres functions with rows of a table (eg, a > table column of d

Re: [GENERAL] MIB for PostGReSQL

2006-03-26 Thread Michael Fuhr
maybe the author would be interested in ideas for expanding it. http://pgfoundry.org/projects/pgsnmpd/ -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] How to detect primary key of a table

2006-03-30 Thread Michael Fuhr
p://www.postgresql.org/docs/8.1/interactive/information-schema.html -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] RAISE function misuse ?

2006-04-04 Thread Michael Fuhr
Not in the sense of the code doing something it shouldn't. > 2. Is there a way to get rid of the output: > CONTEXT: SQL statement "SELECT hello()" > PL/pgSQL function "test" line 2 at perform test=> \set VERBOSITY terse test=&

Re: [GENERAL] About checking all dead lock tables

2006-04-06 Thread Michael Fuhr
tting). Perhaps you want to see pending or blocked lock attempts, i.e., locks that have been requested but are not yet acquired because another transaction holds a conflicting lock. If that's the case then look for rows in pg_locks where "granted" is false. -- Michael Fuhr ---

Re: [GENERAL] FAQ 1.1

2006-04-07 Thread Michael Fuhr
l-hackers/2005-04/msg00023.php -- 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] Expression matching related question

2006-04-09 Thread Michael Fuhr
te this in phppgadmin I'm told there is an error > around the = character in left=0. Can't seem to figure the syntax. If you're using reserved words like table, column, and left as identifiers then you'll need to double-quote them. Better yet, avoid using reserved words as ident

Re: [GENERAL] Last Commited Transaction

2006-04-11 Thread Michael Fuhr
On Tue, Apr 11, 2006 at 12:54:12PM +0100, Ricardo Manuel Pereira Vilaça wrote: > How I can determine information about the last committed transaction in > postgresql? What information are you looking for? What are you trying to do? -- Michael Fuhr ---(end of bro

Re: [GENERAL] Question about selecting rows

2006-04-15 Thread Michael Fuhr
http://www.postgresql.org/docs/8.1/interactive/sql-select.html#SQL-LIMIT -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] unique index on variable time

2006-04-16 Thread Michael Fuhr
and a custom comparison operator: http://archives.postgresql.org/pgsql-sql/2006-03/msg00055.php The warning about the code being only minimally tested still stands but maybe it'll give you some ideas. -- Michael Fuhr ---(end of broadcast)--- TIP

Re: [GENERAL] insert into a view?

2006-05-01 Thread Michael Fuhr
w.postgresql.org/docs/8.1/interactive/rules.html http://www.postgresql.org/docs/8.1/interactive/rules-update.html#RULES-UPDATE-VIEWS -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

Re: [GENERAL] shp2pgsql

2006-05-02 Thread Michael Fuhr
On Mon, May 01, 2006 at 03:03:24PM +0100, gouse shaik wrote: > I want source code of shp2pgsl. > Please provide link if available. shp2pgsql is part of PostGIS. http://www.postgis.org/ -- Michael Fuhr ---(end of broadcast)--- TIP

Re: [GENERAL] Getting relation/attribute names from inside UDT input/output function

2006-05-10 Thread Michael Fuhr
hy would the type's input function need to know that? 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] Getting relation/attribute names from inside UDT input/output function

2006-05-10 Thread Michael Fuhr
currently using the type and what you'd like to be able to do with it (e.g., a hypothetical table, data set, query, and query result)? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] pl/pgsql question

2006-05-12 Thread Michael Fuhr
do? Having the database invoke external actions isn't always a good idea; for example, if the transaction rolls back then you can't undo those actions. Some problems are better solved with LISTEN/NOTIFY because notifications don't go out unless and until the transaction

Re: [GENERAL] Changes in pl/pgsql?

2006-05-22 Thread Michael Fuhr
ovide a standalone test case and explain what "didn't work" means? What were you expecting to happen and what actually did happen? How does 8.1.3's behavior differ from an earlier version? Exactly which earlier version behaves as expected? -- Michael Fuhr ---

Re: [GENERAL] Trying to update a box data type column

2006-05-23 Thread Michael Fuhr
1; END; $$ LANGUAGE plpgsql IMMUTABLE STRICT; UPDATE treecategory SET box = box( ); If you need to perform such conversions regularly then you could use CREATE CAST to create a cast between the types. -- Michael Fuhr ---(end of broadcast)--- TIP 9

Re: [GENERAL] move from 1 database to another

2006-05-25 Thread Michael Fuhr
wonder if the OP is looking for "\c new_database". -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] error in SELECT

2006-05-27 Thread Michael Fuhr
documentation: http://www.postgresql.org/docs/8.1/interactive/plpgsql-structure.html The function also has other MySQLisms such as auto_increment and the use of "set". See the PL/pgSQL and other PostgreSQL documentation for the appropriate syntax. -- Michael Fuhr

Re: [GENERAL] stored function and grant execute

2006-05-28 Thread Michael Fuhr
ions' default privileges allow EXECUTE for public (everybody). If you're running a version that doesn't have EXECUTE then you're badly in need of an upgrade. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have y

Re: [GENERAL] Question Regarding DELETE FROM ONLY

2006-05-29 Thread Michael Fuhr
The query against ptable showed records in the parent table (none) and records in its child tables (one). After you delete the record from the child the subsequent query against the parent returns zero rows because both tables are now empty (the parent was always empty and the child had its one

Re: [GENERAL] composite data type question

2006-06-07 Thread Michael Fuhr
? http://www.postgresql.org/docs/8.1/interactive/arrays.html "Arrays of any built-in or user-defined base type can be created. (Arrays of composite types or domains are not yet supported, however.)" What are you trying to model? Have you considered other ways of represent

Re: [GENERAL] delete seems to be getting blocked

2006-06-12 Thread Michael Fuhr
on the foreign key columns. If you create indexes then you might need to start a new session due to plan caching. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Aggregate functions not allowed in WHERE clause

2006-06-12 Thread Michael Fuhr
allowed in WHERE clause" I think you're looking for HAVING. Does the following do what you want? SELECT claim_id FROM logs GROUP BY claim_id HAVING sum(invoices) > 0 OR sum(payments) > 0; -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Aggregate functions not allowed in WHERE clause

2006-06-13 Thread Michael Fuhr
he SQL standard requires expressions in the HAVING clause to be present in the select list -- can you cite reference from the standard that supports the assertion that they should be? -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] DEFAULT_STATISTICS_TARGET

2006-06-14 Thread Michael Fuhr
fect. http://www.postgresql.org/docs/7.4/interactive/sql-alterdatabase.html -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] MySQL insert() and instr() equiv

2006-06-17 Thread Michael Fuhr
string.html Example: overlay(uid PLACING '.' FROM position('@' IN uid) FOR 1) In 8.1 you could use regexp_replace: regexp_replace(uid, '@', '.') For more complex searching and/or replacing you could write a function in PL/Perl, PL/Python, etc. -- Michael

Re: [GENERAL] Help requd in writing functions in C and using in Postgres

2006-06-20 Thread Michael Fuhr
n see "libpq - C Library": http://www.postgresql.org/docs/8.1/interactive/libpq.html If that doesn't help then please provide more information about what you'd like to do or what concerns you have. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] Help requd in writing functions in C and using in Postgres

2006-06-20 Thread Michael Fuhr
t or end a transaction since it's already being executed in the context of a transaction, although in 8.0 and later a function can do partial rollbacks via exception handling. However, a function could connect to the database via dblink, Perl DBI, etc., and then do anything that an ordin

Re: [GENERAL] Help requd in writing functions in C and using in Postgres

2006-06-20 Thread Michael Fuhr
resql.org/docs/8.1/interactive/xfunc-c.html#XFUNC-C-PGXS -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Junk binary date?

2006-06-20 Thread Michael Fuhr
ileLengthPtr[3] 69 'E' char > > Which is not 7237, it's: > fileLength1159462912 int > > Why? 7237 decimal = 1c45 hex 28 decimal = 1c hex 69 decimal = 45 hex The data looks correct once you recognize that it's in networ

Re: [GENERAL] getting comment about constraint

2006-06-22 Thread Michael Fuhr
I checked (7.3.15, 7.4.13, 8.0.8, 8.1.4, 8.2devel): SELECT obj_description(oid, 'pg_constraint') FROM pg_constraint WHERE conname = 'constraint_name' AND conrelid = 'table_name'::regclass; Replace constraint_name and table_name with the actual names (u

Re: [GENERAL] htonl necesssary for PQexecParams input?

2006-06-22 Thread Michael Fuhr
PQexecParams failed with ERROR: invalid byte sequence for encoding "SQL_ASCII": 0x00 A packet sniff of the connection showed a large amount of data being transferred (0x0400 bytes instead of 0x0004 bytes), so the length needs to be in host byte order. -- Michael Fuhr -

Re: [GENERAL] OT: publicly available databases?

2006-06-22 Thread Michael Fuhr
PgFoundry has a Sample Databases project: http://pgfoundry.org/projects/dbsamples/ -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Plperl and my() lexical variables bug?

2006-06-23 Thread Michael Fuhr
SCALAR(0x83f5c4c) foo - (1 row) This behavior isn't specific to PL/Perl. A standalone Perl program exhibits the same behavior, so you might find a better explanation in a Perl-specific forum like the comp.lang.perl.misc newsgroup. -- Michael Fuhr ---(end of

Re: [GENERAL] initlocation on 8.0+

2006-06-26 Thread Michael Fuhr
8.1.0, is there an alternative > utility to this or this feature is no more supported. In 8.0 and later you can use tablespaces to put files in different locations. http://www.postgresql.org/docs/8.1/interactive/manage-ag-tablespaces.html -- Michael Fuhr --

Re: [GENERAL] Script for reading flat file without delimiters

2006-06-29 Thread Michael Fuhr
ther on the client side or in a server-side function written in one of those languages (PL/Perl, PL/Python, PL/Tcl, etc.). You could do it with SQL but other languages are more suitable for text parsing. -- Michael Fuhr ---(end of broadcast)--- TIP 9:

Re: [GENERAL] finding gps within polygon

2006-06-30 Thread Michael Fuhr
t polygon. PostgreSQL has some basic geometry types and functions, but for more advanced spatial work consider using PostGIS (an add-on to PostgreSQL). The documentation has a "Using PostGIS" chapter with examples. http://www.postgis.org/ -- Michael Fuhr -

Re: [GENERAL] Is there a command like uf_purge

2006-07-02 Thread Michael Fuhr
t; whats its functionality? Google, Google Groups, the PostgreSQL mailing list archives, and the PostgreSQL source code and documentation for 7.3 and later all contain zero instances of "uf_purge". Where did you notice it? Might it have been locally written for your sys

Re: [GENERAL] Is there a command like uf_purge

2006-07-03 Thread Michael Fuhr
How did you find out about this function and why are you executing it if you're not sure what it does? What's the output of the following command? SELECT * FROM pg_proc WHERE proname = 'uf_purge'; -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] How to hide NOTICE messages in psql.exe ?

2006-07-05 Thread Michael Fuhr
t_min_messages TO warning" do what you want? You might also be interested in psql's -q option (or "\set QUIET"). http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN http://www.postgresql.org/docs/8.1/interacti

Re: [GENERAL] How do I revoke CREATE TABLE and other privileges?

2006-07-05 Thread Michael Fuhr
the objects then the role still has privileges, even if you've attempted to revoke them. You'll probably need to alter the privileges that PUBLIC has, which might also require altering other roles' privileges to compensate. -- Michael Fuhr ---(end of broadcas

Re: [GENERAL] How to hide NOTICE messages in psql.exe ?

2006-07-06 Thread Michael Fuhr
ias.mask%TYPE converted to character varying [...] > I would like to hide lines with NOTICE I mentioned -q as something you might want to use in addition to client_min_messages, not instead of it. My previous message showed how to suppress NOTICE and provided a link t

Re: [GENERAL] FOR from query - is it a bug ?

2006-07-06 Thread Michael Fuhr
What client are you using -- psql or something else? Warnings like this can happen if a client application calls a libpq function like PQgetvalue() without first checking whether the query returned any tuples. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] How do I revoke CREATE TABLE and other privileges?

2006-07-06 Thread Michael Fuhr
e value is currently set to. Then use set to make it include the > schema with your function. The user probably needs USAGE on the schema. If a user has no privileges on a schema then he or she can't access objects in that schema regardless of search_path or the privileges on the objects th

Re: [GENERAL] Delete cascade and trigger permissions?

2006-07-06 Thread Michael Fuhr
;re seeing. Also, what version of PostgreSQL are you running? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Procedural language functions across servers

2006-07-09 Thread Michael Fuhr
lperlu VOLATILE; SELECT remote_version('dbi:mysql:wopr;host=norad', 'falken', 'joshua'); remote_version 5.0.22-log (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Procedural language functions across servers

2006-07-09 Thread Michael Fuhr
e their functionality in complex > work would be to use a "farm". What sort of "unhapiness" are you thinking is "quite possible"? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] getting function argument names from psql?

2006-07-12 Thread Michael Fuhr
cs/8.1/interactive/catalog-pg-proc.html -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Delete Problem

2006-07-12 Thread Michael Fuhr
? What does "EXPLAIN ANALYZE DELETE ..." show? Is the delete done in a transaction that doesn't commit? -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index

Re: [GENERAL] Delete Problem

2006-07-12 Thread Michael Fuhr
[Please copy the mailing list on replies so others can participate in and learn from the discussion.] On Thu, Jul 13, 2006 at 03:32:43PM +1000, Jamie Deppeler wrote: > Michael Fuhr wrote: > >On Thu, Jul 13, 2006 at 01:45:36PM +1000, Jamie Deppeler wrote: > >>Just today i have

Re: [GENERAL] Delete Problem

2006-07-13 Thread Michael Fuhr
TE 0 You said that you had deleted all triggers -- have you verified that none remain? Does the table have any rules? What does "\d job" show? -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [GENERAL] Delete Problem

2006-07-13 Thread Michael Fuhr
sion()" show? What are the output of the following? EXPLAIN ANALYZE SELECT "primary" FROM job WHERE "primary" = 370; EXPLAIN ANALYZE DELETE FROM job WHERE "primary" = 370; If these commands use index or bitmap index scans, do you get different results if you exe

Re: [GENERAL] Delete Problem

2006-07-13 Thread Michael Fuhr
On Thu, Jul 13, 2006 at 05:26:31PM +1000, Jamie Deppeler wrote: > PostgreSQL 8.1.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 > 20060104 (prerelease) (Debian 4.0.2-6) What about the other outputs I mentioned? -- Michael Fuhr ---(end of bro

Re: [GENERAL] Trying to connect to an Oracle instance...

2006-07-13 Thread Michael Fuhr
might have a bug. Can anybody repeat this crash and get a stack trace? I tried connecting to MySQL and got a clean failure with the message "ERROR: could not establish connection". -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Browse database , schema

2006-07-16 Thread Michael Fuhr
able's fields > etc.) ? Users who can connect to a database can query that database's system catalogs. > How prohibit that ? Thanks Don't allow users to connect to databases whose structures you don't want the users to browse. -- Michael Fuhr ---(end o

Re: [GENERAL] Lock changes with 8.1 - what's the right lock?

2006-07-16 Thread Michael Fuhr
the weakest lock that meets these requirements. It conflicts with itself (#2) and with ROW EXCLUSIVE, which UPDATE, DELETE, and INSERT acquire (#1), but doesn't conflict with ROW SHARE, which is what SELECT FOR UPDATE/SHARE acquire (#3). -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] permission to create user

2006-07-17 Thread Michael Fuhr
> that created it. Also, if you're using 8.1, then giving certain roles the CREATEROLE attribute might be what you're after. http://www.postgresql.org/docs/8.1/interactive/role-attributes.html -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] permission to create user

2006-07-18 Thread Michael Fuhr
attributes in order to make use of the attribute. Continuing the above example, we might well choose to grant CREATEDB and CREATEROLE to the admin role. Then a session connecting as role joe would not have these privileges immediately, only after doing SET ROLE admin.

Re: [GENERAL] function taking a long time. any options o speed it up.

2006-07-18 Thread Michael Fuhr
d EXPLAIN ANALYZE to see if you could benefit from rewriting a query, adding indexes, or tuning configuration settings? The UPDATE statement with the ORs and regular expression matches looks like it might be slow. Is it? -- Michael Fuhr ---(end of broadcast)-

Re: [GENERAL] setting serial start value

2006-07-20 Thread Michael Fuhr
> work. any suggestions are greatly appreciated. What have you tried? ALTER SEQUENCE or setval() should work. http://www.postgresql.org/docs/7.4/interactive/sql-altersequence.html http://www.postgresql.org/docs/7.4/interactive/functions-sequence.html -- Michael Fuhr -

Re: [GENERAL] setting serial start value

2006-07-20 Thread Michael Fuhr
e) VALUES ('Alice'); INSERT 2592322 1 test=> INSERT INTO users (username) VALUES ('Bob'); INSERT 2592323 1 test=> SELECT * FROM users; id | username ---+-- 1 | Alice 10001 | Bob (2 rows) -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] join table with empty fields and default

2006-07-22 Thread Michael Fuhr
work FROM "user" AS u LEFT OUTER JOIN userwork AS uw ON uw.userid = u.id; -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED]

Re: [GENERAL] join table with empty fields and default

2006-07-22 Thread Michael Fuhr
results were you expecting, and what results did you get? If you're getting the wrong results then let's investigate so we can understand why they're wrong. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through

Re: [GENERAL] Error dumping and restoring postgis db

2006-07-23 Thread Michael Fuhr
e test.dump | grep 'CREATE TYPE' CREATE TYPE histogram2d ( CREATE TYPE spheroid ( CREATE TYPE geometry ( CREATE TYPE box3d ( CREATE TYPE chip ( CREATE TYPE box2d ( CREATE TYPE geometry_dump AS ( What output do you get? -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Lock changes with 8.1 - what's the right lock?

2006-07-25 Thread Michael Fuhr
HARE ROW EXCLUSIVE is the weakest lock that meets your requirements, I should have said that it's the only lock that does. Hopefully I've understood what you're asking; if not then please clarify. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] wrong timestamp

2006-07-26 Thread Michael Fuhr
single transaction to have a consistent notion of the 'current' time, so that multiple modifications within the same transaction bear the same time stamp." -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Create spatial_ref_sys entry from srtext ?

2006-07-28 Thread Michael Fuhr
for this projection in the > spatial_ref_sys table ? Arnaud has probably already realized that postgis-users would be a better place to ask this. Here's the same thread on that list: http://postgis.refractions.net/pipermail/postgis-users/2006-July/012790.html -- Michael Fuhr -

Re: [GENERAL] Performance of the listen command

2006-07-28 Thread Michael Fuhr
Actually, it does write to disk, because the listen information is kept > on a table. Also, based on a 60ms-per-listen time I suspect you're not doing the listens in a transaction, so each listen is its own transaction that has to be committed, resulting in a disk hit. Try doing them a

Re: [GENERAL] Performance of the listen command

2006-07-29 Thread Michael Fuhr
On Sat, Jul 29, 2006 at 12:44:14PM +0200, Flemming Frandsen wrote: > Michael Fuhr wrote: > >Also, based on a 60ms-per-listen time I suspect you're not doing > >the listens in a transaction, so each listen is its own transaction > >that has to be committed, resulting in a

Re: [GENERAL] Can you run out of oids?

2006-08-01 Thread Michael Fuhr
ld consider trying to rebuild the > existing tables to be built without OID. Avoid using OIDs; if you need a unique identifier use a serial or bigserial column. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Us

Re: [GENERAL] prepare, execute & oids

2006-08-01 Thread Michael Fuhr
quence (serial column). To get a sequence's value you can use currval() or lastval() (the latter available in 8.1). -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] prepare, execute & oids

2006-08-02 Thread Michael Fuhr
se it can be the value of another > insert made by another user. As Martijn and Chris mentioned, currval() is safe in this respect. Its behavior is documented and is the subject of an FAQ item: http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html http://

Re: [GENERAL] Create function problem

2006-08-03 Thread Michael Fuhr
I receive an empty row. Can > you see the problem ??* [...] > mydb=> SELECT * FROM f_describe_tables('pubilc', 'mil_cien_diez'); 'public' looks misspelled. Does the query work if you change it? -- Michael Fuhr ---(end of br

Re: [GENERAL] Create function problem

2006-08-03 Thread Michael Fuhr
_tbl_schm' and 'v_tbl_name' instead of using the function's arguments. I don't think SQL functions support named arguments so you'll need to use $1 and $2. You'll also need to use "RETURNS SETOF record" if you want to return more than one row. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Create function problem

2006-08-04 Thread Michael Fuhr
[Please copy the mailing list on replies so others can contribute to and learn from the discussion.] On Fri, Aug 04, 2006 at 11:20:55AM +0300, gustavo halperin wrote: > Michael Fuhr wrote: > >You've hardcoded the strings 'v_tbl_schm' and 'v_tbl_name' instead &g

Re: [GENERAL] Create function problem

2006-08-04 Thread Michael Fuhr
On Fri, Aug 04, 2006 at 06:44:16PM +0300, gustavo halperin wrote: > Michael Fuhr wrote: > >Since the function has OUT parameters you can use "RETURNS SETOF record" > >like this: > > > >CREATE FUNCTION funcname() RETURNS SETOF record AS $$ > > > >$

Re: [GENERAL] DROP TABLESPACE fails

2006-08-07 Thread Michael Fuhr
c.relkind FROM pg_class AS c LEFT JOIN pg_namespace AS n ON n.oid = c.relnamespace LEFT JOIN pg_tablespace AS t ON t.oid = c.reltablespace WHERE c.relfilenode IN (706712, 706715, 706717); Do such queries show anything? -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] Accessing Database Data from C Function

2006-08-08 Thread Michael Fuhr
on, PL/Ruby, PL/R, etc. There's even a third-party PL/php if that's your preferred language: http://projects.commandprompt.com/public/plphp -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] DROP TABLESPACE fails

2006-08-08 Thread Michael Fuhr
> ended up stopping what I thought was the server process that had hung: [...] > 2006-08-07 16:47:56 LOG: server process (PID 5140) was terminated by signal 1 Maybe one of the developers can comment on whether this might have caused a problem. -- Michael Fuhr ---(end of bro

Re: [GENERAL] Tuning to speed select

2006-08-09 Thread Michael Fuhr
ttp://www.postgresql.org/docs/8.1/interactive/sql-cluster.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] PL/pgSQL Problem

2006-08-09 Thread Michael Fuhr
unts" line 8 at SQL statement Is the table's primary key a serial column? If so then the sequence might be out of sync with the values in the table, in which case you'll need to adjust the sequence's value with ALTER SEQUENCE or setval(). -- Michael Fuhr ---

Re: [GENERAL] Tuning to speed select

2006-08-09 Thread Michael Fuhr
used the most. Those indexes might be good candidates for clustering. http://www.postgresql.org/docs/8.1/interactive/monitoring-stats.html -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire

Re: [GENERAL] Connection string

2006-08-09 Thread Michael Fuhr
onnect.html If the documentation and examples don't help then please post exactly what you've tried and what happened (complete error message, etc.). -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Connection string

2006-08-09 Thread Michael Fuhr
getting 'database "mydb" does not exist' errors then try connecting with psql and make sure the database really does exist. If you still have trouble then please post a minimal but complete program so we can see everything you're doing. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Tuning to speed select

2006-08-10 Thread Michael Fuhr
ve only (a,b,c) then the planner will consider using it. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Connection string

2006-08-10 Thread Michael Fuhr
; or EXEC SQL BEGIN DECLARE SECTION; char *connstr = "tcp:postgresql://192.168.0.123/xyz"; EXEC SQL END DECLARE SECTION; EXEC SQL CONNECT TO :connstr USER jsb; -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you sea

Re: [GENERAL] Connection string

2006-08-11 Thread Michael Fuhr
ne to use a (single-quoted) string literal or a variable reference. which might be the source of confusion here. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

<    7   8   9   10   11   12   13   14   >