Re: [GENERAL] Immutable attributes?

2005-04-24 Thread Michael Fuhr
me text NOT NULL ); CREATE TRIGGER check_immutable BEFORE UPDATE ON foo FOR EACH ROW EXECUTE PROCEDURE noup('id'); INSERT INTO foo (name) VALUES ('name 1'); UPDATE foo SET id = 2; WARNING: id: update not allowed UPDATE 0 UPDATE foo SET name = 'nam

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

2005-04-25 Thread Michael Fuhr
ow to do it in practice in modern versions of PostgreSQL. As far as I can tell it's not possible (short of changing the type to text, as one of my earlier examples did), but again, I'd be pleased to be corrected (preferably with an example that works in 8.0.2). B

Re: [GENERAL] Immutable attributes?

2005-04-25 Thread Michael Fuhr
er. > > Do you mean that PostgreSQL 8 has immutable attributes ? I do not find > that. I think that was a comment about upgrading in general, not an implication that 8.0 supports a particular feature. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast

Re: [GENERAL] DDL from psql console?

2005-04-25 Thread Michael Fuhr
On Mon, Apr 25, 2005 at 10:44:14AM -0500, John Browne wrote: > > Yeah, I know about pg_dump. I just was curious if there was another > way, since I always have two psql consoles already open at all times > anyway. :-) You could do "\!pg_dump ..." -- Michael Fuhr http

Re: [GENERAL] plpgsql function not working

2005-04-25 Thread Michael Fuhr
g(): SELECT array_to_string(array( SELECT groupname FROM userinfo.userdb_groups WHERE username = 'jruff' ), ','); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] question about about future 8.1 and IN, INOUT, and OUT parameters

2005-04-25 Thread Michael Fuhr
BLE STRICT; SELECT foo(10, 20); foo - (25,15) (1 row) SELECT (foo(10, 20)).*; y | z + 25 | 15 (1 row) SELECT (foo).* FROM (SELECT foo(10, 20)) AS s; y | z ----+ 25 | 15 (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] About index - "a query or data manipulation command can use at most one index per table"

2005-04-26 Thread Michael Fuhr
an index if one is available: if the planner thinks a sequential scan will be faster than using an index, then it won't use the index. If you want to see whether an index scan *could* be used, then set enable_seqscan to off before running EXPLAIN. -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] After insert trigger question

2005-04-27 Thread Michael Fuhr
T: PL/pgSQL function "trigfunc" line 4 at assignment SELECT * FROM foo; x --- (0 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] After insert trigger question

2005-04-27 Thread Michael Fuhr
make a trigger before or after, the before case is more efficient, since the information about the operation doesn't have to be saved until end of statement." -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] populating a table via the COPY command using C code.

2005-04-27 Thread Michael Fuhr
iated with the COPY Command" in the libpq chapter of the documentation? http://www.postgresql.org/docs/8.0/interactive/libpq-copy.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archiv

Re: [GENERAL] populating a table via the COPY command using C code.

2005-04-27 Thread Michael Fuhr
you have a reason for using an intermediate file? Instead of writing data to the file and then reading it back, you could use PQputCopyData() or PQputline() to send the data directly to the database. Another possibility: if the file resides somewhere the backend can read, and if you can connect to th

Re: [GENERAL] Returning a RECORD, not SETOF RECORD

2005-04-28 Thread Michael Fuhr
AS s; z | y | x | b | a ---++++ 2005-04-28 12:47:17.953952-06 | 25 | 15 | 20 | 10 2005-04-28 12:47:17.954543-06 | 45 | 35 | 40 | 30 (2 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end

Re: [GENERAL] oid or schema name of current plpgsql function

2005-04-28 Thread Michael Fuhr
need is to extract the name of the schema where the > function is stored. Why do you need to know the function's schema? What are you trying to do? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get

Re: [GENERAL] Returning a RECORD, not SETOF RECORD

2005-04-28 Thread Michael Fuhr
ssed before or not. If nobody answers here then you might try pgsql-hackers. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Problem: message type 0xxx arrived from server while idle

2005-04-29 Thread Michael Fuhr
have some script, which dynamically outputs web-page content > and have get_user function call. > > If i update that page in browser too fast, then web server seems to hang up. What do you mean by "update too fast"? What exactly are you doing? -- Mic

Re: [GENERAL] out of memory for query result

2005-04-29 Thread Michael Fuhr
On Fri, Apr 29, 2005 at 10:47:36AM -0500, [EMAIL PROTECTED] wrote: > > DBD::Pg::st execute failed: out of memory for query result Have you considered using a cursor to fetch the query results? That should prevent the API from trying to load the entire result set into memory. -- Michae

Re: [GENERAL] unable to open editor.

2005-05-02 Thread Michael Fuhr
ToolTalk error. What editor are you trying to use? What's the value of the PSQL_EDITOR or EDITOR or VISUAL environment variable? Have you googled for this error message to see what might cause it and how to fix it? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ --

Re: [GENERAL] postgresql 8 abort with signal 10

2005-05-03 Thread Michael Fuhr
th debugging info. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] postgresql 8 abort with signal 10

2005-05-03 Thread Michael Fuhr
ld be named "postgres.core", not just "core", and it should be somewhere under $PGDATA. Whether a core file is produced is also affected by the kern.coredump sysctl setting and the coredumpsize resource limit. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -

Re: [GENERAL] postgresql 8 abort with signal 10

2005-05-03 Thread Michael Fuhr
On Tue, May 03, 2005 at 10:37:03AM -0600, Michael Fuhr wrote: > > Signal 10 is SIGBUS (bus error) on FreeBSD 4.11. Somewhere under > $PGDATA there might be a core dump named postmaster.core Correction: the core dump should be named postgres.core (at least it is on my FreeBSD 4.11-STAB

Re: [GENERAL] plpythonu and dollar quoting

2005-05-03 Thread Michael Fuhr
x27;d get a similar error in earlier versions. What version are you using? What does "SELECT version();" show? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Cursor problem

2005-05-06 Thread Michael Fuhr
out returning cursors from a PL/pgSQL function, see the documentation: http://www.postgresql.org/docs/8.0/interactive/plpgsql-cursors.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Extracting date from timestamp

2005-05-06 Thread Michael Fuhr
s and Operators" chapter of the documentation. http://www.postgresql.org/docs/8.0/interactive/functions-formatting.html http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] Array manipulation/syntax question

2005-05-09 Thread Michael Fuhr
SELECT some_column FROM some_table); See "Array Constructors" in the "Value Expressions" section of the "SQL Syntax" chapter of the documentation: http://www.postgresql.org/docs/8.0/interactive/sql-expressions.html#SQL-SYNTAX-ARRAY-CONSTRUCT

Re: [GENERAL] Error when try installing pgbench ?

2005-05-15 Thread Michael Fuhr
of GNU make. Install the latter if you haven't already and use gmake instead of make. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [GENERAL] function bit(integer)

2005-05-15 Thread Michael Fuhr
| bit, integer, boolean pg_catalog | bit | bit | integer (3 rows) See also the 8.0 Release Notes to see how casting to bit(n) has changed. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Sequences question & problem

2005-05-16 Thread Michael Fuhr
al column "foo.id" CREATE TABLE test=> ALTER TABLE foo RENAME TO foo2; ALTER TABLE test=> ALTER TABLE foo2 RENAME id TO id2; ALTER TABLE test=> SELECT pg_get_serial_sequence('foo2', 'id2'); pg_get_serial_sequence public.foo_id_seq (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] Executing Dynamic DDL

2005-05-18 Thread Michael Fuhr
declared VOLATILE. And if the function requires a non-NULL parameter then it should be STRICT as well. BTW, the all_table_columns table appears to duplicate information already contained in the system catalogs. Is this a contrived example or are you really doing that? Do you have a reason for d

Re: [GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread Michael Fuhr
ct Could you post a simple, self-contained example that exhibits this problem? Debugging would be easier if we could see what you're doing. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the planner will ignore your

Re: [GENERAL] plpython error since upgrading from 7.x to 8.x

2005-05-25 Thread Michael Fuhr
cause when the event is INSERT, TD["old"] is None and thus unsubscriptable. But if that's the case then I'm not sure why the version of PostgreSQL would matter, and without seeing a complete example I'm not convinced that it does. Do you still get the error if you check i

Re: [GENERAL] writing a file using procedure

2005-06-02 Thread Michael Fuhr
pabilities of the underlying > procedural language. To qualify the above: only database superusers can create functions written in an untrusted language, but any user can call such functions. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)---

Re: [GENERAL] SQL call to get pid of current connection

2005-06-02 Thread Michael Fuhr
ing Database Activity" chapter; it's been around since 7.3: http://www.postgresql.org/docs/7.3/interactive/release-7-3.html http://www.postgresql.org/docs/7.3/interactive/monitoring-stats.html http://www.postgresql.org/docs/7.4/interactive/monitoring-stats.html http://www.postgresql.o

Re: [GENERAL] survey of the postgresql communiity

2005-06-05 Thread Michael Fuhr
74.php I've been asked to be interviewed for this study. Is anybody familiar with this organization? Has anybody else been contacted privately? If so, what were your thoughts about participating? Feel free to respond off-list if you prefer. Thanks. -- Michael Fuhr http://ww

Re: [GENERAL] Download mirrors not found?

2005-06-06 Thread Michael Fuhr
ere were any problems around the time you checked (presumably around 07:00 UTC, based on your message time). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] transactions

2005-06-06 Thread Michael Fuhr
because of something Transaction A did previously. Foreign key relationships are a typical cause, but even UPDATEs on simple tables can cause later operations to deadlock if the application isn't careful with its order of operations. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [GENERAL] how to get sequence list ?

2005-06-06 Thread Michael Fuhr
/www.postgresql.org/docs/8.0/static/app-psql.html http://www.postgresql.org/docs/8.0/static/catalog-pg-class.html Alternatively, you could try to query the sequence itself: SELECT * FROM seq_serial; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -

Re: [GENERAL] return two elements

2005-06-07 Thread Michael Fuhr
res/xfunc-sql.html#XFUNC-OUTPUT-PARAMETERS -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] return two elements

2005-06-07 Thread Michael Fuhr
ions that use OUT: http://developer.postgresql.org/docs/postgres/plpgsql-declarations.html#PLPGSQL-DECLARATION-ALIASES -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Password authentication failed for user

2005-06-07 Thread Michael Fuhr
ins by IP address? If so, has the user's IP address changed? It might be useful to see the contents of pg_hba.conf. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Copying data from int column to array column

2005-06-08 Thread Michael Fuhr
n empty array: UPDATE test SET field3 = '{}' WHERE field3 IS NULL; UPDATE test SET field3[1] = field1; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] return two elements

2005-06-08 Thread Michael Fuhr
wing example works in HEAD: CREATE FUNCTION foo(INOUT y integer, OUT z integer) RETURNS SETOF record AS $$ BEGIN y := y + 1; z := y + 2; RETURN NEXT; y := y + 1; z := z + 3; RETURN NEXT; y := y + 1; z := z + 4; RETURN NEXT; END; $$ LANGUAGE plpgsql; SELECT * FROM foo(1); y | z

Re: [GENERAL] Reliably finding temporary table

2005-06-10 Thread Michael Fuhr
IN BEGIN CREATE TEMPORARY TABLE test_date_time (...); EXCEPTION WHEN DUPLICATE_TABLE THEN NULL; END; RETURN; END; $$ LANGUAGE plpgsql VOLATILE; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Setting all elements in an Bool[] array to the same value

2005-06-10 Thread Michael Fuhr
o ORDER BY id; id | barray |iarray +---+------- 1 | {f,f} | {0,0,0} 2 | {f,f,f,f} | {0,0,0,0,0,0} (2 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] psql: FATAL: database "template1" is not currently accepting connections

2005-06-17 Thread Michael Fuhr
following query? SELECT datname, datallowconn FROM pg_database; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL

Re: [GENERAL] Deleting a rule?

2005-06-17 Thread Michael Fuhr
On Fri, Jun 17, 2005 at 03:27:30PM -0700, Benjamin Smith wrote: > > How do I drop a rule? With DROP RULE. Here's a link to the documentation for the latest release: http://www.postgresql.org/docs/8.0/static/sql-droprule.html If that doesn't work then please provide more in

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-19 Thread Michael Fuhr
ilities. Perhaps you should rethink using a check constraint that depends on other data -- what's that check do? Is it something that a foreign key constraint couldn't handle? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-20 Thread Michael Fuhr
checked when it's inserted or updated, but not when the referred-to data is modified. For that you'd need another constraint or trigger that knows how to check all the dependent data. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [GENERAL] External (asynchronous) notifications of database updates

2005-06-20 Thread Michael Fuhr
le > hack - when I get a notification, I wait for 10 seconds and then read > the whole table... It works for me now, but might not work tomorrow. What do you mean by "notification"? A trigger-based notification? Or are you already using LISTEN/NOTIFY? -- Michael Fuhr http://www.

Re: [GENERAL] External (asynchronous) notifications of database updates

2005-06-20 Thread Michael Fuhr
se replication tools must have existed > before the LISTEN/NOTIFY mechanism has been introduced to PG. Have they? I don't know the history of the replication tools, but the Release Notes for Postgres95 0.03 from ten years ago mention LISTEN/NOTIFY: http://www.postgresql.org/docs/8.0/s

Re: [GENERAL] users, address record restrictions

2005-06-20 Thread Michael Fuhr
he documentation: http://www.postgresql.org/docs/8.0/static/server-programming.html You could also search the list archives for phrases like "CREATE FUNCTION" -- many examples have been posted to the mailing lists over the years. See also resources like the General Bits newsletter: http:

Re: [GENERAL] compilation postgresql/solaris error

2005-06-21 Thread Michael Fuhr
thout any problems. > ../../../../src/include/utils/builtins.h:837: internal compiler error: > Segmentation Fault > Please submit a full bug report, > with preprocessed source if appropriate. > See http://gcc.gnu.org/bugs.html> for instructions. Looks like you should contact the co

Re: [GENERAL] Setting global vars for use with triggers

2005-06-22 Thread Michael Fuhr
ion's file descriptor as you would in C with PQsocket(). If you use PHP then you might be stuck with sleep/check, so you might want to consider writing the listener in another language. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [GENERAL] PROBLEM: Function does not exist

2005-06-22 Thread Michael Fuhr
> HINT: No function matches the given name and argument types. You may need to > add explicit type casts. Follow the hint: use explicit type casts for the int2 arguments. Try this: select INTGR, TMSTP from INSERT_BF_FILTER(53, 1354, 'test_filter_name', 'test_filter_descr

Re: [GENERAL] fields and foreign keys

2005-06-23 Thread Michael Fuhr
that psql executes (run "psql -E" or execute "\set ECHO_HIDDEN" and then execute "\d tablename"). Here's an example: SELECT conrelid::regclass, conname, pg_get_constraintdef(oid) FROM pg_constraint WHERE contype = 'f'; -- Michael Fuhr http

Re: [GENERAL] plpgsql and schema

2005-06-23 Thread Michael Fuhr
ounds are mentioned. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] plpgsql constraint checked data fails to restore

2005-06-23 Thread Michael Fuhr
. [...] ALTER TABLE ONLY foo ADD CONSTRAINT foo_pkey PRIMARY KEY (id); [...] ALTER TABLE ONLY bar ADD CONSTRAINT bar_fooid_fkey FOREIGN KEY (fooid) REFERENCES foo(id); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] plpgsql and schema

2005-06-23 Thread Michael Fuhr
On Thu, Jun 23, 2005 at 09:33:27AM -0600, Michael Fuhr wrote: > > http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN > > Note what the documentation says about not being able to get the > result of an EXECUTE query directly. A couple

Re: [GENERAL] Problem with catching my own exception messages.

2005-06-24 Thread Michael Fuhr
ives.postgresql.org/pgsql-committers/2005-06/msg00135.php -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] fields and foreign keys

2005-06-24 Thread Michael Fuhr
That is, something like "given the following table definitions, I'm looking for a query that will give me this output" What problem are you trying to solve? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] fields and foreign keys

2005-06-24 Thread Michael Fuhr
umn-usage.html http://www.postgresql.org/docs/8.0/static/infoschema-constraint-column-usage.html http://www.postgresql.org/docs/8.0/static/infoschema-referential-constraints.html http://www.postgresql.org/docs/8.0/static/infoschema-table-constraints.html -- Michael Fuhr http://www.fuhr.o

Re: [GENERAL] automating backup ?

2005-06-26 Thread Michael Fuhr
nal data they can do only what you grant them permission to do. If you don't want users to copy data then don't grant them select privilege on it, and make sure they don't have database superuser or operating system superuser (administrator) privileges on the database ser

Re: [GENERAL] automating backup ?

2005-06-26 Thread Michael Fuhr
On Sun, Jun 26, 2005 at 06:59:14AM -0600, Michael Fuhr wrote: > On Sun, Jun 26, 2005 at 11:18:31AM +0200, Zlatko Matic wrote: > > > > How to automate backup, so that Postgres automatically backups, for > > example, once in a week ? > > Using the operating system'

Re: [GENERAL] Generate a list of (days/hours) between two dates

2005-06-28 Thread Michael Fuhr
0'::timestamp + x * interval'1 day' FROM generate_series(0, 9) AS g(x); generate_series() is a function in PostgreSQL 8.0 and later, but it's trivial to write in earlier versions using PL/pgSQL. http://www.postgresql.org/docs/8.0/static/functions-srf.html -- Michael Fuhr htt

Re: [GENERAL] 8.1 Out parameter question

2005-06-29 Thread Michael Fuhr
ter of the development documentation: http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING See also the example I posted and Alvaro's comments in the following message from a few weeks ago: http://archives.postgresql.org/pgsql-general/2005-0

Re: [GENERAL] Explain Analyse never returns .. maybe a bug

2005-06-29 Thread Michael Fuhr
t ANALYZE show? What are the table definitions and what are the results of the following queries? SELECT COUNT(*) FROM IC; SELECT COUNT(*) FROM IR; SELECT COUNT(*) FROM IR WHERE IRSTATUT IN (1, 2); SELECT COUNT(DISTINCT IRICNUM) FROM IR WHERE IRSTATUT IN (1, 2); Have you run VACUUM ANALYZE on the

Re: [GENERAL] question abut "order by" null fields

2005-07-01 Thread Michael Fuhr
e you running, and on what platform? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match

Re: [GENERAL] Hot to restrict access to subset of data

2005-07-01 Thread Michael Fuhr
ould have the application connect to the database as a particular user and grant permissions on the table only to that user. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] cross references queries

2005-07-01 Thread Michael Fuhr
e able to do what you want. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Get Query in Statement Level Trigger?

2005-07-01 Thread Michael Fuhr
than that, but probably not what you're after: http://www.postgresql.org/docs/8.0/static/plpgsql-trigger.html What information are you looking for and why? What problem are you trying to solve? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] Hot to restrict access to subset of data

2005-07-02 Thread Michael Fuhr
of your own environment; there's no universal "this way is better" answer. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] plpythonu and bytea

2005-07-02 Thread Michael Fuhr
02\000\003\004 | 5 (1 row) It seems like there ought to be a better way than the list comprehension shown; maybe you or somebody else with better Python skills can improve on it. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] SET AUTOCOMMIT TO OFF is no longer supported

2005-07-03 Thread Michael Fuhr
OFF > is no longer supported. Server-side AUTOCOMMIT was removed in 7.4 for having been a Bad Idea. http://www.postgresql.org/docs/7.4/static/release-7-4.html http://archives.postgresql.org/pgsql-committers/2003-05/msg00080.php -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---

Re: [GENERAL] double entries into database when using IE

2005-07-05 Thread Michael Fuhr
n't useful to your application per se, but that eliminates the irrelevant factors so you can focus on what matters. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] How can I make SELECT return tuple numbers?

2005-07-05 Thread Michael Fuhr
o work in simple tests, although I admittedly haven't thought it through very far to see if there would be any problems. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] How can I make SELECT return tuple numbers?

2005-07-05 Thread Michael Fuhr
On Tue, Jul 05, 2005 at 09:55:48PM -0600, Michael Fuhr wrote: > > You could reset a sequence's start value before each insert. You > might even be able to it automagically with a statement-level before > trigger that resets the sequence value and a DEFAULT expression or > ro

Re: [GENERAL] Seg fault in postgres 7.4.7?

2005-07-06 Thread Michael Fuhr
source/package, > what OS, what OS version, character set, locale, any patches/add-on > modules). Did you get a core dump? If so then it might be useful to see a stack trace from it. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)-

Re: [GENERAL] Adding miscadmin.h generates errors ?

2005-07-06 Thread Michael Fuhr
res 8.0.3. GCC 3.4.3 20050227. If you're writing server-side code then you should be including postgres.h before any other headers. See "Writing Code" in the "C-Language Functions" section of the "Extending SQL" chapter of the documen

Re: [GENERAL] Seg fault in postgres 7.4.7?

2005-07-06 Thread Michael Fuhr
look for a core dump? Do you have a resource limit or other setting that prevents them? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index

Re: [GENERAL] table name as variable within Function

2005-07-07 Thread Michael Fuhr
gt; BEGIN > result = COUNT(*) FROM theTable; -- this is where i need help > RETURN result; > > END; 'LANGUAGE 'plpgsql'; See "Executing Dynamic Commands" in the PL/pgSQL documentation: http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL

Re: [GENERAL] find objects under a specific tablespace

2005-07-07 Thread Michael Fuhr
ablespace does this index belong to? Aside from querying the system catalogs, you could use "\d idx_test1" in psql -- that should show the index's tablespace. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)---

Re: [GENERAL] A trigger that acts on a column with a given column name

2005-07-07 Thread Michael Fuhr
nguage like PL/Perl, PL/Tcl, or PL/Python. See the PL/Tcl documentation for an example: http://www.postgresql.org/docs/8.0/static/pltcl-trigger.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubs

Re: [GENERAL] Joins with aggregate data

2005-07-07 Thread Michael Fuhr
IN (SELECT grp, count(bad), sum(bad) FROM righty GROUP BY grp) AS b USING (grp); -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [GENERAL] Joins with aggregate data

2005-07-07 Thread Michael Fuhr
t; but changed it to "USING (grp)" and neglected to get rid of that coalesce. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [GENERAL] Postgresql 7.4.8 inconsistent index usage

2005-07-08 Thread Michael Fuhr
ce the estimated cost of an index scan. Beware of tweaking cost estimate settings based on one particular query, though. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] dump the database data

2005-07-08 Thread Michael Fuhr
SERT statements don't update the sequence because they provide a value for the serial column (really an integer column), so the DEFAULT expression (a call to nextval()) isn't used. But somewhere in the dump should be a SELECT statement that calls setval() to upda

Re: [GENERAL] dump the database data

2005-07-08 Thread Michael Fuhr
t;user"', 'id'), 7, true); Did you do a visual search or did you use a command like "grep setval filename"? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: if posting/reading thro

Re: [GENERAL] Postgresql 7.4.8 inconsistent index usage

2005-07-08 Thread Michael Fuhr
on choosing appropriate values: http://www.powerpostgresql.com/PerfList/ You mentioned that you've analyzed the table, but have you also vacuumed it recently? BTW, I should have mentioned earlier that this thread might be on-topic in pgsql-performance. -- Michael Fuhr http://www

Re: [GENERAL] Postgresql 7.4.8 inconsistent index usage

2005-07-08 Thread Michael Fuhr
depending on how much memory other processes are using up. Tuning guides like the one I mentioned and the folks in pgsql-performance should be able to help determine good values to use. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] PL/pgGRESQL, SHA, BYTEA - Creating SHA1 hash for Bytea Value in stored procedure

2005-07-09 Thread Michael Fuhr
rib/pgcrypto module. BTW, it's PostgreSQL or Postgres, not PostGRE. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EM

Re: [GENERAL] Transaction isolation levels

2005-07-09 Thread Michael Fuhr
execution by concurrent transactionsThis is different from Read Committed in that the SELECT sees a snapshot as of the start of the *transaction*, not as of the start of the current query within the transaction. -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] index usage in multi-column ORDER BY

2005-07-09 Thread Michael Fuhr
TE INDEX c1_idx ON t(c2); > CREATE INDEX c2_idx ON t(c2); Not that it changes anything, but I assume you meant to create the first index on c1. I'll defer an explanation of the sequential scan behavior to somebody who understands the planner better. -- Michael

Re: [GENERAL] upgrading from 8.0 rc5

2005-07-11 Thread Michael Fuhr
ng a backup before doing an upgrade would be prudent in any case. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Db and schema names in logged errors

2005-07-12 Thread Michael Fuhr
g/docs/8.0/static/runtime-config.html#RUNTIME-CONFIG-LOGGING -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] export/import database

2005-07-12 Thread Michael Fuhr
n regarding backup and restore. http://www.postgresql.org/docs/8.0/static/backup.html http://www.postgresql.org/docs/8.0/static/reference-client.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: if posting/reading through

Re: [GENERAL] Temp tables...

2005-07-12 Thread Michael Fuhr
ows=50 loops=1) Index Cond: ((id >= 1) AND (id <= 50)) Total runtime: 7.820 ms (6 rows) If that's not the problem, then do other tables have foreign key references to the table(s) you're updating? If so, then you might need indexes on the foreign key columns in t

Re: [GENERAL] pgcrypto : how to get SHA1(string) as a 40-char string, NOT binary string?

2005-07-13 Thread Michael Fuhr
h? (Or how to convert a binary-hash > into a-z0-9 chars?) Use encode(). http://www.postgresql.org/docs/8.0/static/functions-binarystring.html SELECT encode(digest('blue', 'sha1'), 'hex'); encode -----

Re: [GENERAL] Strange memory behaviour with PGreset() ...

2005-07-13 Thread Michael Fuhr
ut what the problem is -- what behavior are you expecting or wanting to see, and what behavior are you actually seeing? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Have you searched our list archives

Re: [GENERAL] stored proc help

2005-07-13 Thread Michael Fuhr
xt > > What am I doing wrong? The function is declared to return SETOF INTEGER, but you return a RECORD variable: > return next returnRec; Try returning returnRec.permissionid instead. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadc

Re: [GENERAL] foreign key constraints and inheritence

2005-07-17 Thread Michael Fuhr
is that indexes (including unique constraints) and foreign key constraints only apply to single tables, not to their inheritance children. This is true on both the referencing and referenced sides of a foreign key constraint." -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] foreign key constraints and inheritence

2005-07-17 Thread Michael Fuhr
This > >is true on both the referencing and referenced sides of a foreign > >key constraint." > > I would realy like to see this fixed. But I guess if it was easy then > someone would already have fixed it... It's on the developers' TODO list. I'm sure a p

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