Re: [SQL] Rules: passing new/old to functions

2003-06-26 Thread Tom Lane
le this could probably be fixed with some effort, I doubt it's going to happen soon. Is there any chance of doing what you want with a trigger instead of a rule? regards, tom lane ---(end of broadcast)--- TIP 2

Re: [SQL] Question on OUTER JOINS.

2003-06-27 Thread Tom Lane
result). > Is there a way to rewrite the query as a view such > that one can do: I'm really not clear on what you want here. Better example please? regards, tom lane ---(end of broadcast)--- TIP 3: if po

Re: [SQL] Question on OUTER JOINS.

2003-06-28 Thread Tom Lane
e I don't see why you're bothering. If the sub-SELECT can be flattened, the planner will generally do it for you. I'd expect the first form of the query to give the same plan (in pre-7.4 releases, maybe even a better plan) as the second. Perhaps you're showing us an oversim

Re: [SQL] Seqno. is not btree?

2003-06-30 Thread Tom Lane
formation that's stored in the first page of a btree index wasn't right. How exactly did you "shut down the server"? Have you noticed any other evidence of disk problems, outside Postgres? regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] ERROR: ExecEvalExpr: unknown expression type 108

2003-06-30 Thread Tom Lane
> daten) d2) as foo using (number); > ERROR: ExecEvalExpr: unknown expression type 108 7.3 has a problem with subselects referenced as join outputs. There is a fix in 7.3.1, and a better fix in place for 7.4. regards, tom lane ---(end of broa

Re: [SQL] ERROR: ExecEvalExpr: unknown expression type 108

2003-06-30 Thread Tom Lane
12/msg00375.php regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] CREATE SEQUENCE fails in plpgsql function

2003-07-01 Thread Tom Lane
SEQUENCE command in CVS tip, though I'm not sure I trust it in concurrent-usage scenarios :-( regards, tom lane ---(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: [SQL] Failed to initialize lc_messages to ''

2003-07-01 Thread Tom Lane
ry it again with a combination like export LANG=cs_CZ export LC_MESSAGES=C regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] mergejoin error message executing in 7.2

2003-07-01 Thread Tom Lane
;t work in 7.2.*. The fix is not practical to back-port, so you're stuck: either modify the query to avoid that, or update the machine with the older server. regards, tom lane ---(end of broadcast)--- TIP 3: if posting/

Re: [SQL] LEAST and GREATEST functions?

2003-07-01 Thread Tom Lane
s with different types. But COALESCE is a special feature hard-wired into the parser. There's no free lunch --- you pay for your extensibility somewhere. regards, tom lane ---(end of broadcast)--- TIP 7: don't

Re: [SQL] LEAST and GREATEST functions?

2003-07-01 Thread Tom Lane
lities like polymorphism and inlining than on creating one-use facilities like built-in LEAST/GREATEST. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] INSERT ... SELECT problem in Mysql

2003-07-04 Thread Tom Lane
lecting from the same table you're inserting into were flat-out forbidden, as the MySQL docs claim. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] summing tables

2003-07-15 Thread Tom Lane
re seq = table_name.seq-1) where c is null; because inside the sub-SELECT, unadorned "seq" will refer to the SELECT's table. You didn't say exactly what you wanted to do with null inputs, so that issue may need more thought. regards, tom lane -

Re: [SQL] Non-Blocking Locks (i.e. Oracle NOWAIT)

2003-07-15 Thread Tom Lane
in use. You might be able to use the contrib/userlock module for this. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Cannot insert dup id in pk

2003-07-15 Thread Tom Lane
SELECT setval('public.fdata _fid_seq', max(fid)+1) FROM fdata; regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] summing tables

2003-07-15 Thread Tom Lane
tting that this all runs under MVCC rules. The sub-SELECTs will see the pre-existing versions of the rows, whether or not the UPDATE has yet produced new versions. regards, tom lane ---(end of broadcast)--- TIP 5: Have

Re: [SQL] Functional Indexes

2003-07-15 Thread Tom Lane
- Index Scan using t1i on t1 (cost=0.00..17.08 rows=5 width=32) Index Cond: ((lower(f1) >= 'com.'::text) AND (lower(f1) < 'com/'::text)) Filter: (lower(f1) ~~ 'com.%'::text) (3 rows) regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] pg_dump "feature"

2003-07-16 Thread Tom Lane
intentional change. If you want to keep your password in a file, see the ~/.pgpass feature. regards, tom lane ---(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: [SQL] OR vs UNION

2003-07-17 Thread Tom Lane
rking ;-)). regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Why do the two queries below return different results?

2003-07-19 Thread Tom Lane
tand why. I'll bet there are some NULL values for secondpid in casecombo. The behavior of NOT IN with NULLs is fairly unintuitive :-( regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our l

Re: [SQL] column doesn't get calculated - updated

2003-07-19 Thread Tom Lane
It's hard to tell whether you are dealing with a bug or pilot error ... regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] min() and NaN

2003-07-19 Thread Tom Lane
loat8larger probably should behave likewise. (That actually is the same as what you want for MIN(), but not for MAX() ...) Comments anyone? regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usene

Re: [SQL] min() and NaN

2003-07-21 Thread Tom Lane
Jean-Luc Lachance <[EMAIL PROTECTED]> writes: > If a compare with NaN is always false, how about rewriting it as: > result = ((arg1 < arg2) ? arg2 : arg1). That just changes the failure mode. regards, tom lane ---(e

Re: [SQL] min() and NaN

2003-07-21 Thread Tom Lane
tency with the comparison operators. That was not the behavior Michael wanted, but I don't see that we have much choice given the wording of the SQL spec. Does anyone want to argue against that definition? regards, tom lane -

Re: [SQL] min() and NaN

2003-07-22 Thread Tom Lane
ortant, but I don't think it's important enough to disregard the spec... regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] rule causes nextval() to be invoked twice

2003-07-22 Thread Tom Lane
the possibility that they're not the last BEFORE trigger.) regards, tom lane ---(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 to the mailing list cleanly

Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Tom Lane
#x27;re pretty much out of luck in that particular language. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] obtuse plpgsql function needs

2003-07-23 Thread Tom Lane
ou got was a tuple ... Something to work on for 7.5, I suppose. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] min() and NaN

2003-07-24 Thread Tom Lane
27;s always going to be dependent on the platform having proper IEEE support, but that's no excuse to throw it away. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Problem using Subselect results

2003-07-25 Thread Tom Lane
ng onek_unique1 on onek (cost=0.00..21.40 rows=5 width=8) Index Cond: (onek.unique1 = "outer".unique1) (5 rows) regression=# Looks like a fairly decent plan to me. It's certainly not letting the sub-select structure get in its way. r

Re: [SQL] [GENERAL] Query analyse

2003-07-25 Thread Tom Lane
n and > see if that changes the plan you get. It might help --- you might possibly get a nestloop-with-inner-indexscan out of that. Not sure though, since the planner is likely to be using bad guesstimates about the selectivity of the expression. 7.4 should do better on this.

Re: [SQL] [GENERAL] Function index qeustion

2003-07-25 Thread Tom Lane
r. That's what the iscachable flag means: you are promising that the function's output for given input never changes. If you aren't prepared to make that promise, you cannot index the function. regards, tom lane --

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-26 Thread Tom Lane
ault localtimestamp default 'now'::text Given that you want timestamp without time zone, I'd probably use "default localtimestamp". regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-27 Thread Tom Lane
Denis Zaitsev <[EMAIL PROTECTED]> writes: > On Sat, Jul 26, 2003 at 10:31:44AM -0400, Tom Lane wrote: >> That's a dangerous way to define the default --- 'now' is taken as a >> literal of type timestamp, which means it will be reduced to a timestamp >> con

Re: [SQL] Can a table have a reference to itself?

2003-07-27 Thread Tom Lane
ferential integrity violation - key referenced from foo > not found in foo Seems to work in 7.3.4 and CVS tip: regression=# update foo set a = 5 where a = 2; UPDATE 1 regression=# select * from foo; a | b ---+--- 1 | 1 3 | 5 5 | 5 (3 rows) regards, tom lane --

Re: [SQL] Using a compound primary key

2003-07-27 Thread Tom Lane
arches for indexes matching OR-clauses.) You may also need to phrase the ORDER BY as "prefix desc, tariff_type desc" to make it perfectly clear to the planner that you don't need a separate sort step ... not quite sure whether that will be needed or not. regard

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-28 Thread Tom Lane
datetime input parser. (It would be rather difficult for an application to allow this one case without permitting SQL-injection attacks, I'd think.) regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-28 Thread Tom Lane
alue strings and not function invocations. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Problem using Subselect results

2003-07-29 Thread Tom Lane
on > before one.updatenr. - And that's where I run into trouble. You might be able to make this work by using SELECT DISTINCT ON. See the "weather reports" example in the SELECT reference page. regards, tom lane ---(end of broad

Re: [SQL] Nonexistent NEW relation in some places of rules

2003-07-29 Thread Tom Lane
we ever add support for SQL99's LATERAL(), it might help improve matters. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Very strange 'now' behaviour in nested triggers.

2003-07-30 Thread Tom Lane
very ugly implementation though, mainly because it doesn't reverse-list nicely in rule dumps. Sometime we should try to fix it so that it reverse-lists as "current_timestamp(n)", and likewise for the similar special cases in gram.y. regards, tom lan

Re: [SQL] now 7.2.3 - 7.3.3

2003-07-30 Thread Tom Lane
"A. Van Hook" <[EMAIL PROTECTED]> writes: > this worked in 7.2.3 > "select sum(cr) from ar where date(tdate) = now() -1 " > but not in 7.3.3 > What's the proper syntax for 7.3.3??? Perhaps you want current_date - 1. regards, t

Re: [SQL] join optimization problem

2003-07-31 Thread Tom Lane
Toby Tremayne <[EMAIL PROTECTED]> writes: > the explain data I'm currently getting is this: "explain analyze" would be much more useful. Also, I assume you've vacuum analyzed these tables recently? regards, tom lane ---

Re: [SQL] backend cpu usage? [7.2]

2003-08-01 Thread Tom Lane
nd pid I can fork a 'ps' command from my app, > though it would be nicer to get it directly through sql. There's a pg_backend_pid() function in 7.3 that returns your own PID. Not sure if it was in 7.2. regards, tom lane ---(end of br

Re: [SQL] join optimization problem

2003-08-03 Thread Tom Lane
EFT would really help any, but it couldn't hurt, since LEFT restricts the planner's choices.) regards, tom lane ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscri

Re: [SQL] [PERFORM] EXTERNAL storage and substring on long strings

2003-08-04 Thread Tom Lane
there's a bug we need to fix. I'd really like to see some profiling of the poor-performing external-storage case, so we can figure out what's going on. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] string function -- replace needs a clear doc

2003-08-12 Thread Tom Lane
In 7.3.3 release notes: * Fix misbehavior of replace() on strings containing '%' regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Using rowtype as function argument

2003-08-14 Thread Tom Lane
e: SELECT myfunc(mytablename) FROM mytablename; regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] (no subject)

2003-08-14 Thread Tom Lane
e other tool that is misreading or altering the dump file. Personally, I would use pg_dump without -D. Recent versions give a fairly nice behavior for embedded control characters: COPY foo (f1) FROM stdin; aaa\rbbb\r\nccc aaa\rbbb\r\nccc \. regards, tom lane --

Re: [SQL] PostgreSQL and Journaled File Systems

2003-08-14 Thread Tom Lane
undant --- turn that off if you can. (Of course, if there is anything other than Postgres files on the same device, you may not want to turn off contents journalling...) regards, tom lane ---(end of broadcast)--- TIP 2: you c

Re: [SQL] Error message with a SQL function

2003-08-14 Thread Tom Lane
I don't believe there was a type "void" in PG 7.1. IIRC, back then the custom was to say "RETURNS opaque" in this situation. It's probably time for you to update to something newer ... regards, tom lane ---(end

Re: [SQL] Timezone troubles

2003-08-14 Thread Tom Lane
matters. Per bug #897. regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Query suddenly taking longer....

2003-08-14 Thread Tom Lane
(*) as numberingroup from xrefmembergroup group by membergroupid) as c where m.id = c.membergroupid; I'm not convinced this will actually be much of a win in 7.3 unfortunately ... but it should fly in 7.4, because of the new hash aggregation code. regar

Re: [SQL] Comparing arrays

2003-08-14 Thread Tom Lane
hard way to go about this. A better short-run solution is just to create = and < operators for varchar[]. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] User-defined SQL function has slower query on 7.3.3 than 7.1.3

2003-08-14 Thread Tom Lane
pared > (and saved) SPI query, which uses an index: > "select latitude, longitude from geo_zipdata where zip = $1" How do you know it's using the index? regards, tom lane ---(end of broadcast)--- TIP 9:

Re: [SQL] Timestamp in PG - 7.1 & 7.2

2003-08-14 Thread Tom Lane
datetime(n) --- you will have to do that when you update to 7.3 anyway, and it gets the right answer on 7.2. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] sequence

2003-08-15 Thread Tom Lane
But really you do not need a subquery for this at all; VALUES is perfectly content with scalar expressions: insert into table_name (field_name) values (setval('sequence_name')-1); regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] About primary keys.

2003-08-15 Thread Tom Lane
rimary key --- the normal Postgres limit is 32 keys but I can't believe anyone would use that many in practice). regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://

Re: [SQL] About primary keys -- made some progress

2003-08-16 Thread Tom Lane
er than poking around in the catalogs directly. regards, tom lane ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] Expression transformation curiosity

2003-08-17 Thread Tom Lane
You could see how testing "a" twice could be > expensive in some situations. It's actually done that way --- see the comments near the head of src/backend/optimizer/prep/prepqual.c. There are some heuristics to not do it if the expression expands "a lot&

Re: [SQL] postgres 7.1.3: why does the query plan ignore indexes?

2003-08-19 Thread Tom Lane
or you can put it in quotes and let the parser figure out the right type: product_id = '29' Yes, we'd like to make this better, but there are surprisingly many pitfalls in tinkering with the assignment of datatypes to constants... regards, tom lane PS: you could

Re: [SQL] Before/After Trigger User Switching

2003-08-20 Thread Tom Lane
ation of AFTER triggers, but given the current timing this is the behavior I'd expect. regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] "SELECT IN" Still Broken in 7.4b

2003-08-20 Thread Tom Lane
you getting (seq scan or multiple index scan)? Is it possible that the cost comes from planner overhead and not execution? Checking EXPLAIN ANALYZE reported time against actual elapsed time (cf psql's \timing option) would tell. regards, tom lane --

Re: [SQL] Before/After Trigger User Switching

2003-08-20 Thread Tom Lane
7;d say. Which suggests a workaround for the moment: your trigger function should be a SECURITY DEFINER. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] "SELECT IN" Still Broken in 7.4b

2003-08-22 Thread Tom Lane
Bertrand Petit <[EMAIL PROTECTED]> writes: > On Wed, Aug 20, 2003 at 04:32:19PM -0400, Tom Lane wrote: >> against actual elapsed time (cf psql's \timing option) would tell. > What is measured by the \timing option? Elapsed time ... as seen by the client, of course.

Re: [SQL] date calculation

2003-08-22 Thread Tom Lane
27;::timestamp with time zone + your_ticks * '1 second'::interval; regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Delete denied?

2003-08-22 Thread Tom Lane
of > the table (and the function). I seem to recall that the original coding of the RI triggers was careless about executing the RI operations as the "right" user (namely the table owner). This very possibly was still broken in 7.2.4. regards, tom lane --

Re: [SQL] "SELECT IN" Still Broken in 7.4b

2003-08-24 Thread Tom Lane
the status of this bug is? Try it in CVS tip ... regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] Strange behavior with timestamptz

2003-08-26 Thread Tom Lane
o there's no credible mechanism for now() to make such a mistake. I think that your client software supplied a value for one field and didn't supply a value for the other, and the supplied value was provided in the wrong DateStyle. regards, tom lane

Re: [SQL] postgres 7.1.3: why does the query plan ignore indexes?

2003-08-26 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Should we consider adding some warning when someone creates an index on > an int2 column? I don't think so. Better to expend our energy on solving the fundamental problem. regards, tom lane -

Re: [SQL] Strange behavior with timestamptz

2003-08-26 Thread Tom Lane
e datestyle to Euro to get dd-mm- input to be parsed reliably. As of 7.4 this is being tightened up, btw --- it'll be mm-dd- or error. But AFAICS this has nothing to do with a default now() insertion, because that value is never converted to a string before it g

Re: [SQL] postgres 7.1.3: why does the query plan ignore indexes?

2003-08-27 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Bruce Momjian <[EMAIL PROTECTED]> writes: >>> Should we consider adding some warning when someone creates an index on >>> an int2 column? >> >> I don't think so. Better to expen

Re: [SQL] lock row in table

2003-08-28 Thread Tom Lane
inform other user that the record is edited? Try using the contrib/userlock/ functions. regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] BEFORE UPDATE Triggers

2003-08-30 Thread Tom Lane
changes the column? You won't find that out unless you actually compare the OLD and NEW column values. If you assume the column has not changed just because the original query text didn't change it, you are in for a world of hurt. regards, tom lane

Re: [SQL] Unnamed Cursor return

2003-09-02 Thread Tom Lane
te a named cursor by binding the cursor in DECLARE.) > (2) How to fetch the content of the unnamed cursor at PgAdmin and at Comman= > d prompt? You probably need a BEGIN block in the psql case. Can't help you with pgadmin. regards, tom lane -

Re: [SQL] [ADMIN] Why table has drop, but the foreign key still there?

2003-08-14 Thread Tom Lane
ning? regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] SQL subqueries newbie help

2003-09-07 Thread Tom Lane
but I believe could be created SELECT DISTINCT ON might provide a simpler solution to that requirement. Check out the "weather reports" example in the SELECT reference page. regards, tom lane ---(end of broadcast)-

Re: [SQL] undefine currval()

2003-09-08 Thread Tom Lane
e, and can't > find an obvious solution. The state involved is in a linked list kept by commands/sequence.c. Such a command would not be difficult to implement, if you could get agreement on the syntax to use. regards, tom lane ---(end of broad

Re: [SQL] undefine currval()

2003-09-08 Thread Tom Lane
uld connection poolers actually find it useful? (I'd think it much more likely they want to re-use prepared statements.) regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

[SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Tom Lane
cases where they'd be accepted in a boolean-requiring SQL construct (such as CASE). (By default, none are, so this isn't really different from #2. But people could create casts to boolean to override this behavior in a controlled fashion.) Any opinions about what to do

Re: [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: > On Mon, 08 Sep 2003 11:40:32 -0400, Tom Lane <[EMAIL PROTECTED]> > wrote: >> 4. Use the parser's coerce_to_boolean procedure, so that nonbooleans >> will be accepted in exactly the same cases where they'd b

Re: [SQL] [HACKERS] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Tom Lane
erent from #2. But people could >> create casts to boolean to override this behavior in a controlled >> fashion.) At this point I'm kinda leaning to #4, because (for example) people could create a cast from integer to boolean to avoid having to fix th

Re: [SQL] plPGSQL bug in function creation

2003-09-08 Thread Tom Lane
VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; If there's a bug here at all, it's that this function doesn't report a type violation. What in the world do you think the semantics of that IF-test are? text is not boolean. regards, tom lane --

Re: [SQL] How do I replace select ... into commands?

2003-09-11 Thread Tom Lane
sed by plpgsql at all, merely sent down to the SQL engine, which does not know the output variable mx). The way to get results out of an executed select is to use FOR ... IN EXECUTE. Which is a kluge, but it holds the fort until someone gets around to redesigning this code. See the manual.

Re: [SQL] how to call a function with row-type arg

2003-09-12 Thread Tom Lane
k the second makes it more clear what's going on. BTW, if you use a table alias then the alias is the name to refer to. SELECT foo(x.*) FROM tablename as x; regards, tom lane ---(end of broadcast)--- TIP 5: Hav

Re: [SQL] createlang problme

2003-09-13 Thread Tom Lane
7.3.3 has a nasty bug that can cause it to fail to restart after a crash. regards, tom lane ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Use derived expression in select statement

2003-09-13 Thread Tom Lane
rom (select *, (cy_bfwd + dy_p1T4) as curr_bal from fclitot) as ss where dy_yr = 0 and (curr_bal) <-0.005 This doesn't necessarily save you from evaluating the curr_bal expression twice, mind you. It just saves you from writing it out twice. regards, tom lane ---

Re: [SQL] A generic trigger?

2003-09-14 Thread Tom Lane
oks like it will apply to 7.3 branch with some fuzz, but I have not actually tested it there). regards, tom lane *** src/pl/plpython/plpython.c.orig Mon Aug 4 14:40:50 2003 --- src/pl/plpython/plpython.c Sun Sep 14 13:07:02 2003 *** *** 224,236

Re: [SQL] SET database TO ...?

2003-09-15 Thread Tom Lane
imilar to "SET search_path TO whatever;"). If the script is being fed to psql, it can use \c ... regards, tom lane ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] Sort order with spaces?

2003-09-17 Thread Tom Lane
g_controldata, "strings $PGDATA/global/pg_control" will do as a rough-and-ready substitute.) Theoretically it should work to do export LC_COLLATE=C export LC_CTYPE=C initdb but if you have LANG or other LC_xxx values in your environment, it's possible that there is

Re: [SQL] cursors in plpgsql

2003-09-17 Thread Tom Lane
Y to the cursor's query. (You will need to do some investigation with EXPLAIN to make sure you are getting a suitable plan for the cursor.) Or try 7.4 beta ... regards, tom lane ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] [BUGS] session variable

2003-09-17 Thread Tom Lane
for finite set of expected variables, not for arbitrary values. How do you figure that? AFAICS "FOR" with a record variable as target will cover any case that SELECT INTO could handle. regards, tom lane ---(end of broadcast)-

Re: [SQL] Backup of multiple tables

2003-09-19 Thread Tom Lane
out success. pg_dump can only handle one -t option at a time. It'd make sense to allow multiple -t options (likewise -n) but no one's got round to improving the code in that particular direction. I don't think it would be hard; want to fix it and send in a patc

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Tom Lane
alue. Why don't you just declare the column as timestamp(2) ? All this fooling around with substrings is inefficient and doesn't have much to do with your real intent anyhow. regards, tom lane ---(end of broadcast)

Re: [SQL] Problem with timestamp - Pls help

2003-09-19 Thread Tom Lane
ostgresql.org/docs/7.3/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT regards, tom lane ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

Re: [SQL] [ADMIN] Error with functions

2003-09-20 Thread Tom Lane
add_one - 11 (1 row) Perhaps you should show us exactly what you did. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Re: [SQL] pl/pgsql, cursors and C function

2003-09-23 Thread Tom Lane
bug in your code is that your C function needs to call SPI_connect and SPI_finish if it's going to use any SPI operations. regards, tom lane Index: spi.c === RCS file: /cvsroot/pgsql-server/src/backend

Re: [SQL] pl/pgsql, cursors and C function

2003-09-23 Thread Tom Lane
en a builtin function and a dynamically loaded one is you have to add the PG_FUNCTION_INFO macro. regards, tom lane ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Case Insensitive comparison

2003-09-24 Thread Tom Lane
ple create function nullif(anyelement, anyelement) returns anyelement as 'select case when $1 = $2 then null else $1 end' language sql; I'm not sure we're all the way there yet, cf http://archives.postgresql.org/pgsql-general/2003-09/msg00500.php

Re: [SQL] tsearch2 question

2003-09-25 Thread Tom Lane
don't think $libdir is the real value that we want. Yes it is. regards, tom lane ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

<    5   6   7   8   9   10   11   12   13   14   >