Re: [GENERAL] Significado logo PostgreSQL

2004-12-10 Thread Michael Fuhr
/msg00306.php Here's an earlier suggestion to use an elephant because "elephants can remember...": http://archives.postgresql.org/pgsql-hackers/1997-04/msg00094.php -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] Checking inequality

2004-12-11 Thread Michael Fuhr
.series_id, -1) <> COALESCE(new.series_id, -1) THEN This assumes that you'd want two NULLs to compare as equal. You could also use CREATE OPERATOR to create an operator that behaves as you'd like. This has been discussed recently; see the list archives.

Re: [GENERAL] Checking inequality

2004-12-11 Thread Michael Fuhr
as I had suggested. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] relation "sql_features" does not exist

2004-12-11 Thread Michael Fuhr
ow! Let's find out what the problem is before attempting a solution that may or may not be appropriate or necessary. -- 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] How to get rid of notices for create table?

2004-12-11 Thread Michael Fuhr
e NOTICE messages for the implicitly-created indexes; you can do this by setting configuration variables that tell PostgreSQL what level of messages you want to see. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get o

Re: [GENERAL] using postgresql functions from php

2004-12-11 Thread Michael Fuhr
27;ll caution you about something else: SQL injection. Have the variables $fname, $mi, etc., been properly escaped to prevent malicious code from being injected into your SELECT statement? Malicious intent aside, a name like O'Reilly could cause problems if the variables aren't escaped. If your database interface supports placeholders then I'd suggest using them (unless they're known to be broken). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] Index scan vs. Seq scan on timestamps

2004-12-11 Thread Michael Fuhr
f session start CURRENT_TIMESTAMP is fixed to the time of transaction start, not session start; this is documented and observable behavior. Can you demonstrate otherwise? If so, on what version of PostgreSQL? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] PREPARED STATEMENT

2004-12-12 Thread Michael Fuhr
an once. Are you not getting that crash? If not, what version of PostgreSQL are you running? I discovered the bug in 8.0.0rc1 and it appears to exist in 7.4.6 as well. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] increasing max_connections on freebsd

2004-12-14 Thread Michael Fuhr
nel. For example, on FreeBSD 4, trying to set kern.ipc.semmni or kern.ipc.semmns with sysctl fails, saying that the OID is read-only. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregis

Re: [GENERAL] Copy row from table to table

2004-12-14 Thread Michael Fuhr
ons being the same. Didn't it work? If not, what happened? -- 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 PROT

Re: [GENERAL] query or schema question

2004-12-14 Thread Michael Fuhr
ke you want to join the students table to departments, and departments to universities. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/doc

Re: [GENERAL] catching script errors in PSQL and redirecting to file?

2004-12-14 Thread Michael Fuhr
in NOTICE messages like "CREATE TABLE will create implicit sequence" then you could use client_min_messages to filter them out: SET client_min_messages TO ERROR; -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Running functions that return void in psql

2004-12-15 Thread Michael Fuhr
derstand how to > test these ones that return void from psql. Thanks. You could issue queries to verify that the expected inserts, updates, or deletes (and only those operations) were actually done. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadc

Re: [GENERAL] bytea internal encoding

2004-12-15 Thread Michael Fuhr
variable-length data and the relevant examples in the "C-Language Functions" section of the "Extending SQL" chapter in the documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe an

Re: [GENERAL] Aggregates not allowed in WHERE clause?

2004-12-15 Thread Michael Fuhr
UM(quantity) FROM info GROUP BY name HAVING SUM(quantity) > 20; http://www.postgresql.org/docs/7.4/static/tutorial-agg.html http://www.postgresql.org/docs/7.4/static/queries-table-expressions.html#QUERIES-GROUP http://www.postgresql.org/docs/7.4/static/sql-select.html -- Michael Fuhr h

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Michael Fuhr
? You can reformat it with to_char() if need be. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that

Re: [GENERAL] MD5

2004-12-16 Thread Michael Fuhr
quot;unknown","unknown") Please show the SQL statement you executed and the complete, exact error message. Did you build and install pgcrypto? It's likely not installed on your system by default. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of b

Re: [GENERAL] sorting problem

2004-12-16 Thread Michael Fuhr
e the database cluster with a locale setting other than "C". Hmmm...did I misunderstand something when I recommended using ORDER BY LOWER(person.lastname)? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you c

Re: [GENERAL] Non-aggregate values attached to aggregates?

2004-12-16 Thread Michael Fuhr
On Thu, Dec 16, 2004 at 03:21:35PM -0800, Benjamin Smith wrote: > On Thursday 16 December 2004 14:09, Michael Fuhr wrote: > > > Dates are kept as ]MMDD', eg 2004114 for Nov 14, 2004. > > > > Why not use a DATE type? You can reformat it with to_char() if > &

Re: [GENERAL] tsearch2 avoiding firing of triggers.....

2004-12-16 Thread Michael Fuhr
UPDATE OR INSERT ON foo FOR EACH ROW EXECUTE PROCEDURE tsearch2(idxfield, fieldname); You might have to write your own trigger function that mimics tsearch2(), but only if the field value changes. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--

Re: [GENERAL] Spanning tables

2004-12-10 Thread Michael Fuhr
greSQL 8.0 you'll be able to use tablespaces. For earlier versions, see the "Alternative Locations" section of the "Managing Databases" chapter in the documentation, as well as the documentation for "initlocation" under "PostgreSQL Server Applications"

Re: [GENERAL] Loading data from tab delimited file using COPY

2004-12-10 Thread Michael Fuhr
rror: ERROR: missing data for column "builder" > > When opened with excel as a tab delimited file all the fields are > separated correctly, I know this e-mail is pretty long but I'm stumped. Your sample data has 85 fields but the table has 87 fields, so COPY complains.

Re: [GENERAL] question: how to preload data and excute table creation scripts

2004-12-11 Thread Michael Fuhr
t way if you make a mistake and psql raises an error, you're not left with the work half done. See also the ON_ERROR_STOP variable in the psql documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] Substring question

2004-12-13 Thread Michael Fuhr
l meaning in PostgreSQL string literals. To write a pattern constant that contains a backslash, you must write two backslashes in the statement. SELECT substring(primer_name, '(\\w+)\\d\\d\\d\\d[c]*_[fr]$') FROM primer; substring --- Rv Rv Rv (3 rows)

Re: [GENERAL] Multiple foreign keys on same field

2004-12-13 Thread Michael Fuhr
rential > integrity thing, I just want the automatic delete/update half. Do you mean that you don't need foreign key constraints to enforce referential integrity, but only to cascade changes to another table? If so, have you considered using triggers instead? Or have I

Re: [GENERAL] Spanning tables

2004-12-13 Thread Michael Fuhr
atedatabase.html I'd recommend testing this before doing it on a production server. I've never done it myself so I don't know if there are any potential problems. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [GENERAL] increasing max_connections on freebsd

2004-12-14 Thread Michael Fuhr
d also work in FreeBSD 4. Thanks. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] Which (table) lock mode to use

2004-12-14 Thread Michael Fuhr
27; conflicts and decide which is most appropriate. But again, what problem are you trying to solve? Maybe there's a better way than locking an entire table. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- T

Re: [GENERAL] transactions, functions, foreign keys

2004-12-15 Thread Michael Fuhr
ave seen coming.) Have you actually seen this problem? I don't know if PostgreSQL's visibility rules have changed, but I just tested what you describe in 7.4.6 and 8.0.0rc1 and it works. What version of PostgreSQL are you using? Could you post a complete example that exhibits the probl

Re: [GENERAL] pl/pgsql oddity

2004-12-16 Thread Michael Fuhr
e use the same bloody spelling. I'm forever forgetting whether a particular language uses ELSE IF, ELSEIF, ELSIF, or ELIF. Grumble, grumble, grumble -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/read

Re: [GENERAL] MD5

2004-12-16 Thread Michael Fuhr
yption mechanism see contrib/pgcrypto. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] sorting problem

2004-12-16 Thread Michael Fuhr
.lastname) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] Multi row sequence?

2004-12-18 Thread Michael Fuhr
ot;Triggers" chapter in the documentation, as well as the "Trigger Procedures" section of the "PL/pgSQL - SQL Procedural Language" chapter and the "Concurrency Control" chapter. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadca

Re: [GENERAL] A "cascade on delete" constraints deletes AFTER the source is gone??

2004-12-19 Thread Michael Fuhr
you trying to solve? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through

Re: [GENERAL] A "cascade on delete" constraints deletes AFTER the source is gone??

2004-12-20 Thread Michael Fuhr
to > be all happening AFTER the deletion. Is there a reason you can't maintain vote_count with a trigger on Books? Could you post a minimal but complete example (CREATE statements and INSERT or COPY statements with sample data) so we can get a better idea of what you're trying to do?

Re: [GENERAL] A "cascade on delete" constraints deletes AFTER the source is gone??

2004-12-20 Thread Michael Fuhr
On Mon, Dec 20, 2004 at 04:31:59PM +0300, ON.KG wrote: > I need to make function which emulates table and returns setof columns > of this "table" Please start a new thread with a descriptive subject -- the message you posted was a followup to a thread covering a different top

Re: [GENERAL] default index created for primary key

2004-12-22 Thread Michael Fuhr
to solve by removing it? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] valid using INITIALLY DEFERRED

2004-12-22 Thread Michael Fuhr
types are not deferrable." -- 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] bytea

2004-12-23 Thread Michael Fuhr
PostgreSQL might have a function to convert data to the necessary format. How are you communicating with the database? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister comman

Re: [GENERAL] select as

2004-12-23 Thread Michael Fuhr
s. See the "System Catalogs" and "The Information Schema" chapters in the PostgreSQL documentation (Information Schema is available in 7.4 and later). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5:

Re: [GENERAL] update table with row locking

2004-12-23 Thread Michael Fuhr
you need more control then you could use SELECT FOR UPDATE or LOCK. For more information see the "Concurrency Control" chapter in the documentation. What problem are you trying to solve? Depending on what you're doing, you might not need to use explicit locking. -- Michael Fuhr ht

Re: [GENERAL] Caching/Indexing Function Output

2004-12-23 Thread Michael Fuhr
ve the cost of a database query. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your messa

Re: [GENERAL] Get current trasanction id

2004-12-27 Thread Michael Fuhr
On Mon, Dec 27, 2004 at 09:52:57AM +0100, Marek Lewczuk wrote: > is there any way to get current transaction id using plpgsql or sql ? A couple of people have posted suggestions but I'll ask a question: Why do you want the transaction ID? What problem are you trying to solve? -- Mich

Re: [GENERAL] update table with row locking

2004-12-29 Thread Michael Fuhr
lation level might also work. See the "Transaction Isolation" section in the "Concurrency Control" chapter of the documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] [PATCHES] reqd patch

2004-12-30 Thread Michael Fuhr
ord variable, or a comma-separated list of simple variables." > pls can u help me . can u send me one example of cursur The PostgreSQL documentation has examples in the "Cursors" section of the PL/pgSQL chapter. If those aren't helpful, then please describe what you&

Re: [GENERAL] 'distinct on' and 'order by' conflicts of interest

2004-12-31 Thread Michael Fuhr
set > culling by only part of the record. Does anyone have the syntax for this? Define the problem, not how you think it should be solved. What are you trying to do? If you can't get the query to work, then please post SQL statements to create and populate a table and describe the que

Re: [GENERAL] Function Parameters

2005-01-01 Thread Michael Fuhr
quot;There is no specific upper limit, although large values will waste system-table space and processing time" and "Changing these requires an initdb." -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)

Re: [GENERAL] Shared Sequences?

2005-01-02 Thread Michael Fuhr
quence across databases? Could you use separate schemas in one database instead of separate databases? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate sub

Re: [GENERAL] Function Parameters

2005-01-02 Thread Michael Fuhr
so many parameters). Hacking the code should only be a last resort. -- 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] help with a stored procedure

2005-01-03 Thread Michael Fuhr
ted. See "Obtaining the Result Status" in the "Basic Statements" section of the PL/pgSQL documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] changing column from int4 to int8, what happens with indexes?

2005-01-04 Thread Michael Fuhr
xes and simple table constraints involving the column will be automatically converted to use the new column type by reparsing the originally supplied expression. If you did something else, then what was it? -- Michael Fuhr http://www.fuhr.org/~mfuhr/

Re: [GENERAL] changing column from int4 to int8, what happens with indexes?

2005-01-04 Thread Michael Fuhr
On Tue, Jan 04, 2005 at 09:08:51AM -0700, Michael Fuhr wrote: > On Tue, Jan 04, 2005 at 09:47:30AM +0100, David Teran wrote: > > > well, i think the answer is simple 'it works' but i am not sure. When i > > change the column type from int4 to int8, are the indexes st

Re: [GENERAL] [Fwd: How to use LISTEN / NOTIFY in a Perl program]

2005-01-04 Thread Michael Fuhr
my $notify = $dbh->func("pg_notifies"); if ($notify) { my ($relname, $pid) = @$notify; my $row = $dbh->selectrow_hashref("SELECT now()"); print "$relname from PID $pid at $row->{now}\n"; } } -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] Passing a ROWTYPE to a function

2005-01-05 Thread Michael Fuhr
/pgSQL For example, it now works to pass a rowtype variable to another function as a single variable. I don't think you could do this in versions prior to 8.0; see previous discussion in the list archives. For example: http://archives.postgresql.org/pgsql-general/2004-03/msg00862.php --

Re: [GENERAL] Index on a view??

2005-01-05 Thread Michael Fuhr
alized view. PostgreSQL doesn't have materialized views per se but it does have functionality that can implement them. What problem are you trying to solve? Can you give us an example of what you're trying to do? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(

Re: [GENERAL] Trigger Question

2005-01-05 Thread Michael Fuhr
On Wed, Jan 05, 2005 at 02:56:27PM -0500, Terry Lee Tucker wrote: > > Is there any way to pass dynamic data into a trigger function? I think the > answer is no, but just in case... What do you mean by "dynamic data"? What problem are you trying to solve? -- Michael Fuhr

Re: [GENERAL] Trigger Question

2005-01-05 Thread Michael Fuhr
in the AFTER UPDATE trigger? As I mentioned above, an example might explain things better. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] Trigger Question

2005-01-05 Thread Michael Fuhr
trying to do. http://www.catb.org/~esr/faqs/smart-questions.html#goal http://www.catb.org/~esr/faqs/smart-questions.html#beprecise -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] pg_dump dependencies

2005-01-06 Thread Michael Fuhr
ependentView. However, when I feed my dump script to psql, it is > attempting to make vwDependentView first and failing. What version of PostgreSQL are you using? pg_dump tends to improve with each release; I couldn't duplicate your problem in 8.0.0rc3 or 7.4.6. -- Michael Fuhr http:/

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Michael Fuhr
mentation so I'd suggest starting there. If the documentation doesn't cover something you want to know then please provide more info about what you're looking for. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- T

Re: [GENERAL] Books for experienced DB developer

2005-01-07 Thread Michael Fuhr
column definition list, so the query must know in advance what record type the function will return. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] MS-SQL to PostgreSQL

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 10:00:47PM +0200, Craig Bryden wrote: > I am not sure of the query part and in particular the assignment of the > values to the variables See SELECT INTO in the PL/pgSQL documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
.. > Is this is a bug, or has something regarding triggerfunctions and > parameters changed in 8.0 Changed since when? Are you saying this worked in an older version of PostgreSQL? If so, what version? The paragraph I quoted above goes back to at least 7.2. -- Michael Fuhr http://www.fuhr.or

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
LUES (123); INFO: trigger argument = insert argument INSERT 0 1 test=> UPDATE foo SET x = 456; INFO: trigger argument = update argument UPDATE 1 -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the planner will

Re: [GENERAL] Problem creating trigger-function with arguments (8.0rc4)

2005-01-07 Thread Michael Fuhr
On Fri, Jan 07, 2005 at 03:57:44PM -0700, Michael Fuhr wrote: > By accessing TG_ARGV (not TGARGS) in the function. Tom was probably thinking in C when he said TGARGS. The Trigger type (struct Trigger) has a tgargs member. -- Michael Fuhr http://www.fuhr.org/~mf

Re: [GENERAL] Function for retreiving datatype

2005-01-10 Thread Michael Fuhr
On Tue, Jan 11, 2005 at 03:28:08AM +1100, Brendan Jurd wrote: > Does postgres have a function to determine the data type of an > argument? In what context? What problem are you trying to solve? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of bro

Re: [GENERAL] SELECT from multiple tables (not join though)

2005-01-10 Thread Michael Fuhr
On Mon, Jan 10, 2005 at 12:22:41PM -0500, Madison Kelly wrote: > What I need is to return all of the matches in all of the tables > in a single column. Maybe you're looking for UNION -- see the "Combining Queries" section in the "Queries" chapter of the docume

Re: [GENERAL] Function for retreiving datatype

2005-01-10 Thread Michael Fuhr
developers. I'm not sure what the best list would be -- maybe pgsql-bugs if you consider the terse message to be a bug, or maybe pgsql-hackers since it's a proposed enhancement. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [GENERAL] does "select count(*) from mytable" always do a seq

2005-01-10 Thread Michael Fuhr
mentation is best? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] Function for retreiving datatype

2005-01-10 Thread Michael Fuhr
en you could use a descriptor area. If you're writing a server-side C program that makes queries via SPI then you could use the functions defined under "Interface Support Functions" in the "Server Programming Interface" chapter. Is that what you're looking for? --

Re: [GENERAL] Function for retreiving datatype

2005-01-10 Thread Michael Fuhr
2005-01-02 | date (1 row) Is that anything like what you want? If not, then please be more specific about a particular problem you're trying to solve. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/read

Re: [GENERAL] Function for retreiving datatype

2005-01-10 Thread Michael Fuhr
d object file something other than coltype.so. Now watch, somebody will jump in and say, "Why'd you go to all that trouble? Here's an easier way" -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] datestyle formatting

2005-01-11 Thread Michael Fuhr
--- Tue Jan 11 01:31:25.6092 2005 MST (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [GENERAL] Modifying search_path in a stored procedure

2005-01-11 Thread Michael Fuhr
ing() and set_config() functions in the "Functions and Operators" chapter of the documentation. In 7.3 and 7.4 they're in the "Miscellaneous Functions" section; in 8.0 they're in "System Administration Functions." -- Michael Fuhr http://www.fuhr.org/~mfu

Re: [GENERAL] plpgsql/rule question

2005-01-11 Thread Michael Fuhr
On Tue, Jan 11, 2005 at 07:13:25PM -0700, Ed L. wrote: > > Is it possible to tell if a column in a NEW record in a plpgsql function was > explicitly specified as NULL or simply left out altogether? Why would you want to? What problem are you trying to solve? -- Michael

Re: [GENERAL] Postgresql 8.0 and Cancel/Kill backend functions

2005-01-12 Thread Michael Fuhr
; procpid | current_query -+--- ... 95609 | SELECT sleep(60); ... SELECT pg_cancel_backend(95609); Session 1: ERROR: canceling query due to user request -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] index on user defined type

2005-01-12 Thread Michael Fuhr
- Seq Scan on test (cost=1.00..10001.05 rows=1 width=36) (actual time=0.093..0.107 rows=1 loops=1) Filter: (((t).i = ('(2,3)'::type2).i) AND ((t).j = ('(2,3)'::type2).j)) Total runtime: 0.226 ms (3 rows) Table columns having a composite type are n

Re: [GENERAL] vacuum vs open transactions

2005-01-12 Thread Michael Fuhr
see when a session's current query started. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] Question about pg_stat_activity

2005-01-12 Thread Michael Fuhr
I can see the current query? Is stats_command_string set to true? Did you restart the backend after changing postgresql.conf? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ?

Re: [GENERAL] vacuum vs open transactions

2005-01-13 Thread Michael Fuhr
On Thu, Jan 13, 2005 at 08:44:56AM -0700, Ed L. wrote: > On Wednesday January 12 2005 11:30, Michael Fuhr wrote: > > > > I'm not aware of a way to find out when a transaction started, but > > if you have stats_command_string enabled then you can query > > pg_stat_

Re: [GENERAL] vacuum vs open transactions

2005-01-13 Thread Michael Fuhr
On Thu, Jan 13, 2005 at 09:50:38AM -0300, Alvaro Herrera wrote: > On Wed, Jan 12, 2005 at 11:30:50PM -0700, Michael Fuhr wrote: > > > > I'm not aware of a way to find out when a transaction started, but > > if you have stats_command_string enabled then you can query &

Re: [GENERAL] allowing connections from additional hosts without a restart?

2005-01-13 Thread Michael Fuhr
arting. See the section on pg_ctl in the "PostgreSQL Server Applications" part of the documentation. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] vacuum vs open transactions

2005-01-13 Thread Michael Fuhr
o add. Consider submitting a patch or proposing it to the developers. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] vacuum vs open transactions

2005-01-13 Thread Michael Fuhr
On Thu, Jan 13, 2005 at 10:33:50AM -0700, Ed L. wrote: > On Thursday January 13 2005 10:09, Michael Fuhr wrote: > > > > For idle transactions pg_stat_activity shows " in transaction" > > and the query_start column shows when the transaction became idle > > T

Re: [GENERAL] vacuum vs open transactions

2005-01-13 Thread Michael Fuhr
ime. Since pg_locks has a pid column, you can join (visually or via a join query) with pg_stat_activity's procpid column. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choo

Re: [GENERAL] Functions returning RECORD

2005-01-13 Thread Michael Fuhr
th a column definition list. But you won't need a column definition list if you return a known type instead of RECORD. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an

Re: [GENERAL] OID Usage

2005-01-14 Thread Michael Fuhr
_serial_sequence('bar', 'barid'); pg_get_serial_sequence public.foo_fooid_seq (1 row) INSERT INTO bar VALUES (DEFAULT); SELECT currval(pg_get_serial_sequence('bar', 'barid')); currval - 1 (1 row) -- Michael Fuhr http://www.fuhr.org/~mfuhr

Re: [GENERAL] OID Usage

2005-01-14 Thread Michael Fuhr
On Fri, Jan 14, 2005 at 11:47:25AM +0100, Bo Lorentsen wrote: > Michael Fuhr wrote: > > >PostgreSQL 8.0 will have a pg_get_serial_sequence() function that > >returns the sequence name for a particular column so you don't have > >to construct it. This is useful wh

Re: [GENERAL] OID Usage

2005-01-14 Thread Michael Fuhr
e must be specified or the default_with_oids configuration parameter must be enabled. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] OID Usage

2005-01-14 Thread Michael Fuhr
s. > > Are they all well documentet, or need I some guessing ? See the "System Catalogs" chapter in the documentation. If you run "psql -E" you'll see the queries that psql executes for commands like "\d foo". Those commands query the system catalogs

Re: [GENERAL] postmaster listening on specified addresses

2005-01-14 Thread Michael Fuhr
on variable with listen_addresses, and postmaster's -h option will be equivalent to listen_addresses. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.pos

Re: [GENERAL] serial increments on failed insert

2005-01-14 Thread Michael Fuhr
ed back, either. Sequences are for obtaining numbers guaranteed to be unique; other assumptions about their behavior are probably unwarranted. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] OID Usage

2005-01-14 Thread Michael Fuhr
JOIN pg_attribute AS a ON a.attrelid = c.oid AND a.attnum = i.indkey[0] JOIN pg_depend AS d ON d.refobjid = c.oid AND d.refobjsubid = i.indkey[0] JOIN pg_class AS c2 ON c2.oid = d.objid AND c2.relkind = 'S' JOIN pg_namespace AS n2 ON n2.oid = c2.relnamespace; -- Michael

Re: [GENERAL] OID Usage

2005-01-15 Thread Michael Fuhr
ropped IS FALSE" to the join with pg_attribute, but I don't see how that would affect this case. Can you spot where the mistake is? What does "\d tablename" show for the table in question? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadca

Re: [GENERAL] is there anyway to get the backends IP address from the PID?

2005-01-15 Thread Michael Fuhr
127.0.0.1 | 26492 | test | 78566 | 100 | mfuhr | | 2005-01-15 08:23:14.276227-07 (4 rows) -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [GENERAL] OID Usage

2005-01-15 Thread Michael Fuhr
On Sat, Jan 15, 2005 at 05:53:08PM +0100, Bo Lorentsen wrote: > Michael Fuhr wrote: > > >The view assumes single-column primary keys defined as SERIAL types. > > > is this the "c2.relkind = 'S'" in the view ? That restricts the view to show only

Re: [GENERAL] Index optimization ?

2005-01-15 Thread Michael Fuhr
quot;Extending SQL" chapter of the documentation and search the list archives for past discussion of currval()'s volatility. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [GENERAL] Index optimization ?

2005-01-15 Thread Michael Fuhr
On Sat, Jan 15, 2005 at 11:28:08PM +0100, Bo Lorentsen wrote: > Michael Fuhr wrote: > > >currval() is volatile. See "Function Volatility Categories" in the > >"Extending SQL" chapter of the documentation and search the list > >archives for past discus

Re: [GENERAL] PQexecParams and CURSOR

2005-01-15 Thread Michael Fuhr
x27;s wrong: you're supplying parameters that the SQL statement isn't looking for. Change the nParams value from 1 to 0 and pass NULL instead of paramValues, or use PQexec() instead of PQexecParams() since you're not passing any parameters. If you still have troubl

Re: [GENERAL] Is it possible to measure IO costs of a query in postgreSQL?

2005-01-15 Thread Michael Fuhr
ng Database Activity" chapter? The statistics views won't show statistics for a particular query, but if the database is quiescent except for your activity then you might be able to measure queries' I/O costs by observing changes in the gathered statistics. -- Michael Fuhr http://w

<    3   4   5   6   7   8   9   10   11   12   >