t; in front of that
> to see what gets printed:
>
> $ echo pg_dump -d postgres -t "\"Statuses\""
> pg_dump -d postgres -t "Statuses"
Hello,
Have you checked if the problem is limited to pg_dump ?
Maybe you're facing a trivial mistake, like a space in the
as (select 1::int x),
j as (select 1::int x)
select
max(x) from (select x from i union all select x from j) b;
---
ERROR: could not find plan for CTE "i"
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
rows as text,but
in their (default) csv representation:
select to_csv((c.*)) from foo c;
regards,
Marc Mamin
>From: pgsql-general-ow...@postgresql.org
>[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Marc Mamin
>Sent: Montag, 23. Mai 2016 16:03
>To: pgsql-general@postgresql.org
>Subject: [GENERAL] revert function for to_json ?
>
>Hello,
>
>I'm looking for
Hello,
I'm looking for $subject
example:
how to revert
select to_json(E'a\n''b'::text)
I can achieve it with something like this:
select
json_extract_path_text(('{"a":'||to_json(E'a\n''b'::text)||'}')::json,'a')
does anybody knows a less ugly solution ?
regards,
Marc Mamin
What counts are the data and how they are arranged within the DB.
Therefore they should put more focus on them, rather then think in OOM.
That book is a great idea. A collection of bad code example and the SQL
equivalents, strengthend with runtimes figures, may help move some minds
best regards
emented
that solution...
something like
db_link_send_query('conn0', 'CREATE UNLOGGED TABLE my_result...
db_link_send_query('conn1', 'INSERT INTO my_result statement based on
partitioning field');
db_link_send_query('conn2', 'INSERT INTO my_res
Hello,
if you are using pgjdbc, there is a discussion about adding an option to modify
this behavior:
https://github.com/pgjdbc/pgjdbc/issues/423
This would simplify the migration of java projects, e.g. from oracle to
postgres.
regards,
Marc Mamin
From: pgsql-general-ow
cte as (select ..),
tmp as ( INSERT INTO result2 select ... from cte),
SELECT ... from cte;
query_2:
select * from result2;
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
d_lab_tests_siui,
id_lab_tests_groups, valid_from, id_lab_sample_types) in the index definition,
but I've never tried that and suspect the planner will also have trouble to
include such an index in the plan.
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
can try CTE Common Table Expression. It isn't possible with plpgsql :(
> Theoretically you can write C extension where SRF function can returns data
> continually.But plpgsql function using local stack and returns data as block.
> Regards
> Pavel
Thanks.
A simpler solution will be
good tutotial for a task like this ?
thanks and best regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
rrent_database())
>)
>
>SELECT regexp_replace(q,'/\*.*\*/','') as q /* strip off comments like
>this */ <-- cannot get a regex to do this
>FROM to_clean ORDER BY q
Hi,
Does this help ?
select regexp_replace(' aaa /*
x
y
z
*/ foo', '\/\
> -Original Message-
> From: Jim Nasby [mailto:jim.na...@bluetreble.com]
> Sent: Montag, 26. Oktober 2015 01:55
> To: Marc Mamin; Adrian Klaver; Chaz Yoon; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Duplicate rows during pg_dump
>
> On 10/24/15 3:15
>>remote_db=> insert into users_copy_without_indexes select * from users;
>>INSERT 0 523342
>> remote_db=> select count(1) from users_copy_without_indexes where id
>> = 123;
>> count
>>---
>> 2
>>(1 row)
>>
I would store your monthly data within a separate table.
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Von: Melvin Davidson [melvin6...@gmail.com]
Gesendet: Donnerstag, 17. September 2015 17:11
An: Marc Mamin
Cc: pgsql-general@postgresql.org
Betreff: Re: [GENERAL] clone_schema function
Thanks,
>I'm not sure why you had trouble with the REPLACE(),
t take care of the column statistic targets
(i.e. ALTER TABLE t ALTER COLUMN c SET STATISTICS n;)
regards,
Marc Mamin
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Melvin Davidson
Sent: Donnerstag, 17. September 2015 15:48
To: David
when type='A' then link end ))as ar_a,
array_not_nulls(array_agg(case when type='B' then link end ))as ar_b,
array_not_nulls(array_agg(case when type NOT IN ('A', 'B') then link end))
as ar_others
from demo
GROUP BY id
)
SELECT
id,
a_ct,
b_ct,
ar_a,
ar_b,
ar_others,
coalesce (ar_a[1], case when b_ct > 1 then ar_b[2] else ar_others[1] end ) as
link_a,
coalesce (ar_b[1], case when a_ct > 1 then ar_a[2] when a_ct = 0 then
ar_others[2] else ar_others[1] end) as link_b,
-- unused others
case when a_ct + b_ct >=2 then ar_others
else ar_others[3 - (a_ct + b_ct) : array_length(ar_others,1)]
end
||
-- unused A & B
case when has_a AND has_b then ar_a[2:a_ct] || ar_b[2:b_ct]
when a_ct > 2 then ar_a[3:a_ct]
when b_ct > 2 then ar_b[3:b_ct]
end as unused
FROM PREP
order by id
regards,
Marc Mamin
$i -lt 1000 ]; do let i++; psql -c 'select 1' ;
done; } >/dev/null
real0m11.081s
user0m0.140s
sys 0m0.208s
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http
> Marc, I am using postgres 9.4. I didn't benchmark, but intuitively the modulo
> operator will force traversing every record in table "a" 4 times, as it can't
> use an index.
Not necessarily. seq scans can be synchronized:
"This allows sequential scans of large tables to synchronize with each
ver got
analyzed.
Can this fool the query planner in a negative way ?
regards,
Marc Mamin
>> The table blocks would fall out of cache if they're never touched.
>>
>>regards, tom lane
>>
>>
>
>Sweet! Thanks Tom.
>
>
>--
M a JOIN b on a.id = b.id
WHERE a.id%4 = [0,1,2,3}
I usually avoid parallel INSERTS to avoid I/O contention and random
distribution within the target tables.
Are you monitoring the I/O activity in your tests ?
Have you tried to use only 2 parallel processes?
regards,
Marc Mamin
>(accor
> -Original Message-
> From: Tom Lane [mailto:t...@sss.pgh.pa.us]
> Sent: Mittwoch, 8. Juli 2015 15:44
> To: Marc Mamin
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Problem with ALTER TYPE, Indexes and cast
>
> Marc Mamin writes:
> > Now
7;XY' as 'month2.foo'::regtype)
Is there a way for it ?
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hello,
has anyone some insight on when we can expect a newest 9.4.x Version on RDS ?
Or knows a better forum to ask for this?
I should upgrade an application DB currently on 9.3 that might go on RDS
but I'm a bit reluctant to go only on 9.4.1 ...
regards,
Marc Mamin
e "extra"
> "rec_isins_current_attachment" btree (attachment), tablespace
> "extra"
Hello,
Are you sure that the column order of the PKs is the same in both tables?
(attachment, isin) or (isin, attachment).
When isin is at the s
combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
regards,
Marc Mamin
>
> --
> Sent via pg
> -Original Message-
> From: Michael Paquier [mailto:michael.paqu...@gmail.com]
> Sent: Mittwoch, 1. Juli 2015 07:05
> To: Marc Mamin
> Cc: Postgres General
> Subject: Re: [GENERAL] how to extract the page "address" from the ctid
>
> On Tue, Jun 30, 201
tinct myColumn) as c
FROM myTable
GROUP BY substring(ctid::text, '^.([^,]+)')
)foo
GROUP BY c order by 1 desc;
Is there a quicker way to extract the page reference from the ctid?
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresq
>>On 24 June 2015 at 14:51, Marc Mamin wrote:
>>note that the 345MB text only contains 635 lines. This might be the issue...
>There's similar issue discussed here:
>http://www.postgresql.org/message-id/6046.1353874...@sss.pgh.pa.us
>Tom did seem to accept that the
message, E'\n',
> ''))
> > FROM mytable WHERE id = -2146999703;
>
>
> no, they both yeld the same error.
>
and this fails too, which is more annoying as it looks like a bug:
SELECT replace(full_message, E'\n', '') FROM stadium_rprod.aserror
> -Original Message-
> From: Chris Mair [mailto:ch...@1006.org]
> Sent: Mittwoch, 24. Juni 2015 13:26
> To: Marc Mamin; Postgres General
> Subject: Re: [GENERAL] Counting the occurences of a substring within a
> very large text
>
> > Hello,
> >
> -Original Message-
> From: Albe Laurenz [mailto:laurenz.a...@wien.gv.at]
> Sent: Mittwoch, 24. Juni 2015 13:44
> To: Marc Mamin; Postgres General
> Subject: RE: Counting the occurences of a substring within a very large
> text
>
> Marc Mamin wrote:
> >
, 'g')
from mytable
where id =-2146999703
)foo;
ERROR: invalid memory alloc request size 1447215584
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
> -Original Message-
> From: Adrian Klaver [mailto:adrian.kla...@aklaver.com]
> Sent: Donnerstag, 11. Juni 2015 16:31
> To: Marc Mamin; 'Geoff Winkless'; Postgres General
> Subject: Re: [GENERAL] select count(*);
>
> On 06/11/2015 07:17 AM, Marc Mami
>>That's the point. * has no meaning without FROM
>But COUNT(*)
>
>does have meaning - it means "the number of rows".
which rows? :-)
> It's not counting the number of columns in the row, so postgres doesn't need
> to know what columns exist in the row to return a row count.
>Geoff
--
Sen
> > select *;
> > --
> > ERROR: SELECT * with no tables specified is not valid
> >
> > select count(*);
> >
> > 1
> >
> > Is this a must? and why 1?
>
> Hi,
>
> regarding the "why 1" part:
>
> I think that if we accept that
>
> chris=> select 'foo';
> ?column?
> -
,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
> -Original Message-
> From: Tom Lane [mailto:t...@sss.pgh.pa.us]
> Sent: Donnerstag, 4. Juni 2015 15:56
> To: Marc Mamin
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Row visibility issue with consecutive triggers,
> one being DEFERRED
>
> Marc
recall!
this self containing case works well if I call the correct functions in the
triggers :)
Marc
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Marc Mamin
> Sent: Donnerstag, 4. Juni 201
table.
Have you checked the statistics and vacuum state of the catalog tables (pg_*)
Maybe some of them haven't been analyzed yet as this is a freshly created DB.
(and with a lot of DLL statements we regularly have to call vacuum full on part
of the catalog to avoid bloating there.)
You
Hello,
The test below is running fine
but if you add the trigger push_foo_tr (uncomment)
then the exception is raised.
It seems that this additional trigger to be called at the first place
changes the deferrable status of the second one.
Is this an expected behaviour ?
regards,
Marc Mamin
Hi,
have you checked that the links in $PGDATA\pg_tblspc on the new drive are valid
?
They possibly still point to the old drive.
I guess you have to correct them per hand before starting the moved DB.
regards,
Marc Mamin
Von: pgsql-general-ow
date master_items set feedback_to_de <> 'Yes' WHERE feedback_to_de IS
DISTINCT FROM 'Yes'
depending on the column nullable.
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
5-03-16 11:05:00';
>insert into t select '2015-03-16 08:00:00','2015-03-16 11:45:00';
>insert into t select '2015-03-17 15:15:00','2015-03-18 11:45:00';
>insert into t select '2015-03-17 20:15:00','2015-03-18 11:45:00';
>in
7;,'2015-03-18 11:45:00';
insert into t select '2015-03-17 20:15:00','2015-03-18 11:45:00';
insert into t select '2015-03-17 21:15:00','2015-03-18 10:10:00';
insert into t select '2015-03-18 23:30:00','2015-03-19 01:30:00';
SELECT ser, SUM(
case when e - ser < interval '1 hour' then e-ser --end interval
when s >= ser then interval '1 hour' - (s - ser) --start interval
else interval '1 hour'
end ) as time_tot
FROM
(select e,s,
generate_series(date_trunc('hour',s), date_trunc('hour',e), '1 hour')
ser
from t
)foo
group by ser
order by 1
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
> postgres=# select concat('[', now()::date, ',', now()::date,
> ']')::daterange testrange;
There are range specific functions for this:
select daterange(now()::date, now()::date, '[]')
regards,
Marc Mamin
__
being that users are less isolated (everybody can read the catalog).
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
ed
>knowledge about Postgres, I don't think we have those in pg. Can someone
>tell me how to convert it? Thanks.
Hi,
it seems that you are looking for UPDATE RETURNING:
http://www.postgresql.org/docs/9.4/static/sql-update.html
regards,
Marc Mamin
--
Sent via pgsql-general mailing list
rying on the local time, the planner will consider all partitions, but an
additional index or constraint on this column should be sufficient as long as
your partition count remains small.
regards,
Marc Mamin
>Von: pgsql-general-ow...@postgresql.org [pgsql-general-ow...@postgresql.org]"
>im Auftrag von "David Johnston [david.g.johns...@gmail.com]
>Gesendet: Freitag, 6. Februar 2015 00:38
>An: Tim Smith
>Cc: Adrian Klaver; pgsql-general
>Betreff: Re: [GENERAL] Using row_to_json with %ROWTYPE ?
>On Thu,
end)=1 as are_friend,
count(case when c1=2 then true end) as common_friends
FROM
(
SELECT count(*) as c1
FROM friends
WHERE user_id IN (USER1, USER2)
GROUP BY case when user_id = USER2 then USER1 else USER1 end,
friend_id
HAVING COUNT (*) =2
OR COUNT(case when friend_id =USER1 then true end)=1
) q1
regards,
Marc Mamin
HAVING COUNT (*) =2
OR COUNT(case when friend_id =USER1 then true end)=1
) q1
regards,
Marc Mamin
the end I'm not sure if multiple threads will help here.
I'm using this approach in aggregations which are more cpu intensive than a
simple distinct.
I'm looking forward to see your tests results :)
Marc Mamin
>
>Daniel
>
>-Original Message-
>
ld use a shared full table scan on oldtable.
HTH
Marc Mamin
>
>Best regards,
>Daniel
>
>-Original Message-
>From: pgsql-general-ow...@postgresql.org
>[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Tom Lane
>Sent: December-08-14 21:52
>To: Scott Mar
ou may check how up to date your statistics are
and try to raise the statistic target on the column resource_2_tag.tag_id.
Also try a CTE form for your query:
WITH A as (SELECT DISTINCT id FROM resource
WHERE resource_attribute1_id = 614
)
SELECT
resource_2_tag.tag_id AS resource_2_tag_tag_id,
count(resource_2_tag.tag_id) AS counted
FROM
resource_2_tag
JOIN A ON A.id = resource_2_tag.resource_id
ORDER BY counted DESC
LIMIT 25;
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
> -Original Message-
> From: Michael Paquier [mailto:michael.paqu...@gmail.com]
> On Mon, Aug 25, 2014 at 7:48 PM, Marc Mamin
> wrote:
> > Hello,
> >
> > When different sessions create temp tables with the same name:
> > How can I identify the oid o
Hello,
When different sessions create temp tables with the same name:
How can I identify the oid of the one created within the current session ?
Thanks,
Marc Mamin
= '428842195.338828'
And as it now looks like a number, maybe go a step further depending on which
patterns these SpawnID can have.
This given value can for example be stored as 2 int4 or one int8:
('428842195.338828'::numeric * 100)::int8
On the other hand this will only addre
kes sense in your context, but something like this could do
the job:
WITH SEL AS ( Your Query)
SELECT * FROM SEL
UNION ALL
SELECT 'nothing found' WHERE NOT EXISTS ( select * from sel);
regards,
Marc Mamin
OP
EXECUTE 'select exists (select * from public.'||rec.tablename||')' into
test;
IF test THEN raise notice 'COPY public.% TO
%.dump',rec.tablename,rec.tablename;
END IF;
END LOOP;
END;
$$ language plpgsql
regards,
Marc Mamin
cost of detoasting seems to often be
underestimated.
For the case when one of your 3 first columns has a very low cardinality, you
may consider adding some partial indexes.
e.g.:
create INDEX idx_the_geom_gist_general USING gist (the_geom) where class
='general';
create INDEX idx_
nect using the IP instead of "localhost" ?
regards,
Marc Mamin
>
> Thanks for helping.
>
> Regards,
> basti
>
> Am 15.07.2014 16:46, schrieb Adrian Klaver:
> > On 07/15/2014 07:17 AM, basti wrote:
> >> Hello Adrian,
> >>
> >> Ye
> -Original Message-
> From: Pujol Mathieu [mailto:mathieu.pu...@realfusio.com]
> Sent: Dienstag, 15. Juli 2014 08:40
> To: Marc Mamin
> Subject: Re: [GENERAL] operator is not unique: smallint[] @>
> smallint[] You might need to add explicit type casts (!)
>
elem; rangesel; contjoinsel
@>; 11;10; b; f; f; 3831; 3831; 16; 3892; 0; range_contains;
rangesel; contjoinsel
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
>On 04/19/2014 06:26 AM, Ron Pasch wrote:
>> > - It should be possible to search for products and provide properties
>> > that the product SHOULD have, not must have.
>>>
>>> I don't understand this. Say you have a sprocket in red and green. Do you
>>> want to search for:
>>>
>>> select * from
Hi,
Seems that this blog post is worth reading in your case
http://hlinnaka.iki.fi/2014/03/28/gin-as-a-substitute-for-bitmap-indexes/
regards,
Marc Mamin
Von: pgsql-general-ow...@postgresql.org
[pgsql-general-ow...@postgresql.org]" im Auftrag von &
ion myescape(a anyelement, OUT escaped text) as $$
..
select case when typeof(a) = then
when typeof(a) = then
when typeof(a) = then
when typeof(a) = then
..
regards,
Marc Mamin
;$libdir/hello.so"
> ERROR: could not access file "$libdir/hello.so": No such file or
> directory
>
> many thanks,
>
> Marc Mamin
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To
> make changes to your subscription:
>
cess file "$libdir/hello.so": No such file or directory
many thanks,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
>Marc Mamin-2 wrote
>> I would misuse GUC variables for this.
>> (using the functions current_setting and set_config)
>>
>> define a set get and switch fuction (I use operators for better
>> readability)
>> something like:
>>
>> select
et get and switch fuction (I use operators for better readability)
something like:
select 'a' ==> 'foo'
'a'
select 'b' <==> 'foo'
'a'
select <== 'foo'
'b'
and in your query:
SELECT
case when test then col <==> 'foo' else <== 'foo' end
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
> From: Peter Eisentraut [mailto:pete...@gmx.net]
> On 10/25/13, 7:20 AM, Marc Mamin wrote:
> > Hello,
> >
> > I'm evaluating pg_upgrade and there seems to be something wrong with
> my test:
> > the data get copied within the old data directory instead o
;
=>
ll /data/postgresql-data-9/tblspc_data/cicpg_logs/
drwx-- 3 isdb9 isgrp9 4096 Oct 21 15:48 PG_9.1_201105231
drwx-- 3 isdb9 isgrp9 4096 Oct 25 12:26 PG_9.3_201306121
thanks,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscr
> Hey dear lists,
> Here is a self contained example showing strange behavior from a real life
> example concerning the use of postgis_topology topogeometry type.
>
>
> The problem is :
> when trying to return setof topogeometry,
> the "return query" gives an error of type where there is none, a
result */ )
AT TIME ZONE 'Europe/Nicosia') || ' 00:00 Europe/Nicosia' as
timestamptz))
-
1382821200 /* = day_start*/
)/3600 as hour_duration
=> 25 hours, which is correct as the daylight saving time ends at this date
regards,
Marc Mamin
lin
Hi,
an alternate syntax which is nearer to the INSERT one:
update foo set (a,b) = (bar.a, bar.b)
FROM bar
WHERE foo.id = bar.id;
I guess this is just a question of taste...
regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
> Von: Merlin Moncure [mmonc...@gmail.com]
> Gesendet: Freitag, 20. September 2013 17:43
>
> > On Fri, Sep 20, 2013 at 10:26 AM, Marc Mamin wrote:
> > Hi,
> > here is a function which is about 8 x faster than the one described in the
> > PostgreSQL SQL Tri
.
urldecode_arr:
Seq Scan on lt_referrer (actual time=1.966..17623.979 rows=65717 loops=1)
urldecode:
Seq Scan on lt_referrer (actual time=4.846..15.292 rows=65717 loops=1)
regards,
Marc Mamin
CREATE OR REPLACE FUNCTION urldecode_arr(url text)
RETURNS text AS
$BODY$
DECLARE ret text;
BEGIN
Hi,
"this is not an elephant"
(to fake Magritt)
http://enculturation.gmu.edu/3_2/images/magritte1.jpg
or an elephant breast-feeding its babies to illustrate replication.
but better ask someone else for the painting ;-)
regards,
Marc Mamin
> -Original Message-
> Fro
hi,
in addition to the others comments, you can also remove " ELSE 0 " from your
query.
It will result in values that are discarded by SUM.
regards,
Marc Mamin
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of jane...@web.de
Sent:
port function
>would be sufficient for me.
Hello,
Have a look at pghashlib:
https://github.com/markokr/pghashlib
regards,
Marc Mamin
2 as a,
3 as b
)
select * from t1 WHERE b =0
ERROR: column reference "b" is ambiguous.
It would be nice, if extra undeclared columns would not be visible outside the
CTE.
regards,
Marc Mamin
time
zone.
The function below works, but is slow.
Any way to build an equivalent function with better performances ?
Thanks,
Marc Mamin
CREATE FUNCTION houroffset_to_daystart (p_houroffset int, p_tz varchar) returns
int AS
$$
DECLARE daystart int;
BEGIN
EXECUTE 'select EXTRACT ('
pg_logs', t)).* FROM
get_modeltablelist('efeeds') t
^ ^
Marc
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Marc Mamin
Sent: Freitag, 1. März 2013 13:51
To: pgsql-general@postgresql.org
Subject: [
pends
-
(TR,_efm_sequences,_efm_sequences_tr)
(TR,_emr_reportlist,_emr_reportlist_tr)
(TR,_efm_models,_efm_models_del_tr)
regards,
Marc Mamin
I've rechecked it on Postgres 9.2 and the issue seems to be fixed by now
:-)
sorry for the spam.
Marc
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Marc Mamin
> Sent: Montag, 1. Oktober 2012
the clause "WHERE sid IS NOT NULL and ua IS NULL"
It is quite evident that the second index is better as it allows to
resolve the 2 conditions of the queries,
but this seems to be an issue for the planner that prefers the first
index
beat regards,
Marc Mamin
create table ptes
ew
this may be seen as a nice hint, but in my own opinion
DROP ... IF EXISTS should not throw an error for objects that do not
exist.
A warning would be better here.
This would allow such a code to be error proof:
...
drop table if exists foo;
drop view if exists foo;
...
best regards,
Marc Mamin
Hello,
I had a similar question some time ago, with an answer by Tom lane:
http://archives.postgresql.org/pgsql-general/2012-03/msg00023.php
best regards,
Marc Mamin
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Sahagian
oops,
> and then call your function with the values 1..15 (when using 16
it should of course be 0..15
Marc Mamin
> -Original Message-
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Marc Mamin
> Sent: Donnerstag,
WHERE id % 16 = slice
or:
WHERE hashtext(id::text) % 16 = slice
...
and then call your function with the values 1..15 (when using 16 slices)
Use a power of 2 for the number of slices.
It may be faster to use many slices and
this allows to do the job in parallel on a few threads.
hello,
agree about this great feature :)
There is another point I've wondered about:
Is there some logical reason why no function width(range) was added to the
bundle ?
not a big deal, but width(range) looks just nicer than upper(range)-lower(range)
best regards,
Marc Mamin
-Ori
o b;
alter table test rename _b to a;
select * from test;
\d+ test
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
great,
many thanks for the excellent blog entry.
Marc Mamin
> -Original Message-
> From: dep...@depesz.com [mailto:dep...@depesz.com]
> Sent: Freitag, 13. Juli 2012 12:52
> To: Marc Mamin
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] WITH RECURSIVE qu
FROM forest JOIN struc ON parent=struc.id
)
SELECT * FROM struc
)one_tree
;
1 1
\... 2 2
\...... 3 3
4 1
\... 5 2
\.. 6 3
best regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
.
Would an extension of the foreign keys declaration like following make
sense, or does it too much break SQL standards ?
best regards,
Marc Mamin
create temp table t (
a int,
b int,
constraint t_pk primary key (a, b)
);
create unique index t_partial on t (a) where b=5;
create temp table f
IAL NOT NULL ,
...
with serial as data type, a sequence will be built for you in the
backgroud.
2nd:
in COPY you can list the the columns of the csv content:
COPY Anlagenregister_Aktuell_2011 (firma, anlagenschluessel, ...) FROM
As fid is not listed here, it will be filled by its default value
(sequence).
best regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hello,
Is it possible to find out the (list of) function oids from a function
call?
e.g. select MYFUNC('foo', 1234)
=> someting like
select * from get_function_oids($$MYFUNC('foo', 1234)$$)
best regards,
Marc Mamin
--
Sent via pgsql-general mailing list (pgsql
1 - 100 of 156 matches
Mail list logo