On Wed, Jun 25, 2008 at 09:50:18AM -0400, Mark Stosberg wrote:
> hits
> hit_id
> partner_id
>
> views
> view_id
> partner_id
>
> There is of course a "partners" table with a "partner_id" column.
>
> My target result is more like
>
> partner_id
> total_views
> total_hits
select
co
On Mon, Jun 09, 2008 at 12:05:52PM -0400, Michael Eshom wrote:
> I am trying to create a "UNIX_TIMESTAMP()" function in PostgreSQL, which
> will return the current timestamp. However, whenever I try to add this
> function in phpPgAdmin, it says 'Syntax error at or near ")" at
> character 28'.
y
On Fri, May 16, 2008 at 11:51:20PM +1000, Gavin 'Beau' Baumanis wrote:
> I am hoping that you might be able to give me some assistance with the
> following task!
> I have a database with nearly 200 tables and I need to find all tables
> that contain a column of myColumnName.
select * from info
On Sun, May 11, 2008 at 01:37:52PM -0400, Mag Gam wrote:
> Any thoughts about this?
1. will there be any gaps in between dates? if yes, what should be diff
be then?
2. can't you calculate it in client application?
3. is usage of pl/pgsql acceptable (i think this will be the fastest way
to do it in
On Tue, Apr 22, 2008 at 12:31:54PM +0200, Nacef LABIDI wrote:
> When I have tested this with SQLServer it works well, since the rows doesn't
> change position on the DB.
> I hope that you understand my issue and I will provide any explanations if
> someting isn't clear enough.
well. in postgresql
On Tue, Apr 22, 2008 at 12:10:41PM +0200, Nacef LABIDI wrote:
> Yes I don't issue any sort statement, and I indeed want the data to be show
> as it is stored in the database. But after updating a row (I don't update
> the ID, just some fields), it keeps its same place on the DB but jumps to
> the e
On Mon, Apr 21, 2008 at 03:48:23PM +0200, Thomas Kellerer wrote:
> name, id, parent_id
> ROOT, 1, NULL
> CHILD1, 2, 1
> CHILD2, 3, 1
>
> I would have expected the following result:
>
> ROOT, NULL
> ROOT, CHILD1
> ROOT, CHILD2
>
> but the row with (ROOT,NULL) is not returned.
why would you expe
On Tue, Mar 18, 2008 at 01:40:42PM -0500, Campbell, Lance wrote:
> This is not a security approach. It is more about not giving obvious
> access to people that want to mess around.
1. keep primary key using standard serial. it will make your life a bit
simpler.
2. add column for text random ident
On Tue, Jan 22, 2008 at 10:16:30AM +0300, silly_sad wrote:
> INSERT INTO ttt (a,b) SELECT currval('ttt_id_seq'), 'const' FROM ttt2;
> Where the trigger before insert on ttt is defined and this trigger calls
> nextval('ttt_id_seq').
> I was surprised having different values of currval() in ttt.a
>
On Thu, Nov 29, 2007 at 04:04:54PM +0100, Christian Kindler wrote:
> I have a realy big table (> 2'000'000 records). every second there are
> several inserts and updates. the thing is i need a last row reference
> depending on a foreing_key.
>
> something like this:
>
> id, foreign_key, last_
On Wed, Nov 14, 2007 at 02:39:02PM +0100, Julien Cigar wrote:
> With the following I got a syntax error:
> select specimen_id
> from specimen_test_bits
> where test_bit_id = all(1,2,3,4);
where test_bit_id in (1,2,3,4)
group by specimen_id
having count(distinct test_bit_id) = 4;
depesz
--
qui
On Mon, Sep 17, 2007 at 09:17:58AM +0200, Stanislas de Larocque wrote:
> Have you advices to optimize the query please ?
for some many rows the 400ms looks quite reasonable.
the best thing you can make to speed things up is to calculate the
counts with triggers.
depesz
--
quicksil1er: "postgre
On Fri, Sep 14, 2007 at 03:02:59PM +0200, Stanislas de Larocque wrote:
> I want to optimize my query sql (execution time : 2665 ms) :
SELECT
b.idxreseller,
sum(a.nbrq),
b.namereseller
from
stat a,
reseller b
where
b.asp=6
and a.idxreseller=b.reseller
and a.month=d
On Fri, Sep 14, 2007 at 12:26:00PM +0200, Stanislas de Larocque wrote:
> Explain my sql querry :
did you notice, that andreas asked:
> > Show us the output from EXLAIN ANALYSE .
depesz
--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
htt
On Tue, Aug 28, 2007 at 08:00:42AM -0500, Michael Glaesemann wrote:
> >you can try to use "distinct on".
> I considered that as well, but couldn't think of a way to return more
you're right and i was wrong. i simply missed the word "two" in original
question. sorry.
depesz
--
quicksil1er: "po
On Mon, Aug 27, 2007 at 06:36:47PM +0200, Claudia Kosny wrote:
> Is there a way to do this with one query?
> I am using PostgreSQL 7.4.
you can try to use "distinct on".
depesz
--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.d
On Sat, Aug 11, 2007 at 02:45:09AM -0500, Javier Fonseca V. wrote:
> I think that it's working alright except for the next line:
doing this in plpgsql is very complicated (or even impossible assuming
that any table can have the same trigger). i would rather suggest using
pl/perl - writing somethin
On Fri, Aug 10, 2007 at 04:53:12PM +0200, Andreas Joseph Krogh wrote:
> I have the following test-case:
>
> CREATE TABLE test(
> name varchar PRIMARY KEY,
> value varchar NOT NULL,
> created timestamp not null
> );
>
> create index test_lowernamevalue_idx ON test ((lower(name) || lower(value)));
On Fri, Aug 10, 2007 at 08:13:46PM -0500, Rodrigo De León wrote:
> On 8/10/07, hubert depesz lubaczewski <[EMAIL PROTECTED]> wrote:
> > unfortunatelly this query will be hard to optimize.
>
> Uh, how about
>
> SELECT MAX(t1)
> FROM t1
> WHERE '9849'
On Fri, Aug 10, 2007 at 04:40:34PM -0300, Fernando Hevia wrote:
> Found your query is shorter and clearer, problem is I couldn't have it use
> an index. Thought it was a locale issue but adding a 2nd index with
> varchar_pattern_ops made no difference.
> In result, it turned out to be too slow in c
On Mon, Aug 06, 2007 at 04:44:29PM -0300, Ranieri Mazili wrote:
> 1) Can I use a function that will return a string in a where clause like
> bellow?
> 2) Can I use a function that will return a string to return the list of
> columns that I want to show like below?
not in sql. you can in pl/pgsql
On Mon, Aug 06, 2007 at 01:57:07AM -0700, Kiran wrote:
> Could anyone help me in writing Best Fit SQL statement.
> Suppose we have table t1 with coloumn t1 (text) with following rows.
> 98456
> 98457
> 9845
> 9846
> 984
> 985
> 98
> 99
> and if I query on 98456 the result must be 98456,
> However
see my idea, is it
worth it, do you know any better way to store trees in sql?
best regards
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
Mój Boże, spraw abym milczał, dopóki się nie upewni
in my queue because the MTA (correctly) refuses to process
> some of the bogus things that users enter by mistake.
you might want to check:
ftp://ftp.cpan.org/CPAN/authors/Tom_Christiansen/scripts/ckaddr.gz
since this is in pure perl, making a pl/perl function should be pretty
simple.
depesz
--
table;
should work the way you want it.
anyway, i belive that making this:
select field_group, field, count(*) from table where field in
('D','R','X') group by field_group, field;
and then processing results in client application, should be a little
bit
to make another database (with another
postmaster process), but this is definetly not easy way.
any other options?
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
najwspanialszą rzeczą
ert or update when something occurs?
depesz
--
hubert depesz lubaczewski
najwspanialszą rzeczą jaką dało nam nowoczesne społeczeństwo,
jest niesamowita wręcz łatwość unikania kontaktów z nim ...
QUE AS '
BEGIN
IF NEW.active=''t''::bool and OLD.active=''f''::bool THEN
UPDATE groups SET active=''t''::bool WHERE id=NEW.group_id;
END IF;
RETURN NEW;
END;
' LANGUAGE 'plpgsql';
CREATE TRIG
m in
(190) and rep.a = dir.u;
this should (i guess) work perfectly
depesz
--
hubert depesz lubaczewski
najwspanialszą rzeczą jaką dało nam nowoczesne społeczeństwo,
jest niesamowita wręcz łatwość unikania kontaktów z nim ...
d be a better/faster way to do it.
my tables have primary keys, foreign key (groups.id <=> g_order.group_id),
indices.
any idea how to write a better select to do what i need? or maybe the one i
wrote is the best one?
depesz
--
hubert depesz lubaczewski
epesz
--
hubert depesz lubaczewski
najwspanialszą rzeczą jaką dało nam nowoczesne społeczeństwo,
some kind of
time penalty. I'm wondering how much it is.
regards,
depesz
--
hubert depesz lubaczewski
najwspanialszą rzeczą jaką dało nam nowoczesne społeczeństwo,
jest niesamowita wręcz łatwość uni
gt; within a select I can make a query from mulitple databases. ( the usual
> DB.Table or DB:table or DB@table dont seem to work)
don't know how informix works, but why dont you just use a view?
create view synonym as select * from table;
am i missing something?
depesz
--
huber
n doesn't work
i tried escaping of it like
\], \\]
or even
\\\]
but none of these worked.
right now i'm using comparison:
where substring (...) = '...' and it works even with those "]" signs.
but i'm just wondering why like ']
34 matches
Mail list logo