Re: [SQL] [NOVICE] Understanding Encoding

2013-09-06 Thread Tom Lane
I'd have thought the terminal program would set up the right environment ... but you might as well try it. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] update column based on postgis query on anther table

2013-07-15 Thread Tom Lane
that to be a BEFORE insert or update trigger. In an AFTER trigger, it's too late to affect the stored row. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Unquoted column names fold to lower case

2013-07-03 Thread Tom Lane
. Postgres settled on this behavior fifteen years ago, and we're not changing it now. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Unquoted column names fold to lower case

2013-07-03 Thread Tom Lane
just like any other. And you'd still be paying a large part of the application breakage costs, because the identifiers coming back in query descriptors are one of the main ways applications would notice such a change. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] Index Usage and Running Times by FullTextSearch with prefix matching

2013-06-13 Thread Tom Lane
index; GIST seems much less able to do well with short prefixes). What PG version are you testing? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] bug in 9.2.2 ? subquery accepts wrong column name : upd

2013-03-14 Thread Tom Lane
outer reference to qry.setid. Probably not one of SQL's better design features, since it confuses people regularly; but it's required by spec to work like that. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] UPDATE query with variable number of OR conditions in WHERE

2013-03-14 Thread Tom Lane
values. If you're not into prepared statements, this may not excite you, but some people find it to be a big deal. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [SQL] Need help revoking access WHERE state = 'deleted'

2013-02-28 Thread Tom Lane
What's failing is that the *owner of the view* needs, and hasn't got, select access on the entities table. This is a separate check from whether the current user has permission to select from the view. Without such a check, views would be a security hole. regards, tom lane

Re: [SQL] Update HSTORE record and then delete if it is now empty - What is the correct sql?

2013-02-23 Thread Tom Lane
for you, you could use an AFTER trigger instead, which will be a little slower but it hides the deletes behind the scenes. (Note: a DELETE issued in a trigger is a separate query, which is why it doesn't fall foul of the limitation your WITH query did.) regards, tom lane

Re: [SQL] Writeable CTE Not Working?

2013-01-29 Thread Tom Lane
to be sure which one would process a particular row first. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] How to access multicolumn function results?

2013-01-23 Thread Tom Lane
enough. With simpler functions you might have to insert OFFSET 0 into the sub-select to keep the planner from flattening it into the upper query and producing the same multiple-evaluation situation. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] Curious problem of using BETWEEN with start and end being the same versus EQUALS '='

2013-01-15 Thread Tom Lane
, but not for a range constraint. Did you do that manually and not tell us about it? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Date Index

2012-11-05 Thread Tom Lane
', start_date at time zone 'utc') http://www.postgresql.org/docs/9.2/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] Database object names and libpq in UTF-8 locale on Windows

2012-10-11 Thread Tom Lane
a pgAdmin bug. You should report it in the pgAdmin mailing lists. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] underscore pattern in a query doens't work

2012-09-13 Thread Tom Lane
-linux-gnu, compiled by GCC gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10), 64-bit You do realize this is about 3 years out of date? The 8.4 series is up to release 8.4.13, and a lot of those updates contained fixes for serious bugs. regards, tom lane -- Sent via pgsql

Re: [SQL] underscore pattern in a query doens't work

2012-09-13 Thread Tom Lane
Sergio C. angusyou...@yahoo.es writes: We started the cluster up with this command: ./initdb -D /usr/local/postgre/data -E UTF8 -U sir That doesn't prove anything about the specific database where you're having the problem ... regards, tom lane -- Sent via pgsql-sql

Re: [SQL] locks and select for update

2012-08-31 Thread Tom Lane
, even though some of them have names containing the word ROW for historical reasons. I don't see how you'd read it to imply that there are no finer-grained locks anywhere in Postgres. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] Tablesample Function on Postgres 9.1

2012-08-29 Thread Tom Lane
/TABLESAMPLE_Implementation) Sorry, that wiki page is just blue-sky speculation. If the feature were supported, you would find it in the main documentation. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Error: Template Id should be teh identifier of a template - help

2012-08-17 Thread Tom Lane
need to identify what layer of software it's coming from, and complain to the appropriate people. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] fsync debug messages in pgsql logs

2012-08-08 Thread Tom Lane
interesting.) It does seem a bit odd that only fsm files are being complained of, though. What PG version is that exactly? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] fsync debug messages in pgsql logs

2012-08-08 Thread Tom Lane
Wayne Cuddy lists-pg...@useunix.net writes: On Wed, Aug 08, 2012 at 12:23:22PM -0400, Tom Lane wrote: If it only complains once per file name, this is expected behavior when somebody drops a table just before the checkpoint mechanism tries to fsync it. (If the failure were to repeat

Re: [SQL] can this be done with a check expression?

2012-08-02 Thread Tom Lane
the ranges as indexable objects. In 9.0 or 9.1, probably the best way is to use contrib/seg/ to represent the ranges as line segments. 9.2 will have a cleaner solution, ie range types. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] FW: view derived from view doesn't use indexes

2012-07-26 Thread Tom Lane
are an optimization fence. That particular function looks like it should be IMMUTABLE instead, since it depends on no database state. If it does look at database state, you can probably use STABLE. http://www.postgresql.org/docs/9.0/static/xfunc-volatility.html regards, tom

Re: [SQL] DELETE using an outer join

2012-07-20 Thread Tom Lane
Sergey Konoplev gray...@gmail.com writes: On Thu, Jul 19, 2012 at 6:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Now I was wondering if a DELETE statement could be rewritten with the same strategy: Not at the moment. There have been discussions of allowing the same table name

Re: [SQL] DELETE using an outer join

2012-07-19 Thread Tom Lane
strategy: Not at the moment. There have been discussions of allowing the same table name to be respecified in USING, but there are complications. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] How does Numeric division determine precision?

2012-07-12 Thread Tom Lane
that numeric gives a * result no less accurate than float8; but use a scale not less than * either input's display scale. */ I wouldn't necessarily claim that that couldn't be improved on, but that's what it does now. regards, tom lane -- Sent via pgsql-sql

Re: [SQL] possible bug in psql

2012-05-28 Thread Tom Lane
to edit longer text. You'd need to tell the readline people about that one. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] SELECT 1st field

2012-05-15 Thread Tom Lane
); regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] order by different on mac vs linux

2012-05-14 Thread Tom Lane
/charset.html regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Finding Max Value in a Row

2012-05-13 Thread Tom Lane
the types *can* be cast if you try. Would it be better if the message said cannot be cast implicitly to type foo? We could also consider a HINT mentioning use of USING. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] Uniform UPDATE queries

2012-04-18 Thread Tom Lane
syntax for this. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] sintax error

2012-04-11 Thread Tom Lane
this: regression=# select 1/ from foo; ERROR: syntax error at or near from LINE 1: select 1/ from foo; ^ If you're using something so old that it doesn't do that, the answer is to update. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] COPY without quoting

2012-03-15 Thread Tom Lane
-readable files, so the fact that it doesn't have an option for this doesn't bother me. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Type Ahead Issue

2012-03-07 Thread Tom Lane
maybe if somebody got ambitious they could improve it. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Natural sort order

2012-02-29 Thread Tom Lane
weird user-defined version of substr() or ~ that isn't immutable? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] array_agg order by

2012-02-27 Thread Tom Lane
it gets to the Aggregate step. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Function definitions - batch update

2012-02-21 Thread Tom Lane
. The latter, if not done as superuser, would at least ensure you didn't accidentally break any functions you don't own. In either case, I'd practice against a test copy of the database before doing this live ... regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] pg_dump not correctly saving schema with partitioned tables?

2012-01-31 Thread Tom Lane
found a pg_dump bug, but if so you'll need to submit a complete test-case exhibiting the bug. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: Fw: Re: [SQL] pg_dump not correctly saving schema with partitioned tables?

2012-01-31 Thread Tom Lane
in that. In the longer term it might be nicer if the system catalogs did record inherited-ness of defaults (and then pg_dump could rely on that info instead of guessing); but that would be a far more invasive change. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] DECIMAL or NUMERIC Data Types

2012-01-05 Thread Tom Lane
already told last week: http://archives.postgresql.org/pgsql-general/2011-12/msg00899.php regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Current transaction is aborted, commands ignored until end of transaction block

2011-12-30 Thread Tom Lane
, there are client-side frameworks that will do it for you, or you can roll your own easily enough. So we do not see it as a big deal that the database server itself doesn't act that way. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Does anyone know of any issues around ARRAY UNNEST

2011-11-27 Thread Tom Lane
Postgres backends, and it's really hard to believe that unnest would be affected by what's happening in other server processes. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] Does anyone know of any issues around ARRAY UNNEST

2011-11-27 Thread Tom Lane
a fix, which will appear in next week's updates. Thanks for the report and test case! regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] strange error message

2011-11-25 Thread Tom Lane
minor release of your Postgres branch, update and see if it goes away. If not, please file a bug report with sufficient information to reproduce the problem by hand (ie, the problem query plus schema+data sufficient to run it against). regards, tom lane -- Sent via pgsql

Re: [SQL] the use of $$string$$

2011-11-04 Thread Tom Lane
at it. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] optimize self-join query

2011-10-27 Thread Tom Lane
. But for now, it's going to be painful. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] plpgsql function executed multiple times for each return value

2011-10-08 Thread Tom Lane
Steve Northamer stevenortha...@gmail.com writes: So my questions are: 1) How do we cause the paymentcalc function to be executed only once? In recent versions, I think marking it volatile would be sufficient. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] ambiguous local variable name in 9.0 proc

2011-09-21 Thread Tom Lane
recommend turning off the conflict detection, though. We put it in because of the number of hours people had wasted on unrecognized conflicts. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Use select and update together

2011-09-17 Thread Tom Lane
to do anything except scan the subquery once. But if you did a join, say, watch out!) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] where col1 not ilike ('str1%', 'str2%'... 'strN%') support?

2011-08-30 Thread Tom Lane
~~* any(array['str1%', 'str2%'... 'strN%'])); regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] where col1 not ilike ('str1%', 'str2%'... 'strN%') support?

2011-08-30 Thread Tom Lane
Emi Lu em...@encs.concordia.ca writes: On 08/30/2011 11:24 AM, Tom Lane wrote: select * from tablename where not (col1 ~~* any(array['str1%', 'str2%'... 'strN%'])); If next version could have not ilike ('', '') added into window functions, that's will be great! Why? And what's this got

Re: [SQL] Cursor names in a self-nested function

2011-08-18 Thread Tom Lane
; EXIT WHEN newid IS NULL; out := out || test (newid); END LOOP; RETURN out; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] which is better: using OR clauses or UNION?

2011-08-16 Thread Tom Lane
in the output, you should consider UNION ALL instead of UNION. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Mysterious column name

2011-08-09 Thread Tom Lane
regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] a strange order by behavior

2011-06-22 Thread Tom Lane
to be perfectly clear: this is not Postgres' fault, it's just sorting the way strcoll() says to. You'll get the same sort order from the command-line sort(1) program, if you feed it the same data in the same locale environment. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] query expression body ::= joined table grammar rule not accepted by Postgres

2011-06-16 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Subselects not allowed?

2011-06-11 Thread Tom Lane
speculation about changing that, but it would take a significant amount of work I think. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Performance of NOT IN and with PG 9.0.4

2011-05-25 Thread Tom Lane
, but are there enough that join_collapse_limit or from_collapse_limit could be in play? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Sorting Issue

2011-05-10 Thread Tom Lane
ignoring spaces in the first pass. You might be happier using C collation. Unfortunately that requires re-initdb'ing your database (as of existing PG releases). regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Sorting Issue

2011-05-09 Thread Tom Lane
locales often have truly bizarre sorting rules. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Specifying column level collations

2011-05-07 Thread Tom Lane
that. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] FATAL: invalid cache id: 19

2011-05-02 Thread Tom Lane
manuel antonio ochoa manuel8aalf...@gmail.com writes: How can I solve this problem : FATAL: invalid cache id: 19 There was a bug with that symptom in 9.0.0 and 9.0.1 ... if you're running one of those versions, update. regards, tom lane -- Sent via pgsql-sql

Re: [SQL] getting PSQLException Can't infer the SQL type to use with Native Query call

2011-05-02 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Multiple recursive part possible?

2011-05-01 Thread Tom Lane
... Leave out the second with recursive. WITH introduces a list of name-AS-subselect clauses, not just one. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL]

2011-04-21 Thread Tom Lane
a question about how to deal with such cases through the JDBC driver, so I'd suggest asking on the pgsql-jdbc list. (Perhaps in a less messy format this time, and could we ask for a useful Subject: line too?) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql

Re: [SQL] unnesting of array of different size explodes memory

2011-04-13 Thread Tom Lane
: SELECT * from unnest(ARRAY[1,2,3]) a, unnest(ARRAY[4,5,6,7]) b; This has saner behavior and is less likely to leak memory. Not to mention less likely to be deprecated or de-implemented altogether in the far future. regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] pass in array to function for use by where clause? how optimize?

2011-04-13 Thread Tom Lane
, but it's at least easier to write. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] pass in array to function for use by where clause? how optimize?

2011-04-13 Thread Tom Lane
Rob Sargent robjsarg...@gmail.com writes: On 04/13/2011 09:09 AM, Tom Lane wrote: Anish Kejariwalanish...@gmail.com writes: (select store_id, avg(sales) sales from store where group_id in(select $1[i] from generate_subscripts($1, 1) g(i)) Seems like a pretty brute-force way to deal

Re: [SQL] pg_attributte, data types

2011-03-23 Thread Tom Lane
Those are array types. The normal convention is that foo[] is named _foo under the surface. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] replace_matches does not return {null}

2011-02-22 Thread Tom Lane
at all. Yes, because regexp_matches returns a rowset of zero or more results. The fine manual suggests putting it in a sub-select if what you want is a null or a single result: SELECT ... , (SELECT regexp_matches(...)) FROM ... regards, tom lane -- Sent via pgsql-sql

Re: [SQL] Oracle Equivalent queries in Postgres

2011-02-16 Thread Tom Lane
: providing standardized views would reduce customer lock-in, by making applications more portable to other DBMSes. The pain the OP is feeling is a marketing advantage, so far as Oracle is concerned. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] Determine length of numeric field

2011-02-15 Thread Tom Lane
not where sourceid 9? Or maybe where abs(sourceid) 9 would be better. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] DELETE FROM takes forever

2011-02-10 Thread Tom Lane
don't remember right now how smart 8.3 is about either. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Transaction-specific global variable

2011-02-03 Thread Tom Lane
that doesn't actually have any underlying loadable module. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] aggregation of setof

2011-01-31 Thread Tom Lane
implementation. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Control reached end of trigger procedure without RETURN

2011-01-25 Thread Tom Lane
ventas_imp_a_ventas_cab The function that's lacking a RETURN is not the one you're showing us. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] why does seq scan instead of index scan

2011-01-14 Thread Tom Lane
=?iso-2022-jp?B?GyRCQ2ZAbiEhQD81LhsoQg==?= nakag...@ivp.co.jp writes: I'm trying to use like 'xx%' search on Text[] column. I thought it uses index scan. But actually it uses seq scan. Why? Those ANY expressions are not indexable. regards, tom lane -- Sent via pgsql

Re: [SQL] Find NOT NULLs in a group of 20 columns

2011-01-10 Thread Tom Lane
... WHERE ((col1 is not null)::int + (col2 is not null)::int + ... (col20 is not null)::int) = 1 -- or 1 regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql

Re: [SQL] COPY with FORMAT in Postgresql 9.x

2010-12-03 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] subselect and left join not working?

2010-11-29 Thread Tom Lane
NULL means unknown in this context). Newbies get caught by that all the time :-( ... it's not one of SQL's better features. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [SQL] atomic multi-threaded upsert

2010-11-24 Thread Tom Lane
. Why don't you use a real sequence object and nextval()? regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] obtaining difference between minimum value and next in size

2010-11-17 Thread Tom Lane
John Lister john.lister...@kickstone.com writes: Is it possible to obtain the difference between just the minimum price and the next one up per product, If you're using = 8.4, try a window function. LEAD or LAG ought to do it. regards, tom lane -- Sent via pgsql-sql

Re: [SQL] psql -f COPY from STDIN

2010-11-13 Thread Tom Lane
backslash commands across lines. When I remove the linefeeds I don't get errors but it does not import anything. You wanted pstdin, not stdin. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] psql -f COPY from STDIN

2010-11-12 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] unexpected ORDER BY

2010-11-09 Thread Tom Lane
the LC_COLLATE setting. If you want plain ASCII sort order, you need to switch to C locale. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] I'm stuck - I just can't get this small FUNCT to run!

2010-11-03 Thread Tom Lane
for development. That has its own hazards of course, like accidentally using features that don't exist in 7.4, but it could save you a lot of time in cases like this. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] A more efficient way?

2010-10-31 Thread Tom Lane
against using it if you can get decent performance with EXISTS. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] SIMILAR TO

2010-10-16 Thread Tom Lane
it appears that the behavior of SIMILAR TO has changed in pg9.0. My question is, how do I modify my code so that it works in 9.0? Drop the ^ and $; they are incorrect for SIMILAR TO. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] Random sort with distinct

2010-10-02 Thread Tom Lane
and the ORDER BY in separate query levels, like this: select * from (Select Distinct VehicleMake, VehicleModel From VehicleYearMakeModelTrim) ss Order by random() Limit 10; regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes

Re: [SQL] pg_config -less

2010-09-23 Thread Tom Lane
they spell it postgresql-dev or something else). It should certainly be available somewhere from them --- if not, file a packaging bug report. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http

Re: [SQL] Slow response in select

2010-09-21 Thread Tom Lane
matter. Basically, if you're gonna join that many relations, it's gonna cost ya :-(. Star schemas are overrated IMO. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref

Re: [SQL] Table returning functions

2010-09-19 Thread Tom Lane
, and the lack of any very sane way to define the behavior is the main argument for deprecating SRFs in the targetlist. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] 9.0rc1 - query of view produces unexpected results

2010-09-14 Thread Tom Lane
Nathan Grange nath...@actarg.com writes: Or if this is a bug with 9.0, what actions do I take to make the PostgreSQL team awares? I think you already did ;-) regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Question regarding indices

2010-09-11 Thread Tom Lane
? Would sorting them and sending the SQL query with ordered data influence the speed of the query? It's unlikely to make enough difference to be worth the trouble. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Question regarding indices

2010-09-11 Thread Tom Lane
Steve stev...@gmx.net writes: Von: Tom Lane t...@sss.pgh.pa.us It's unlikely to make enough difference to be worth the trouble. Making a quick sort is ultra easy in C. Anyway... is there a difference in the speed of the query with pre-sorted values or not? If there is one then I will go

Re: [SQL] Controlling join order with parenthesis

2010-09-09 Thread Tom Lane
wouldn't recommend it as a production setting. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Sequential scan evaluating function for each row, seemingly needlessly

2010-09-07 Thread Tom Lane
my_expensive_function(...), etc, etc from (select * from some-tables order by foo limit n) ss; where the inner select list just pulls the columns you'll need in the outer calculations. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org

Re: [SQL] naming arguments in aggregate function

2010-09-05 Thread Tom Lane
=?UTF-8?Q?Viktor_Bojovi=C4=87?= viktor.bojo...@gmail.com writes: I am trying to name arguments in aggregate function, but i don't know how, You can't --- it's not implemented. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make

Re: [SQL] polygon overlay

2010-09-01 Thread Tom Lane
the poly_overlap function did this: * Determine if polygon A overlaps polygon B by determining if * their bounding boxes overlap. * * XXX ought to do a more correct check! I see it's been improved for 9.0 ... regards, tom lane -- Sent via pgsql-sql mailing list

Re: [SQL] a general ? on select performance

2010-08-28 Thread Tom Lane
. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

  1   2   3   4   5   6   7   8   9   10   >