Re: [SQL] Query Join Performance

2007-04-25 Thread Tom Lane
in the top-level row estimate; but this one is a simple scalar condition and I'd expect our stats code to be able to deal with it. Are the stats on zip up-to-date? Maybe you need to increase the stats target for it. regards, tom lane ---(end

Re: [SQL] Add constraint for number of chars

2007-04-25 Thread Tom Lane
PostgreSQL Admin [EMAIL PROTECTED] writes: username | varchar(100)| constraint username =8 and username =100 Perhaps you mean length(username) = 8 and so on? regards, tom lane ---(end of broadcast)--- TIP 4: Have you

Re: [SQL] Split String Into Multiple Records

2007-04-21 Thread Tom Lane
that with a SQL-language wrapper function. It's pretty grotty on the whole, but should do for a one-time problem. BTW, check the archives, because I think this type of problem has been discussed before --- somebody may have already posted usable code. regards, tom lane

Re: [SQL] Question about undefinably query...

2007-04-10 Thread Tom Lane
the number of result rows is the least common multiple of the period lengths. This is one of the reasons that SRF-in-targetlist is deprecated ... regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your

Re: [SQL] [ADMIN] Question on pgpsql function

2007-04-08 Thread Tom Lane
want substring() not substr(). regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] dropping a schema and cross-schema dependencies

2007-04-06 Thread Tom Lane
message. regards, tom lane ---(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: [SQL] slow query

2007-04-05 Thread Tom Lane
A. Kretschmer [EMAIL PROTECTED] writes: am Thu, dem 05.04.2007, um 1:27:25 -0400 mailte Tom Lane folgendes: I'm betting the problem is poor vacuuming practice leading to lots of dead space. There's no way it takes 22 sec to read 10 rows if the table is reasonably dense. This was my first

Re: [SQL] LOG: unexpected EOF on client connection

2007-04-05 Thread Tom Lane
[EMAIL PROTECTED] writes: FATAL: sorry, too many clients already You need a larger max_connections setting. LOG: unexpected EOF on client connection I think pgbench just dies ungracefully if it gets a connection failure. regards, tom lane

Re: [SQL] Very slow DELETE on 4000 rows of 55000 row table

2007-04-04 Thread Tom Lane
operation which happens every few months, if that. true, but without an index, it still has to scan the table just to be sure. If this is only a once-in-awhile thing, maybe you could build the index, do the deletes, drop the index ... regards, tom lane

Re: [SQL] slow query

2007-04-04 Thread Tom Lane
: 22204.476 ms (3 rows) which version? I'm betting the problem is poor vacuuming practice leading to lots of dead space. There's no way it takes 22 sec to read 10 rows if the table is reasonably dense. regards, tom lane ---(end of broadcast

Re: [SQL] exception handling in postgres plpgsql

2007-04-03 Thread Tom Lane
gather that you are reading 8.2 documentation and trying to apply the info to some previous version that doesn't have SELECT INTO STRICT (which you failed to use anyway...) You probably want to test the magic FOUND variable instead --- see the plpgsql docs. regards, tom

Re: [SQL] Calling void functions

2007-04-02 Thread Tom Lane
in check_sql_fn_retval. I think that logic was designed before we had an idea of VOID-returning functions. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org

Re: [SQL] using sql on v7.4 server to feed stored procedure

2007-03-30 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [SQL] Rules with sequence columns

2007-03-28 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing

Re: [SQL] array_to_string

2007-03-27 Thread Tom Lane
Sabin Coanda [EMAIL PROTECTED] writes: I used the function array_to_string, and I found it ignores NULL values, e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. Do you have a better idea? regards, tom lane ---(end of broadcast

Re: [SQL] array_to_string

2007-03-27 Thread Tom Lane
Richard Huxton dev@archonet.com writes: Tom Lane wrote: Sabin Coanda [EMAIL PROTECTED] writes: I used the function array_to_string, and I found it ignores NULL values, e.g. array_to_string( 'ARRAY[1,NULL,3]', ',' ) returns '1,3'. Do you have a better idea? If you're being strict

Re: [SQL] select vs. select count

2007-03-27 Thread Tom Lane
the EXCEPT wasn't eliminating any rows. You need to wrap SELECT count(order_id) FROM ( ... ) around the entire EXCEPT query to get what you want. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

[SQL] Anyone still using the sql_inheritance parameter?

2007-03-21 Thread Tom Lane
, only changeable by superusers. This would still allow the setting to be turned off for use by legacy applications (probably by means of ALTER USER) while removing the objection that non-privileged users could break things. regards, tom lane ---(end

Re: [ADMIN] [SQL] create view with check option

2007-03-19 Thread Tom Lane
hubert depesz lubaczewski [EMAIL PROTECTED] writes: On 3/19/07, Tom Lane [EMAIL PROTECTED] wrote: ERROR: WITH CHECK OPTION is not implemented It seems perfectly clear to me ... errors is clear, but maybe the information about check option should be removed from docs to 8.2

Re: [SQL] create view with check option

2007-03-18 Thread Tom Lane
Karthikeyan Sundaram [EMAIL PROTECTED] writes: I am getting an error message: ERROR: WITH CHECK OPTION is not implemented what does this mean? It seems perfectly clear to me ... regards, tom lane ---(end of broadcast

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Tom Lane
the weather reports example in the SELECT reference page). Unfortunately that's a Postgres-only construct. If you want something portable then you'll need something messy with subqueries... regards, tom lane ---(end of broadcast

Re: [SQL] Grabbing Newest Records From Duplicates

2007-03-16 Thread Tom Lane
not --- for full-table scans it's often faster to sort than to try to use an index. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] log file permissions?

2007-03-16 Thread Tom Lane
superuser, course)? You'd have to change the code --- the syslogger process inherits umask 077 from the postmaster. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] postgres configuration

2007-03-13 Thread Tom Lane
of ram and 8 processors. What postgres version? 8.2 should be considerably faster than prior releases due to Heikki's fixes to let indexes be scanned in physical order during VACUUM. regards, tom lane ---(end of broadcast

Re: [SQL] A form of inheritance with PostgreSQL

2007-03-12 Thread Tom Lane
for production ... if some PHB is trying to force that on you, I suggest resigning from the project before you get blamed for the inevitable disaster. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet

Re: [SQL] A form of inheritance with PostgreSQL

2007-03-12 Thread Tom Lane
undertake new development on a server version older than 8.1.x. regards, tom lane ---(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

Re: [SQL] Selecting exactly one row for each column value

2007-03-06 Thread Tom Lane
Florian Weimer [EMAIL PROTECTED] writes: For each value in the first column, I need one (and only one) matching row from the table. A possible solution is: SELECT DISTINCT ON would do it, if you don't mind a non-portable solution. regards, tom lane

Re: [SQL] [ADMIN] pg_dump error

2007-03-01 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Syntax Error in COPY when “create function”

2007-02-27 Thread Tom Lane
Osvaldo Rosario Kussama [EMAIL PROTECTED] writes: |Does this mean the filename in COPY command can not be a variable?| Got it in one. You can use EXECUTE to put together commands that require a variable in places where PG doesn't allow one. regards, tom lane

Re: [SQL] Very large IN-clause is slow, but how to rewrite it?

2007-02-25 Thread Tom Lane
of the table, you'll still have problems. In that case I'd advise putting the values into a temp table, ANALYZEing same, and doing WHERE foo IN (SELECT x FROM tmp_table). regards, tom lane ---(end of broadcast)--- TIP 7: You can help

Re: [SQL] Very large IN-clause is slow, but how to rewrite it?

2007-02-25 Thread Tom Lane
actually you don't need all that much extra notation; this seems to work: WHERE foo IN (VALUES ($1),($2),($3),...) regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ

Re: [SQL] pg_dump fails (timestamp out of range)

2007-02-22 Thread Tom Lane
: you need to identify and fix (or delete) the offending row(s). In this case you might try tests like bin_end_date_time '1 Jan ' and so on to see if you can determine exactly which rows are bad. regards, tom lane ---(end of broadcast

Re: [SQL] DISTINCT ON not working...?

2007-02-19 Thread Tom Lane
in the WHERE clause is just referring to the underlying column (and thus making the IS NULL test in the CASE rather pointless). regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] ordering of selected rows from an ordered subselect

2007-02-17 Thread Tom Lane
happens after that depends on the outer query, but if you don't have any joining or grouping then it's a reasonably safe bet that the final output will be in the same order. regards, tom lane ---(end of broadcast)--- TIP 2

Re: [SQL] for SELECT DISTINCT, ORDER BY expressions must appear in select list - is that the standart or a limitation of postgresql?

2007-02-15 Thread Tom Lane
, then: I) T shall not be a grouped table. II) QS shall not specify the set quantifier DISTINCT or directly contain one or more set function specifications. regards, tom lane

Re: [SQL] huge disparities in =/IN/BETWEEN performance

2007-02-09 Thread Tom Lane
8.2 can do it too.) regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] dynamic sql

2007-02-09 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] alias not applied

2007-02-09 Thread Tom Lane
UNION SELECT 51 AS i, true AS d ) x ORDER BY i; PK_ID | Deleted ---+- 49 | t 51 | t (2 rows) regression=# What PG version are you using, exactly? regards, tom lane ---(end of broadcast)--- TIP 4: Have

Re: [SQL] Odd PL/PgSQL Error -- relation X does not exist when using index expression

2007-02-08 Thread Tom Lane
multiple commands in the same EXECUTE string --- if we were going to do anything to fix this, I think it would be along the lines of enforcing that advice. Trying to make the world safe for it doesn't sound productive. regards, tom lane ---(end

Re: [SQL] Odd PL/PgSQL Error -- relation X does not exist when using index expression

2007-02-08 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: On Thu, Feb 08, 2007 at 10:32:25AM -0500, Tom Lane wrote: My advice is not to try to execute multiple commands in the same EXECUTE string --- if we were going to do anything to fix this, I think it would be along the lines of enforcing that advice

Re: [SQL] Open a Transaction

2007-02-08 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] huge disparities in =/IN/BETWEEN performance

2007-02-08 Thread Tom Lane
details, nor even an EXPLAIN. regards, tom lane ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [SQL] huge disparities in =/IN/BETWEEN performance

2007-02-08 Thread Tom Lane
how many rows are likely to match. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message

Re: [SQL] huge disparities in =/IN/BETWEEN performance

2007-02-08 Thread Tom Lane
. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] metaphone and nysiis in postgres

2007-02-07 Thread Tom Lane
/fuzzystrmatch (along with a few other alternatives). regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] [ADMIN] Symbol lookup error

2007-02-05 Thread Tom Lane
the situation ... regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] Nocount and scope_identity()

2007-02-02 Thread Tom Lane
field (or any other auto-generated field...) regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Insert Data and autonumeric field

2007-02-01 Thread Tom Lane
debugging purposes). I think you may have confused this with use of the lastval() function --- currval() or sometimes lastval() are the appropriate way to get the last-assigned value. regards, tom lane ---(end of broadcast

Re: [SQL] Using Temporary Tables in postgres functions

2007-01-26 Thread Tom Lane
Mario Splivalo [EMAIL PROTECTED] writes: On Thu, 2007-01-25 at 11:09 -0500, Tom Lane wrote: I believe the problem is that for a SQL function we parse the whole function body before executing any of it. So you'd need to split this into two separate functions. Having two function complicates

Re: [SQL] Using Temporary Tables in postgres functions

2007-01-25 Thread Tom Lane
this into two separate functions. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] shared_buffers and shmall,shmmax

2007-01-25 Thread Tom Lane
shmall is 65536 page And how big is a page? regards, tom lane ---(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

Re: [SQL] Changing point for commas and commas for point

2007-01-21 Thread Tom Lane
available vary across OSes ... try locale -a for a list. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Possible to emulate pre-8.2 behaviour of SET CONSTRAINTS?

2007-01-21 Thread Tom Lane
problem. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through

Re: [SQL] Removing CONTEXT message

2007-01-16 Thread Tom Lane
. MHO: if they don't have a way to adjust the verbosity of their error output, they definitely should. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating

Re: [SQL] Removing CONTEXT message

2007-01-16 Thread Tom Lane
, in pgAdmin I dunno but you're asking the wrong person... regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] update query taking 24+ hours

2007-01-14 Thread Tom Lane
into or out of the Master table? regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] quoted variables in pgsql

2007-01-04 Thread Tom Lane
chester c young [EMAIL PROTECTED] writes: cannot get those quotes around the value. Use backslashes. regression=# \set var '\'value\'' regression=# \echo :var 'value' regards, tom lane ---(end of broadcast)--- TIP 7: You

Re: [SQL] or function

2006-12-30 Thread Tom Lane
: select sum(case when i.count = 0 then s.cost else i.count * s.cost end) ... regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] help with version checking

2006-12-28 Thread Tom Lane
, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] Help with quotes in plpgsql

2006-12-19 Thread Tom Lane
interval_in which does a fairly nontrivial parsing process. The second way is basically just a multiplication, because '1 day'::interval is already a constant value of type interval. regards, tom lane ---(end of broadcast

Re: [SQL] Unions and Grouping

2006-12-15 Thread Tom Lane
- cate of R. B) Otherwise, T contains no duplicate of R. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] TPCH Benchmark query result invalid

2006-12-12 Thread Tom Lane
for interval constants is so bizarre and non-orthogonal it's not worth dealing with ... regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail

Re: [SQL] Query is fast and function is slow

2006-12-07 Thread Tom Lane
You need to make the second argument type name, too, if you have a lot of users. regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Proper way of iterating over the column names in a trigger function.

2006-12-06 Thread Tom Lane
Rajesh Kumar Mallah [EMAIL PROTECTED] writes: what is the proper way for iterating over column names of a table using SPI_* functions. You need to pay attention to the attisdropped field of the TupleDesc entries. regards, tom lane ---(end

Re: [SQL] transaction in function

2006-12-05 Thread Tom Lane
at it to *not* have that behavior. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] Question about AT TIME ZONE

2006-12-05 Thread Tom Lane
a value that's relative to the named zone. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] Can someone explain the problem with this select

2006-12-05 Thread Tom Lane
, you can contort the query to get the IN restriction inside the outer join: select * from (select * from documents where documents.doc_num in (select doc_num from documents limit 10)) ss left outer join comments on (ss.doc_num = comments.doc_num); regards, tom lane

Re: [SQL] null values in non-nullable column

2006-12-04 Thread Tom Lane
that ... regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate

Re: [SQL] null values in non-nullable column

2006-12-04 Thread Tom Lane
of the outer join, but it's not apparent that that idea is meant to negate a domain constraint. And yet, if it does not, then an outer join with a NOT NULL domain column on the nullable side is just invalid. regards, tom lane ---(end of broadcast

Re: [SQL] Query for block updates

2006-12-03 Thread Tom Lane
= null where id = r.id; end; end loop; and then do the ALTER TYPE after you've cleaned the data. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-12-02 Thread Tom Lane
of identifiers. Now certainly we are not doing exactly what the spec says, but what you ask is even less like the spec's requirements. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ

Re: [SQL] calling elog possibly causing problem in DirectFunctionCall1

2006-12-01 Thread Tom Lane
Rajesh Kumar Mallah [EMAIL PROTECTED] writes: data-time_stamp = DirectFunctionCall1(timestamptz_in, CStringGetDatum(now)); This code is incorrect, as timestamptz_in takes three arguments. regards, tom lane ---(end of broadcast

Re: [SQL] Tracking Down Error in Stored Procedure

2006-12-01 Thread Tom Lane
CREATE FUNCTION foo ... RETURNS ... AS $$DECLARE -- this is line 1 regards, tom lane ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your

Re: [SQL] pg_xlog on separate drive

2006-11-30 Thread Tom Lane
of data corruption, in that transactions made since your last checkpoint may be only partially applied. I wouldn't recommend a setup in which xlog is less redundant than your main storage array. regards, tom lane ---(end of broadcast

Re: [SQL] SQL command join question

2006-11-29 Thread Tom Lane
. Drop the alias on the outer join (the t). Per SQL spec, that masks table names (and aliases) within the join from the rest of the query. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL

Re: [SQL] select into

2006-11-24 Thread Tom Lane
Adrian Klaver [EMAIL PROTECTED] writes: On Thursday 23 November 2006 08:45 pm, Tom Lane wrote: This should work --- in PG 8.1 or later. The documentation for pl/pgsql in 8.1 and higher says different. http://www.postgresql.org/docs/8.1/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS

Re: [SQL] select into

2006-11-23 Thread Tom Lane
, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] select into

2006-11-22 Thread Tom Lane
that won't conflict. In general, don't use plpgsql variables that are named the same as any SQL tables or columns you need to mention in the function. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support

Re: [SQL] planner used functional index in 7.3.6, now does a seq

2006-11-19 Thread Tom Lane
of estimating this query well because they don't keep any statistics about the contents of functional indexes. 8.0 and up do, so they'd probably do a lot better with this. If I were you I'd be trying to migrate to 8.1.5, not anything older. regards, tom lane

Re: [SQL] transactional shared variable in postgresql

2006-11-18 Thread Tom Lane
/8.1/static/runtime-config-custom.html regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

Re: [SQL] planner used functional index in 7.3.6, now does a seq scan in 7.4.7 after upgrade

2006-11-18 Thread Tom Lane
takes two arguments? regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get

Re: [SQL] Constraint on multicolumn index

2006-11-10 Thread Tom Lane
://archives.postgresql.org/pgsql-performance/2004-07/msg00188.php (note that none of the first few responses got the point :-() Also http://archives.postgresql.org/pgsql-hackers/2006-02/msg00209.php regards, tom lane ---(end of broadcast)--- TIP 5

Re: [SQL] Composite Types

2006-11-06 Thread Tom Lane
Jose [EMAIL PROTECTED] writes: If I try use select unidade_regiao.(estado_sigla) from unidades No, you should do select (unidade_regiao).estado_sigla from unidades regards, tom lane ---(end of broadcast)--- TIP 7: You

Re: [SQL] Nested select

2006-11-06 Thread Tom Lane
to get. Works perfectly is content-free. regards, tom lane ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] delete and select with IN clause issues

2006-11-03 Thread Tom Lane
to make of it. If it happens again, we need to look more closely. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-02 Thread Tom Lane
to be frozen no later than initdb time, for exactly the same reasons we freeze locale then (hint: index ordering). regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http

Re: [SQL] The empty list?

2006-11-02 Thread Tom Lane
there, there is no way to impute a rowtype to the table. regards, tom lane ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
? regards, tom lane ---(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: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
Jeff Frost [EMAIL PROTECTED] writes: On Thu, 2 Nov 2006, Tom Lane wrote: This seems pretty darn weird. I am wondering about corrupt indexes --- can you find the indicated key in either table if you set enable_indexscan and enable_bitmapscan to 0? test_tracking=# begin; BEGIN test_tracking

Re: [SQL] The empty list?

2006-11-02 Thread Tom Lane
on tenk1_unique1 (cost=0.00..36.38 rows=489 width=0) (actual time=0.027..0.027 rows=0 loops=1) Index Cond: (unique1 = ANY ($1)) Total runtime: 0.478 ms (5 rows) This is not SQL-standard syntax IIRC, but then foo IN () would certainly not be either. regards, tom lane

Re: [SQL] delete and select with IN clause issues

2006-11-02 Thread Tom Lane
. If you want to be 100% certain, shut down the postmaster while copying, but unless the index file is pretty large I think that's not necessary. regards, tom lane ---(end of broadcast)--- TIP 7: You can help support

Re: [SQL] The empty list?

2006-11-02 Thread Tom Lane
Jesper Krogh [EMAIL PROTECTED] writes: Tom Lane wrote: FWIW, as of 8.2 the best option will probably be to use col = ANY (array), which does support zero-length arrays if you use either an out-of-line parameter or an array literal. That looks nice.. is ANY in the SQL-spec? ANY is, but I

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-10-31 Thread Tom Lane
. That can't be acceptable --- it's going to break any application that does any nontrivial analysis of what it sees there, not to mention that it violates various primary key constraints in the information schema specification. regards, tom lane ---(end

Re: [SQL] Case Preservation disregarding case sensitivity?

2006-10-30 Thread Tom Lane
of breaking other people's applications. Perhaps you should consider fixing your app instead. regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [HACKERS] [SQL] Case Preservation disregarding case sensitivity?

2006-10-30 Thread Tom Lane
column you mean error. I am interested to see where you find support for that in the spec... regards, tom lane ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index

Re: [SQL] conversion of numeric field from MSSQL to postgres

2006-10-20 Thread Tom Lane
the moderation software to auto-approve pending messages from someone who's just subscribed, but perhaps that's a lot of work. I haven't looked at that code, so I'm not volunteering ... regards, tom lane ---(end of broadcast)--- TIP

Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-17 Thread Tom Lane
the result of the cast to timestamp (implicitly without time zone), then applying the AT TIME ZONE operator. regards, tom lane ---(end of broadcast)--- TIP 4: Have you searched our list archives? http

Re: [SQL] Temp tables, reports in Postgresql (and other RDBMS)

2006-10-15 Thread Tom Lane
familiar with any of the common scripting languages they're based on. The other PLs don't do implicit plan caching so they won't have problems with temp tables; but it does mean knowing still another language and putting up with some notational inconvenience. regards, tom

Re: [SQL] Recursive pl/pgsql function ...

2006-10-15 Thread Tom Lane
that in HEAD, though I did find out that a zero or negative payment_period makes it recurse until stack depth exceeded. regards, tom lane ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send

Re: [SQL] Assigning a timestamp without timezone to a timestamp

2006-10-15 Thread Tom Lane
be able to use this, which does work in 8.1: select '2006-07-13 09:20:00'::timestamp at time zone 'EST5EDT'; regards, tom lane ---(end of broadcast)--- TIP 6: explain analyze is your friend

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