Re: [GENERAL] Working out diskspace taken by database and tables 7.4

2006-01-22 Thread Michael Fuhr
8.1. http://www.postgresql.org/docs/8.1/interactive/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Numbers

2006-01-22 Thread Michael Fuhr
chives.postgresql.org/pgsql-general/2005-12/msg00850.php -- 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] Does pg_dump have result codes to indicate success or failure

2006-01-22 Thread Michael Fuhr
t codes of 0 (success) and 1 (failure). -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] FATAL: invalid frontend message type 47

2006-01-24 Thread Michael Fuhr
on of PostgreSQL (both client and server versions if they're different)? What platform(s)? How are you connecting to the database (Unix socket, TCP socket, SSL over TCP, etc.)? How consistently do you get this error? -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] Are indexes used with LIKE?

2006-01-24 Thread Michael Fuhr
ach flag in a separate column and indexing those columns? If you're using 8.1 the planner would probably use bitmap index scans and come up with a fast plan regardless of which columns you restrict on. And performance issues aside, some people would consider that a better design. However, a d

Re: [GENERAL] FW: deleted records

2006-01-25 Thread Michael Fuhr
ould look like this: SELECT * FROM pgstattuple('tablename'); Did you install the contrib/pgstattuple module? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Constraint that compares and limits field values

2006-01-25 Thread Michael Fuhr
is constraint would allow all three to be NULL. -- 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 ge

Re: [GENERAL] table is not a table

2006-01-25 Thread Michael Fuhr
atalog be responsible? Might a query like the following reveal anything? SELECT c.ctid, c.xmin, c.xmax, c.oid, c.relname, c.relkind, n.ctid, n.xmin, n.xmax, n.oid, n.nspname FROM pg_class AS c LEFT JOIN pg_namespace AS n ON n.oid = c.relnamespace WHERE c.relname ~* '^ddd'; -- Micha

Re: [GENERAL] Constraint that compares and limits field values

2006-01-25 Thread Michael Fuhr
false to 0; you're adding up the number of true expressions and requiring that the sum equal 1 (i.e., that exactly one expression be true). -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Constraint that compares and limits field values

2006-01-25 Thread Michael Fuhr
sql.org/docs/7.3/static/sql-createcast.html Something like this should work: CREATE FUNCTION bool2int(boolean) RETURNS integer AS ' SELECT CASE WHEN $1 THEN 1 ELSE 0 END; ' LANGUAGE sql IMMUTABLE STRICT; CREATE CAST (boolean AS integer) WITH FUNCTION bool2int(b

Re: [GENERAL] pgstattuple output?

2006-01-25 Thread Michael Fuhr
t | 44.24 dead_tuple_count | 10 dead_tuple_len | 320 dead_tuple_percent | 44.24 free_space | 12348 free_percent | 0.17 -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Trigger question: ROW or STATEMENT?

2006-01-25 Thread Michael Fuhr
er, then before is more efficient. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] pgstattuple output?

2006-01-26 Thread Michael Fuhr
1 ]--+ table_len | 1089536 tuple_count| 2 tuple_len | 64 tuple_percent | 58.74 dead_tuple_count | 0 dead_tuple_len | 0 dead_tuple_percent | 0 free_space | 326692 free_percent | 29.98 -- Michael Fuhr ---(end of

Re: [GENERAL] Suggestions on storing and retrieving geocode data

2006-01-26 Thread Michael Fuhr
On Thu, Jan 26, 2006 at 12:55:46PM -0500, George Woodring wrote: > I am looking for suggestions on storing and retrieving geocode > information. Consider using PostGIS: http://www.postgis.org/ -- Michael Fuhr ---(end of broadcast)--- TIP 3

Re: [GENERAL] VACUUM Question

2006-01-26 Thread Michael Fuhr
t still be vacuumed occasionally to prevent transaction ID wraparound failure, else you risk losing data. http://www.postgresql.org/docs/8.1/interactive/maintenance.html#VACUUM-FOR-WRAPAROUND -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] "xmin" system column

2006-01-26 Thread Michael Fuhr
test=> RELEASE SAVEPOINT s; test=> INSERT INTO foo VALUES (3); test=> COMMIT; test=> SELECT xmin, * FROM foo; xmin | x +--- 424584 | 1 424585 | 2 424584 | 3 (3 rows) Explicit savepoints aren't the only way to get this effect; you'll also see

Re: [GENERAL] "xmin" system column

2006-01-26 Thread Michael Fuhr
write and examples have been posted before; search the archives. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] "xmin" system column

2006-01-26 Thread Michael Fuhr
On Thu, Jan 26, 2006 at 03:22:50PM -0700, Michael Fuhr wrote: > On Thu, Jan 26, 2006 at 05:05:19PM -0500, Eric B. Ridge wrote: > > Is there some kind of "TopXID" magic variable/function that I haven't > > found in the documentation? > > Not in the standard in

Re: [GENERAL] SYNTAX ERROR at or near SQLSTATE

2006-01-26 Thread Michael Fuhr
they're not available in earlier versions unless you've applied some patch. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Interpreting pg_locks; looking for deadlock

2006-01-26 Thread Michael Fuhr
t;deadlock detected" error message. Try querying pg_locks for all ungranted locks, not just those on relations. I suspect you'll see those updates waiting on a transaction id; if so then find out what transaction holds the lock and why it's not finishing. -- 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] Combine, Merge, Concatenate

2006-01-26 Thread Michael Fuhr
4); SELECT b.id, f1.col1, f1.col2, f2.col1 AS col3, f2.col2 AS col4 FROM bar AS b JOIN foo AS f1 ON f1.id = b.fooid1 JOIN foo AS f2 ON f2.id = b.fooid2; id | col1 | col2 | col3 | col4 +---+---+---+--- 1 | text1 | text2 | text3 | text4 2 | text5 | text6 |

Re: [GENERAL] Basic questions about PQprepare()

2006-01-29 Thread Michael Fuhr
l.org/docs/8.1/static/catalog-pg-type.html For standard types you could include server/catalog/pg_type.h and use TEXTOID, INT4OID, etc. But as Tom Lane mentioned, if the query is written so the backend can infer the types then you don't need to bother. -- Michael Fuhr --

Re: [GENERAL] postgresql performace degrading after a while

2006-01-29 Thread Michael Fuhr
nation of what it is and why it's necessary. http://www.postgresql.org/docs/7.4/static/maintenance.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] libpq questions

2006-01-31 Thread Michael Fuhr
libpq fetches all rows before returning any to the client; if you want to fetch rows in smaller chunks then use a cursor. The developers' TODO list has an item to address that problem: * Allow statement results to be automatically batched to the client http://www.postgresql.org/docs/

Re: [GENERAL] libpq questions

2006-01-31 Thread Michael Fuhr
ine? The "Incremental results from libpq" thread from a few months ago might answer your questions: http://archives.postgresql.org/pgsql-interfaces/2005-11/msg00010.php > Are there any alternative (but native - eg not ODBC) interfaces to > postgresql? What problem do you want the

Re: [GENERAL] returning a cursor from a function?

2006-01-31 Thread Michael Fuhr
You might also be interested in the "Porting from Oracle PL/SQL" section. http://www.postgresql.org/docs/8.1/interactive/plpgsql.html http://www.postgresql.org/docs/8.1/interactive/plpgsql-cursors.html http://www.postgresql.org/docs/8.1/interactive/plpgsql-porting.h

Re: [GENERAL] Stack Depth

2006-02-01 Thread Michael Fuhr
file Before mucking with max_stack_depth, investigate whether the triggers are causing infinite recursion (an insert fires a trigger, which does an insert, which fires a trigger, which does an insert, ad infinitum). If that's happening then increasing the stack depth will merely prolong th

Re: [GENERAL] Stack Depth

2006-02-01 Thread Michael Fuhr
t gets called when. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] C Language Stored Procedure Returning No Data

2006-02-02 Thread Michael Fuhr
d some code changes) and return no rows to indicate no data. -- 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 mess

Re: [GENERAL] logging settings

2006-02-02 Thread Michael Fuhr
ed the server, so I don't think connection pooling would matter (at least not for those settings). I think the more likely problem is that you commented out the settings instead of actually changing them. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] C Language Stored Procedure Returning No Data

2006-02-03 Thread Michael Fuhr
On Fri, Feb 03, 2006 at 09:07:48AM -0500, Jeff Trout wrote: > On Feb 2, 2006, at 7:17 PM, Michael Fuhr wrote: > >If you declare the function with "RETURNS bytea" then the function > >must return something; if zero-length data and NULL aren't suitable > >for ind

Re: [GENERAL] what is the data type for files(.txt,.doc,.jpeg) in pgsql

2006-02-07 Thread Michael Fuhr
ou start and stop the database yourself). -- 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] Why pg_hba not in table?

2006-02-07 Thread Michael Fuhr
t then you have to disable security entirely to get back in and fix the problem. With a configuration that you can edit from outside the database, you can usually get back in without having to punch as big a hole. -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] plruby

2006-02-08 Thread Michael Fuhr
/pgsql-hackers/2005-08/msg00423.php -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Insert into other database

2006-02-08 Thread Michael Fuhr
tional control: if the triggering transaction rolls back then you have no way to roll back the outside changes. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Insert into other database

2006-02-08 Thread Michael Fuhr
and later; see the documentation for the version you're running. http://www.postgresql.org/docs/8.1/interactive/plperl-triggers.html -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Return more then one value using PL

2006-02-09 Thread Michael Fuhr
with C, SQL, PL/pgSQL, and PL/Perl but not with PL/Tcl or PL/Python. Third-party languages with support for sets and composite types include PL/Ruby, PL/php, PL/R, PL/Java, and possibly others. -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have

Re: [GENERAL] Is there a way to limit CPU usage per user

2006-02-09 Thread Michael Fuhr
solve, not how you're trying to solve it. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Sequence skipping values

2006-02-10 Thread Michael Fuhr
value in the table. Other possibilities, though less likely, are that the sequence has non-default CACHE or INCREMENT values. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Sequence skipping values

2006-02-10 Thread Michael Fuhr
tes to a nextval expression, not to the result of that expression. If you post the table definitions as Steve requested we'll be able to see whether the above is indeed what's happening. -- Michael Fuhr ---(end of broadcast)--- TIP 1: if p

Re: [GENERAL] Sequence skipping values

2006-02-10 Thread Michael Fuhr
ements that exhibit the unexpected behavior. What version of PostgreSQL are you running? -- 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 co

Re: [GENERAL] Limiting with a left outer join

2006-02-10 Thread Michael Fuhr
On Fri, Feb 10, 2006 at 11:59:30AM -0800, Bill Moseley wrote: > How do I make a join on the class table but not effect the left outer > join? Are you looking for something like this? LEFT OUTER JOIN (class INNER JOIN class_domain ON ...) c ON ... -- Michae

Re: [GENERAL] Sequence skipping values

2006-02-11 Thread Michael Fuhr
rt/update slow as the table grows. Additionally, the update creates a dead tuple for every insert so you should vacuum the table often if it's updated often. A trigger would probably be better for this. If your database doesn't have a trigger-capable language like PL/pgSQL a

Re: [GENERAL] Each foo must have a bar

2006-02-11 Thread Michael Fuhr
t least one > row in bar." Possibly something involving CREATE CONSTRAINT TRIGGER, specifying DEFERRABLE INITIALLY DEFERRED? The documentation says it's not for general use; I've used it only in simple experiments so I'm not sure how problematic it could be. Anybody? -- M

Re: [GENERAL] Limiting with a left outer join

2006-02-13 Thread Michael Fuhr
ction that accepts the relevant values as arguments and plugs them into the query. -- 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] stateful UDF?

2006-02-14 Thread Michael Fuhr
ssions or just within a single session? What are you trying to do? -- 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] Oracle purchases Sleepycat - is this the "other shoe"

2006-02-15 Thread Michael Fuhr
On Wed, Feb 15, 2006 at 01:02:03PM -0800, Ben wrote: > Well, in all fairness, MySQL probably gives the right answer most of the > time, always really fast (except for some use cases). "Probably gives the right answer most of the time." I'm not sure whether to laugh or c

Re: [GENERAL] I see this as the end of BDB in MySQL without a

2006-02-15 Thread Michael Fuhr
#x27;m not sure what more Chad could want there either. Hell, you could > spend a lifetime just exploring some small part of it. Maybe the "spend a liftime" part is the problem ;-) -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] How do I use the backend APIs

2006-02-16 Thread Michael Fuhr
? Could you tell us about the problem you're trying to solve? Are you writing client-side or server-side code? -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] Basic problems using plpythonu - bug?

2006-02-17 Thread Michael Fuhr
ation about quoted identifiers: http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] C trigger using system(3) to execute a php script

2006-02-18 Thread Michael Fuhr
re out how to build your code. http://www.postgresql.org/docs/8.0/interactive/xfunc-c.html#XFUNC-C-PGXS -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] PostgreSQL Functions / PL-Language

2006-02-18 Thread Michael Fuhr
TABLE; SELECT * FROM func1(); id | t +- 1 | one 2 | two (2 rows) SELECT * FROM func2(); id | t +- 1 | one 2 | two (2 rows) -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ig

Re: [GENERAL] PostgreSQL Functions / PL-Language

2006-02-19 Thread Michael Fuhr
I first test it. > Then today I tried the same function and test it then it return only 1 row. As written the function above should return only one row because it doesn't loop through the results. I suspect the difference between the earlier test and the most recent one is that you

Re: [GENERAL] How to determine number of established connections

2006-02-20 Thread Michael Fuhr
http://www.postgresql.org/docs/8.1/interactive/monitoring-stats.html Statistics collector reports lag behind actual activity but they might suffice for whatever you're doing. Why does your application need to know this? -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] How to determine number of established connections

2006-02-20 Thread Michael Fuhr
s the stats collector's lag time. Several connections made at the same time might all see zero relevant records in pg_stat_activity, so they'd get an inaccurate count. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] ExclusiveLock without a relation in pg_locks

2006-02-23 Thread Michael Fuhr
seeing these transaction ID locks. > How could I find out the tables that are being locked when I see an > "ExclusiveLock" in pg_locks. An easy way to convert a relation's oid to its name is to cast it to regclass: SELECT relation::regclass AS relname, * FROM pg

Re: [GENERAL] ExclusiveLock without a relation in pg_locks

2006-02-23 Thread Michael Fuhr
-locking.html Are you just curious or are you seeing such a situation? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] ExclusiveLock without a relation in pg_locks

2006-02-23 Thread Michael Fuhr
f-contained test case might also be useful. If you show what commands you're running and what pg_locks output you don't understand, then somebody might be able to explain what's happening. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] ExclusiveLock without a relation in pg_locks

2006-02-23 Thread Michael Fuhr
time you don't need to worry about any of this unless a transaction appears to be blocked (stuck); then you can query pg_locks and look for locks where the granted column is false and diagnose from there. -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] now() time off

2006-02-23 Thread Michael Fuhr
hat was there... was it added fairly recently or have > I just been blind? http://www.postgresql.org/docs/7.3/interactive/release-7-3.html "Add configuration variables datestyle and timezone (Tom)" -- Michael Fuhr ---(end of broadcast)---

Re: [GENERAL] ECPG and COPY

2006-02-23 Thread Michael Fuhr
tabase test on port [33044]: ECPGexecute line 6: QUERY: copy foo from stdinon connection test [33044]: ECPGexecute line 6: Got PGRES_COPY_IN ... tossing. [33044]: ECPGtrans line 7 action = commit connection = test [33044]: ecpg_finish: Connection test closed. -- Michael Fuhr --

Re: [GENERAL] Wrong length of bytea field

2006-02-24 Thread Michael Fuhr
foo VALUES ($$000$$); SELECT data, octet_length(data) FROM foo; data | octet_length -+-- \000|1 \\000 |4 \\\000 |2 000 | 5 (4 rows) -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] rotate records

2006-02-25 Thread Michael Fuhr
on the primary key ensures that you can't exceed the record limit by explicitly setting the primary key value. If you do something like this then be sure to vacuum the table frequently, as each insert that "rotates" creates a dead tuple due to the delete. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] rotate records

2006-02-25 Thread Michael Fuhr
On Sat, Feb 25, 2006 at 10:12:38AM -0700, Michael Fuhr wrote: > > If it is not correct, how can I rotate the records in the table? > > One way would be to use a trigger to delete records having the same > event_id as the record being inserted. I should mention that with the examp

Re: [GENERAL] How to tell how much of the database is being used for data.

2006-02-26 Thread Michael Fuhr
be able to keep the tables around a certain size. Or do you have usage patterns that make that infeasible? If so, what are they? What version of PostgreSQL are you running? How often do you do regular vacuums? -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Breaking Path/Polygon Data into Pieces

2006-02-27 Thread Michael Fuhr
ng, n))) postgis-> FROM (SELECT ExteriorRing(geom) AS ring FROM foo) AS s, postgis-> generate_series(1, 2) AS g(n); astext -- LINESTRING(0 0,10 0) (1 row) postgis=> SELECT AsText(line_substring(ExteriorRing(geom), 0, 0.25)) postgis-> FROM foo;

Re: [GENERAL] How many postmasters should be running?

2006-02-27 Thread Michael Fuhr
what you saw. For more information see the "Monitoring Database Activity" and postmaster documentation: http://www.postgresql.org/docs/8.1/interactive/monitoring.html http://www.postgresql.org/docs/8.1/interactive/app-postmaster.html -- Michael Fuhr

Re: [GENERAL] rotate records

2006-02-27 Thread Michael Fuhr
re efficiency and concurrency: how to quickly know which, if any, old rows to delete, and how to ensure that inserts in concurrent transactions can't result in the table having more rows than it should. -- Michael Fuhr ---(end of broadcast)--- TIP

Re: [GENERAL] regarding grant option

2006-02-28 Thread Michael Fuhr
ntation for more information: http://www.postgresql.org/docs/8.0/interactive/client-authentication.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

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

2006-02-28 Thread Michael Fuhr
an spare the time then you might run the dd and od commands that Tom Lane mentions in the above message and post the output. I think the command would be dd bs=8k skip=115860 count=1 if=$PGDATA/37958/111685332.6 | od -x See Tom's message for how I arrived at .6 and 115860 (and verify the math

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

2006-02-28 Thread Michael Fuhr
On Tue, Feb 28, 2006 at 10:54:48PM -0700, Michael Fuhr wrote: > Is your table really over 100G? Anyway, if the block size is 8192 > then 902292 sould be in the .6 file. If you can spare the time > then you might run the dd and od commands that Tom Lane mentions > in the above mess

Re: [GENERAL] Triggers question

2006-03-01 Thread Michael Fuhr
re running: http://www.postgresql.org/docs/8.1/interactive/xfunc-sql.html#AEN31646 http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Going crazy comparing bytea columns

2006-03-01 Thread Michael Fuhr
following query? SELECT pwd, @pwd FROM table WHERE usr = @usr That should return the value in the database (pwd) and the value you're providing (@pwd). Let's see how they differ. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] SET TRANSACTION on pl/pgSQL function

2006-03-01 Thread Michael Fuhr
base client. The function could execute transaction-starting and -ending commands over that connection. -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] [SQL] Without OIDs

2006-03-02 Thread Michael Fuhr
//www.postgresql.org/docs/faqs.FAQ.html#item4.19 -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] How to save and restore a template database ?

2006-03-02 Thread Michael Fuhr
with pg_dump ? > > Our question is how to save and restore a template database, as > "template1" ? pg_dumpall should dump the modified contents of template1. Is it not doing so? What version of PostgreSQL are you using? -- Michael Fuhr ---(end of br

Re: [GENERAL] Problem with Function

2006-03-02 Thread Michael Fuhr
tion then each command has its own transaction. > where nombreusuario = quote_literal($1); You shouldn't need quote_literal here since you're not building a string for EXECUTE. In fact, not only is it unecessary but it'll probably cause the query not to match what you were

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

2006-03-02 Thread Michael Fuhr
On Fri, Mar 03, 2006 at 09:56:40AM +1100, Noel Faux wrote: > Which config file will tell us how big the bock sizes are? Run the query "SHOW block_size" in the database or use pg_controldata from the shell. It's probably 8192; changing it is done at compile time.

Re: [GENERAL] extended index info

2006-03-02 Thread Michael Fuhr
| news > > > It doesn't show me which fields it actually applies to, only the table. \d news_pkey -- Michael Fuhr ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Postgres automatically inserts chr(13) whenever chr(10) is inserted

2006-03-03 Thread Michael Fuhr
xample? INSERT INTO sample VALUES ('a' || chr(10) || 'b'); SELECT length(column_sample), decode(column_sample, 'escape') FROM sample; -- Michael Fuhr ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Problem with function that returns a cursor

2006-03-03 Thread Michael Fuhr
previous message about this: http://archives.postgresql.org/pgsql-general/2006-03/msg00094.php -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] record OID to table

2006-03-03 Thread Michael Fuhr
olumn. Where are you getting the oid? Could you tell us more about what you're trying to do? -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] record OID to table

2006-03-03 Thread Michael Fuhr
tables contain that string. Is that right? If so them I'm not sure how to best solve that problem; maybe somebody else will have some ideas. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Accessing composite type columns in indexes

2006-03-03 Thread Michael Fuhr
tory (company, (during).from_date, (during)... > ^ This works: create unique index employment_history_pkey_idx on employment_history (company, ((during).from_date), ((during).to_date)); -- Michael Fuhr ---

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

2006-03-05 Thread Michael Fuhr
think it would be block 110025 in file .68 (again, check the math yourself). -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

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

2006-03-06 Thread Michael Fuhr
11685332.68 That should show the bad block (110025) and the block before and after it. -- Michael Fuhr ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Syntax error in Execute statement

2006-03-06 Thread Michael Fuhr
--- 1 (1 row) I'd guess that you created the column with an uppercase quoted identifier. See the documentation regarding case folding and quoted identifiers: http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS -- Michael Fuhr ---

Re: [GENERAL] About when we should setup index?

2006-03-06 Thread Michael Fuhr
. Create whatever indexes you need to realize a significant improvement in query performance, but don't overdo 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 message can get through to the mailing list cleanly

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

2006-03-06 Thread Michael Fuhr
this: WARNING: relation "foo" page 110025 is uninitialized --- fixing If you see any other errors or warnings then please post them. -- Michael Fuhr ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [GENERAL] is it possible to get current_user inside security definer function ?

2006-03-06 Thread Michael Fuhr
| user2| user3 (1 row) SELECT * FROM whoami(); curr_user | sess_user | role_user ---+---+--- user1 | user2 | user3 (1 row) -- Michael Fuhr ---(end of broadcast)--- TIP 1: if posting/reading through Use

Re: [GENERAL] is it possible to get current_user inside security definer function ?

2006-03-06 Thread Michael Fuhr
On Tue, Mar 07, 2006 at 12:58:29AM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > Is this what you're after? I don't know if there's another way. > > > role_user := current_setting('role'); > > We cu

Re: [GENERAL] About when we should setup index?

2006-03-07 Thread Michael Fuhr
ollowing: > > > >CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for > >table "test" Is this the example you meant? Earlier versions of PostgreSQL work the same way. -- Michael Fuhr ---(end of broadcast)--

Re: [GENERAL] regarding contains operator

2006-03-08 Thread Michael Fuhr
need to match a literal backslash then you might need to write more backslashes than you'd expect. If you're using 8.0 or later then dollar quotes can make writing patterns easier because they don't treat backslashes as special. http://www.postgresql.org/docs/8.1/interact

Re: [GENERAL] distance calculation usng lat and long in miles

2006-03-08 Thread Michael Fuhr
54 | 69.1707247134693 POINT(0 60) | POINT(1 60) | 34.5462620892688 | 34.6721834372296 (2 rows) Non-PostGIS users could use contrib/earthdistance. -- 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] About array in PlPgsql trigger function

2006-03-08 Thread Michael Fuhr
lues by specifying column > number but not NEW.ColumnName? Not in PL/pgSQL, but you can do this in other languages like PL/Perl, PL/Tcl, PL/Python, PL/Ruby, etc. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Michael Fuhr
r that > is calling this function". PL/pgSQL triggers receive the table's oid in TG_RELID. You could query pg_class and join to pg_namespace to get the table's schema name. Is that what you're looking for? -- Michael Fuhr ---(end of broadcast)

Re: [GENERAL] plperl %_SHARED and rollbacks

2006-03-08 Thread Michael Fuhr
2 | two | one 4 | four | three (3 rows) Notice that the value assigned in the rolled back transaction was used in the subsequent insert. > If not then I assume I should manually clear it at the start of > transactions, no? Apparently so. -- Michael Fuhr --

Re: [GENERAL] Triggers and Multiple Schemas.

2006-03-08 Thread Michael Fuhr
INTO foo.tablename VALUES (1); INFO: schema = foo oldpath = public INSERT 0 1 test=> INSERT INTO bar.tablename VALUES (2); INFO: schema = bar oldpath = public INSERT 0 1 -- Michael Fuhr ---(end of broadcast)--- TIP 9: In versions below 8.0,

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

2006-03-08 Thread Michael Fuhr
-- 68 | 110041 (1 row) If you're running 7.4.8 then consider upgrading to 7.4.12. Offhand I don't know if any bugs have been fixed that might cause the problem you're seeing, but there have been other bug fixes. -- Michael Fuhr ---(end of broad

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

2006-03-08 Thread Michael Fuhr
ual suspects. One reason to look at the data in the bad block is to see what's there: if you see data that obviously came from outside the database then that would tend to exonerate PostgreSQL. -- Michael Fuhr ---(end of broadcast)--- TIP 3: Hav

<    6   7   8   9   10   11   12   13   14   >