. But in few situations it is required
not to wait for getting the completion of previous sql statement. How can
this e achieved?
Is this what you're looking for:
http://www.postgresql.org/docs/current/interactive/libpq-async.html
Waiting for you response.
CPK
--
Regards,
Robert &qu
Version: 1.11-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 8.4.0
; Dumped by pg_dump version: 8.4.0
Is it the WITH_INTDATE option and I should rebuild or something else
causing this error?
--Robert
--
Sent via pgsql-general mailing lis
aces after the removal and handle
beginning and end of the word, you will need to expand this to cover
those cases, but the example should contain the key ingredients.
--
Regards,
Robert "roppert" Gravsjö
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
E DATABASE foo TEMPLATE bar"
will clone bar as foo including data. Of course this only works within
the same cluster.
So we need to use slow and unsafe dump/restore over internet for this also.
Andrus.
--
Regards,
Robert "roppert" Gravsjö
--
Sent via pgsql-general ma
On 2010-12-16 11.12, Andrus Moor wrote:
Robert,
I'm probably misunderstanding but "CREATE DATABASE foo TEMPLATE bar"
will clone bar as foo including data. Of course this only works within
the same cluster.
Than you.
You are genious
I haven't never tought about this
ATE DATABASE will fail if any other connection exists
when it starts;
Are there any other side effects to this besides failing CREATE DATABASE
command?
--
Regards,
Robert "roppert" Gravsjö
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make
lso appreciate it if anyone can provide any indexing hints on this table
to optimize queries like:
SELECT value FROM tbl WHERE id=2 and '2010-12-02' BETWEEN start_date AND
stop_date;
Thanks in advance, and sorry if I overlooked any obvious documentation!
Robert McGehee
--
Sent via pgs
rested:
http://thoughts.j-davis.com/2010/09/25/exclusion-constraints-are-generalized-sql-unique/
Thanks, Robert
PS. I don't think the f_point function is necessary. Something like:
... EXCLUDE USING gist (id WITH =, f_period(start_date, end_date) WITH &&)
seems equivalent to y
solve?
--
Regards,
Robert "roppert" Gravsjö
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
there a better way or some contrib that
would help better?
Thanks, Robert
--
Robert
This e-mail message was delivered to you by a WebTent ESMTP mail gateway
after it has been filtered for spam and viruses, see the headers of
DATE/TIME stamp
fields together.
5. What UI/Developer tools (GUI) are available to manage the database as
well as add/change columns rather than doing it via SQL commands.
Thank you.
-Robert
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your
affect us, and won't
make any exceptions or changes for us, so now is the time to start looking
at our options.
-Robert
"Michael Gould" wrote in message
news:393bf55cebd45c71fec623552acbd...@intermodalsoftwaresolutions.net...
Robert,
We used Data Manager from JP to do this. W
find.
Thanks & Regards
Adarsh Sharma
use \dp in psql
And regarding the \G, it's for vertical output in mysql if I remember
correctly. The closest to this would be \x in psql.
-Andy
--
Regards,
Robert "roppert" Gravsjö
--
Sent via pgsql-general mailing
Hello,
I can't figure this out, and need help.
I need access (VIA SQL Statements) to retreive a list of all PUBLIC tables,
columns and their descriptions.
I found:
tables
columns
pg_description
1. There is no link between the description (object ID and the
tables/columns)
2. pg_description
be
lightly tested, but it's a pretty confined change, so it's unlikely to
break anything else. ISTM the worst case scenario is that it takes
two minor releases to get it right, and even that seems fairly
unlikely.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Ente
e from accounts
highlight balance where balance < 0 bgcolor=COLOR:RED
-Robert
"Jasen Betts" wrote in message news:ihmf86$98d$1...@reversiblemaps.ath.cx...
On 2011-01-20, Robert Paresi wrote:
Hello,
We have 700 user install base using Sybase SQL Anywhere 9.02
We ar
gt; book online,
I can recommend "Foundations of Databases" (Abiteboul, Hull, Vianu)
http://www.amazon.com/Foundations-Databases-Logical-Serge-Abiteboul/dp/0
201537710
--
Robert...
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes t
ler. Is there
a plperl package that I need to install similar to Unix?
Thanks.
--
Robert
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ler. Is there
a plperl package that I need to install similar to Unix?
Thanks.
--
Robert
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
tomed to under BSD, is that right and it should find
without further config or installs?
Thanks.
--
Robert
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
On 2/8/2011 11:58 AM, Robert Fitzpatrick wrote:
> could not load library “C:/Program Files/PostgreSQL/8.3/lib/plperl.dll”:
> The specified module could not be found. SQL state: 58P01
Sorry the correct error I am getting is...
could not load library “C:/Program Files/PostgreSQL/9.0/lib/plpe
tgresql.org/wiki/PostgreSQL_9.1_Open_Items
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
#x27;t expect.
Could you tell me if this is a bug or some feature I haven't heard of.
Look up functional notation in
http://www.postgresql.org/docs/9.0/static/xfunc-sql.html#AEN46042
These are the same thing:
select name(test1) from test1;
select test.name from test1;
Best regards,
Kaloy
On 2/8/2011 12:03 PM, Robert Fitzpatrick wrote:
> On 2/8/2011 11:58 AM, Robert Fitzpatrick wrote:
>> could not load library “C:/Program Files/PostgreSQL/8.3/lib/plperl.dll”:
>> The specified module could not be found. SQL state: 58P01
>
> Sorry the correct error I am getting
On %D, %SN wrote:
%Q
%C
--
Robert...
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of T ?apap?t???
> Sent: Thursday, February 10, 2011 2:18 PM
> To: pgsql-general@postgresql.org
> Subj
someone is looking to fund/help development of such a
thing, it might be worth pointing people to Postgres-XC
(http://wiki.postgresql.org/wiki/Postgres-XC). It's got a ways to go,
but they are at least trying.
Robert Treat
play: xzilla.net
work: omniti.com
hiring: l42.org/Lg
--
Sent via pgsq
The issue is more
just that the built in replication system isn't very mature yet. It's
being worked on, and switchover is something on the list, but it's not
an option yet.
Robert Treat
play: xzilla.net
work: omniti.com
hiring: l42.org/Lg
--
Sent via pgsql-general mailing list
r what you need, but will give you
versatility and flexibility for expanding your resources to other materials
if you ever need to do so. Moreover, they will provide all kinds of built in
search options such as searching by subject, author, etc..
Regards,
Robert
On Sun, Apr 10, 2011 at 1:37
of those we would have found if the default had been none. I
tend to think DSM is an important facility that we're going to be
wanting to build on in future releases, so I'm keen to have it
available by default so that we can iron out any kinks before we get
too far down that path
oubtful that anyone will get upset if their query plans change
between beta1 and beta2, but the same cannot be said for released
branches.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-general mailing list (pgsql-general@postgresql
ameter values for another user to
make sure I set this correctly. For instance, I'd like to run a query in the
spirit of this invalid query: "SHOW statement_timeout FOR user1;".
Unfortunately, SHOW only shows my parameters, though it would be nice to
examine other accounts.
Thanks, R
t.course ~ '.*' || n.node || '.*'
GROUP BY n.node;
My hope that this query would return this:
node students
---
Arts36
English 10
Biology 53
Unfortunately, this query gives the error:
ERROR: syntax error at position 0
LINE 3: WHERE t.course ~ '.*
I'm experiencing a problem with queries apparently not using the check
constraints of my partition tables (tried constraint_exclusion =partition
and =on with same results) and explain isn't sufficient to diagnose the
issue because the value for the check constraint in the query comes from a
join co
, Sep 18, 2014 at 9:22 PM, Jov wrote:
>
> Jov
> blog: http:amutu.com/blog <http://amutu.com/blog>
>
> 2014-09-19 2:44 GMT+08:00 Robert Nix :
>
>> I'm experiencing a problem with queries apparently not using the check
>> constraints of my partition tables (
:39 PM, David G Johnston <
david.g.johns...@gmail.com> wrote:
> Robert Nix wrote
> > I'm experiencing a problem with queries apparently not using the check
> > constraints of my partition tables (tried constraint_exclusion =partition
> > and =on with same result
I have a question about modeling a mutual relationship. It seems basic but
I can't decide, maybe it is 6 of one a half dozen of the other.
In my system any user might be friends with another user, that means they
have a reciprocal friend relationship.
It seems I have two choices for modeling it.
rches will always be like the following. User specifies a word
(e.g. "John") and I have a field called "FullName" that could return
records with "John Doe", "Robert Johnson", "Joe Johnson Smith", etc. I may
also extend the search criteria to other
a *non*-MCV can
require a switch to a custom plan, which is something I don't think
I've seen before.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Thanks everyone.
Either I'm not that smart or I am working on too many things at once (or
both) but making Full Text work seems super tedious. I just have a single
VARCHAR field for name, so the full name "William S. Burroughs" is a single
row and column. I want to as simply as possible have the a
On Mon, Nov 17, 2014 at 4:27 PM, Tom Lane wrote:
> Robert Haas writes:
>> On Thu, Nov 13, 2014 at 7:34 PM, Tom Lane wrote:
>>> One thing that occurs to me is that if the generic plan estimate comes
>>> out much cheaper than the custom one, maybe we should assume
saying that you would not remove both rows?
Thanks!
On Thu, Nov 13, 2014 at 8:10 AM, Jonathan Vanasco wrote:
>
> On Nov 11, 2014, at 5:38 PM, Robert DiFalco wrote:
>
> > Thoughts? Do I just choose one or is there a clear winner? TIA!
>
>
> I prefer this model
>
>
.id
<http://u.id>*
LEFT OUTER JOIN friend_requests s ON s.to_id = 33 AND s.from_id = u.id
LEFT OUTER JOIN friend_requests r ON r.to_id = u.id AND r.from_id = 33
WHERE u.id != 33 AND u.name LIKE '%John%' ORDER BY u.name;
On Tue, Dec 9, 2014 at 10:15 AM, Robert DiFalco
wr
I have users, friends, and friend_requests. I need a query that essentially
returns a summary containing:
* user (name, imageURL, bio, ...)
* Friend status (relative to an active user)
* Is the user a friend of the active user?
* Has the user sent a friend request to the acti
OUTER JOINs vs EXISTS queries and
if there was a better alternative I had not considered.
On Tue, Dec 9, 2014 at 11:44 AM, Arthur Silva wrote:
> On Tue, Dec 9, 2014 at 4:18 PM, Robert DiFalco
> wrote:
>
>> I'm sorry, I missed a JOIN on the second variation. It is:
>>
>
I have a table called friends with a user_id and a friend_id (both of these
relate to an id in a users table).
For each friend relationship there are two rows. There are currently ONLY
reciprocal relationships. So if user ids 1 and 2 are friends there will be
two rows (1,2) and (2,1).
For 2 arbit
David G Johnston <
david.g.johns...@gmail.com> wrote:
>
> Robert DiFalco wrote
> > For 2 arbitrary ids, I need a query to get two pieced of data:
> >* Are the two users friends?
>
> This seems easy...ROW(u_id, f_id) = ROW(n1, n2)
>
>
> >* How many f
cost approach than what I was already doing.
On Thu, Dec 18, 2014 at 2:07 PM, David Johnston
wrote:
>
> On Thu, Dec 18, 2014 at 3:02 PM, Robert DiFalco
> wrote:
>
>> Is the intersect any better than what I originally showed? On the ROW
>> approach, I'm not sure
sers are created. For example, a
client may submit {"name":"Robert", "hometown":"Portland"}.
The hometowns table will never be updated, only either queries or inserted.
So given this I need to INSERT a row into "users" and either SELECT the
homet
x27;
WHERE NOT EXISTS (SELECT 1 FROM sel)
RETURNING id
)
INSERT INTO users(name, hometown_id)
VALUES ('Robert', SELECT id FROM ins UNION ALL SELECT id FROM sel);
On Tue, Jan 13, 2015 at 8:50 AM, John McKown
wrote:
> On Tue, Jan 13, 2015 at 10:42 AM, Robert DiFalco > wro
This CTE approach doesn't appear to play well with multiple concurrent
transactions/connections.
On Tue, Jan 13, 2015 at 10:05 AM, John McKown
wrote:
> On Tue, Jan 13, 2015 at 11:45 AM, Robert DiFalco > wrote:
>
>> Thanks John. I've been seeing a lot of examples like
Well, traditionally I would create a LOOP where I tried the SELECT, if
there was nothing I did the INSERT, if that raised an exception I would
repeat the LOOP.
What's the best way to do it with the CTE? Currently I have the following
which gives me Duplicate Key Exceptions when two sessions try to
switching you are buying
> yourself much (if anything) by using a CTE query instead of something
> more traditional here.
>
> The advantages of switching to a CTE would be if this code was all
> being done inside of the app code with multiple queries.
>
> On Tue, Jan 13, 2015
Good points. I guess my feeling is that if there can be a race condition on
INSERT then the CTE version is not truly atomic, hence the LOOP.
On Tue, Jan 13, 2015 at 3:11 PM, Brian Dunavant wrote:
> A very good point, but it does not apply as here (and in my article)
> we are not using updates, o
insert into hometowns (name)
> select hometown_name where v_id is null
> returning id into v_id;
> EXCEPTION WHEN unique_violation
> THEN
> select id into v_id from hometowns where name = hometown_name;
> END;
> insert into users (name, hometown_id)
> values
name = hometown_name;
> BEGIN
> insert into hometowns (name)
> select hometown_name where v_id is null
> returning id into v_id;
> EXCEPTION WHEN unique_violation
> THEN
> select id into v_id from hometowns where name = hometown_name;
> END;
> inse
The code shown in the Doc (I think) will still give you deadlock in the
case where you have two sessions concurrently trying to insert the same
'hometown'. For example:
INSERT INTO users VALUES('Tom', select_hometown_id('Portland, OR'));
INSERT INTO users VALUES(''Waits', select_hometown_id('P
ld be picked
up. And there should only be a quick recoverable deadlock.
On Fri, Jan 16, 2015 at 7:49 AM, Daniel Verite
wrote:
> Robert DiFalco wrote:
>
> > I must be doing something wrong because both of these approaches are
> giving
> > me deadlock exceptions.
>
>
I have several tables that I use for logging and real-time stats. These are
not critical and since they are a bottleneck I want transactions against
them to always be asynchronous. Is there a way to specify this at a table
level or do I have to make sure to call set synchronous_commit='off' every
be my
understanding is off.
On Mon, Jan 19, 2015 at 11:10 AM, Andreas Kretschmer <
akretsch...@spamfence.net> wrote:
> Robert DiFalco wrote:
>
> > I have several tables that I use for logging and real-time stats. These
> are not
> > critical and since they are a bottleneck I
Hometowns get selected and possibly inserted in unpredictable ways even
from multiple concurrent sessions. The only way I could figure out how to
solve it was to force each INSERT hometowns to be in its own transaction.
On Mon, Jan 19, 2015 at 1:56 PM, Robert DiFalco
wrote:
> I don't
I don't think an advisory lock would remove the deadlock.
On Sun, Jan 18, 2015 at 10:33 PM, Roxanne Reid-Bennett
wrote:
> On 1/16/2015 2:41 AM, Jim Nasby wrote:
>
>> On 1/15/15 10:57 PM, Roxanne Reid-Bennett wrote:
>>
>>>
>>> try this: (if you still get deadlocks, uncomment the advisory lock
>>
Yes, I consider it a tool issue and not a database issue. Is there
somewhere else I should be posting this to?
Thanks,
Robert
-Original Message-
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Thomas Kellerer
Sent: Thursday, January 03
Typically, my web application does some initial validation, then, if
it passes, does the actual query. For both performance and
simplicity, I'd like to combine these all into one trip to Postgres.
Ideally, I'd like to do this in SQL. If that's not possible, I could
use PL/pgsql, though I'm not ad
I need to INSERT a large number of records. For performance reasons,
I'd rather send them to Postgres in one giant INSERT.
However, if there's a problem in one record (eg one row doesn't meet a
constraint), I'd still like the others saved. That is, I specifically
DO NOT want atomic behavior. It
On 1/13/13, Ian Lawrence Barwick wrote:
> 2013/1/14 Robert James :
>> I have a lot of VALUES I want to INSERT. But only a subset of them -
>> only those that meet a JOIN criteria involving another table.
>>
>> I could INSERT them into a temp table, and then do a SELECT
On 1/13/13, Chris Angelico wrote:
> On Mon, Jan 14, 2013 at 3:37 PM, Robert James
> wrote:
>> Thanks. But how do I do that where I have many literals? Something like:
>>
>> INSERT INTO seltest (id, a, b) SELECT (1,2,3),(4,5,6),(7,8,9) WHERE b
>> IN (SELECT ...)
&
I'd like to organize tables into different groups. This is for 3 reasons:
1. Each group needs to be backed up and restored independently from the others
2. Each group has different permissions for particular users
3. As an aid to human understanding organization
I would do this as actual database
I've been getting a funny SQL error, which I've boiled down to this case.
SELECT (regexp_matches('abc', '(.)b(.)'))[1] IS NOT NULL
-- Returns true, as expected
SELECT (regexp_matches('abc', '(.)b(.)'))[1] IS NOT NULL AND true
-- Gives this error:
ERROR: argument of AND must not return a set
SQL s
I'd like to understand better why manually using a temp table can
improve performance so much.
I had one complicated query that performed well. I replaced a table
in it with a reference to a view, which was really just the table with
an inner join, and performance worsened by 2000x. Literally.
I'd like to better understand TIMESTAMP WITH TIME ZONE.
My understanding is that, contrary to what the name sounds like, the
time zone is never stored. It simply stores a UTC timestamp,
identical to what TIMESTAMP WITHOUT TIME ZONE stores.
And then the only difference is that WITH TIME ZONE will
On 1/18/13, Tom Lane wrote:
> Jeff Janes writes:
>> On Fri, Jan 18, 2013 at 9:29 AM, Robert James
>> wrote:
>>> In other words: Since my query is 100% identical algebraicly to not
>>> using a temp table, why is it so much faster? Why can't the pl
On 1/18/13, Steve Crawford wrote:
> On 01/18/2013 09:31 AM, Robert James wrote:
>> I'd like to better understand TIMESTAMP WITH TIME ZONE.
>>
>> My understanding is that, contrary to what the name sounds like, the
>> time zone is never stored. It simply stores
order
for this to happen? It's been 30 minutes since the process was killed.
Also, is there some method of governing the temporary space used? Our
temp_tablespace parameter is null.
Thanks
Robert
, February 05, 2013 12:07 PM
To: Robert Klaus
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] cleanup of pgsql_tmp directory
"Robert Klaus" writes:
> This morning we found out that our filesystem was at 98% and filling
> quickly. We immediately found one query running for
Updating: I found two other sessions running the same query. Once I killed them
the pg_tmp files were automatically deleted.
>>
This morning we found out that our filesystem was at 98% and filling quickly.
We immediately found one query running for a long time and saw 1500+ files in
the pg
, let me know if not, thanks
--
Robert
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Not sure if this is a feature request or a bug report.
I'm trying to use Foreign Tables for a variety of things and it is useful to
have a foreign table which appears to be read/write.
Having set one up, I can select data from it. However, I can't insert, update
or delete.
No worries, thinks
Paolo Saudin
Wednesday, April
03, 2013 3:10 PM
Try to check the
perl version against Postgres version at http://forums.enterprisedb.com/posts/list/3295.page
Thanks! I'm using postgresql 9.2 and needed 5.14, luckily still
available.
x27;s the latter, you'll
probably need to write your own tools; at least we've always done that
as we've never found anything that worked with both Oracle and MSSQL
into Postgres reliably; but really it shouldn't be too difficult;
basically just ETL or some home brew repli
gsql was port to use the core lexer. Ideally
you'll have some kind of test suite / regression you can run to verify
all of this; if not you maybe you can set up some replication between
old/new servers (we use mimeo for that when sever versions are this
far apart) and point your app to both a
;2013-03-17' and
market = 'Chicago'; voice.daily_nbr_list_201304; AccessShareLock
select * from voice.daily_nbr_list where item_date = '2013-03-17' and
market = 'Chicago'; voice.daily_nbr_list_201305; AccessShareLock
I noticed row exclusive locks being held on all partitions for procedure
calls that update the data.
Thanks,
Robert
rket =
'Chicago'; voice.daily_nbr_list_201303; AccessShareLock
select * from voice.daily_nbr_list where item_date = '2013-03-17' and market =
'Chicago'; voice.daily_nbr_list_201304; AccessShareLock
select * from voice.daily_nbr_list where item_date = '2013-03-17' and market =
'Chicago'; voice.daily_nbr_list_201305; AccessShareLock
I noticed row exclusive locks being held on all partitions for procedure calls
that update the data.
Thanks,
Robert
I realize the syntax above may not work, just trying to get across my
idea and hope for some guidance how all this could be done, if possible.
Thanks for any pointers!
--
Robert
--
Robert
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
les.
SELECT x.dtidx, p.price
FROM stk_prc p,
(SELECT a.dtidx, max(b.dtidx) as lastidx
FROM stk_prc a, stk_prc b
WHERE a.dtidx>=b.dtidx AND b.price IS NOT NULL GROUP BY a.dtidx) x
WHERE p.dtidx=x.lastidx;
Thanks,
Robert McGehee, CFA
Geode Capital Management, LLC
One Post
In relational algebra, I have relation R and relation S, and want to
find the cardinality of R, of S, and of R-intersect-S.
I know the SQL for R and S. What's the best way to compute the
cardinality of each relation (query) and of their intersection?
--
Sent via pgsql-general mailing list (pgs
I have two relations, where each relation has two fields, one
indicating a name and one indicating a position. That is, each
relation defines a sequence.
I need to determine their longest common subsequence. Yes, I can do
this by fetching all the data into Java (or any other language) and
comput
On 7/8/13, hubert depesz lubaczewski wrote:
> On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote:
>> I have two relations, where each relation has two fields, one
>> indicating a name and one indicating a position. That is, each
>> relation defines a sequence.
>
I'd like a stored procedure which does something like:
INSERT INTO...
SELECT... -- This should be returned as multicolumn, multifield - just
like a table or view
When I run it, though, instead of getting a table, I get one field
with all the data in it as a compound type. I'd like to return the
Is there any way to set a variable or parameter for a query?
I have a long query where a certain variable needs to be easy to
change. I'd like to do something like:
threshold = 10.3
SELECT... WHERE x > $threshold... AND y * 1.3 > $threshold...
Currently, I need to do this in a scripting langua
I have a view which is very slow to computer, but doesn't change often.
I'd like to materialize it. I thought I'd do a simple poor man's materialize by:
1) ALTER VIEW myview RENAME to _myview
2) SELECT * INTO myview FROM _myview
The only problem is that all my other views, which are dependent on
I'm doing a JOIN which is very slow:
JOIN t ON t.f1 LIKE (q.f1 || '%')
t1 has an INDEX on (f1, f2) which I thought would help for this. But
Postgres seems to still use a (very slow) Nested Loop. What type of
index would be appropriate for this?
(My goal is to join on a substring starting from
I noticed that when I have an index on (a,b) of table t, and I do an
SELECT * FROM t ORDER BY a ASC, it doesn't use the index. When I
create a new index of only a, it does use the index. Why is that?
And, more importantly, when I do a query involving a merge join of
table t, which requires sorti
On 8/13/13, Robert James wrote:
> I noticed that when I have an index on (a,b) of table t, and I do an
> SELECT * FROM t ORDER BY a ASC, it doesn't use the index. When I
> create a new index of only a, it does use the index. Why is that?
>
> And, more importantly, when I do
On 8/13/13, Craig Ringer wrote:
> On 08/14/2013 06:05 AM, Robert James wrote:
>> I'm doing a JOIN which is very slow:
>>
>> JOIN t ON t.f1 LIKE (q.f1 || '%')
>>
>> t1 has an INDEX on (f1, f2) which I thought would help for this. But
>> Postgr
On 8/14/13, Kevin Grittner wrote:
> Robert James wrote:
>
>> I'm confused: What's the difference between
>> col LIKE 'foo%'
>> and
>> col LIKE f1 || '%'
>> ?
>
> The planner knows that 'foo%' doesn'
How can I escape a string for LIKE operations?
I want to do:
SELECT * FROM t WHERE a LIKE b || '%'
But I want be to interpreted literally. If b is 'The 7% Solution', I
don't want that '%' to be wildcard. I can't find an appropriate
function to escape it and any other potential wildcards for LI
On 8/15/13, Jeff Janes wrote:
> On Thu, Aug 15, 2013 at 1:16 PM, Robert James
> wrote:
>> How can I escape a string for LIKE operations?
>>
>> I want to do:
>>
>> SELECT * FROM t WHERE a LIKE b || '%'
>>
>> But I want be to interpreted l
I have a query which, when I materialize by hand some of its
components, runs 10x faster (including the time needed to
materialize). Is there any way to force Postgres to do that? Or do I
need to do this by hand using temp tables?
--
Sent via pgsql-general mailing list (pgsql-general@postgresql
If I have a slow_function(), and I create an index of
slow_function(field), will Postgres use that index to avoid having to
recompute the function?
Example:
SELECT slow_function(field1) FROM table1 WHERE id = 5
It won't use the index on field1 to _find_ the record. Can it use it
to compute the
What's the best way to check if string a begins with string b?
Both a and b are coming from fields in a table.
Requirements:
* Either a or b might have special chars (such as '%') in them which
should NOT do anything special - they're just plain strings, not
regular expressions.
* a and b can be
201 - 300 of 1119 matches
Mail list logo