or even
select m from generate_series( '20121101'::date, '20130101'::date, '1
month'::interval) m;
On Tue, Jan 22, 2013 at 3:49 PM, jan zimmek wrote:
> hi andreas,
>
> this might give you an idea how to generate series of dates (or other
> datatypes):
>
> select g, (current_date + (g||' month
On Tue, Feb 28, 2012 at 9:50 AM, Rehan Saleem wrote:
> hi ,
> how can i convert this sql store procedure to postgresql function , i shall
> be very thankful to you, as i am new to postgresql and i dont know how to
> handle this kind of store procedure in postgresql
Most people handle this with u
At 2012-02-20 15:50, Andreas wrote:
Hi,
is there a way to split up phone numbers?
I know that's a tricky topic and it depends on the national phone
number format.
I'm especially interested in a solution for Germany, Swizerland and
Austria.
I've got everything in a phone number column that mak
On Tue, Jan 17, 2012 at 7:54 AM, Feike Steenbergen
wrote:
> I have the following setup:
>
> A table called hand:
>
>
> Table "stage.hand_meta"
> Column | Type |
> Modifiers
> ---+--+--
2011/12/27 Maurício Cruz :
>
> I need to execute it after the postgreSQL started service.
OK, so the method I described should be good for you.
The script could be put in Task Scheduler every 15 minutes, or minimal
delay that is acceptable.
It can be written in windos batch language, or Perl, or P
2011/12/27 Maurício Cruz :
> Hi all,
>
> I need to execute some rotines on windows every time that postgreSQL is
> start at the server machine,
before it's started or just after it's started?
> I was thinking to create a PL/PGSQL to call this executable, or something
> like...
there are no trigg
If you use btrsort(column) from the example, you can just create a
functional index on this expression.
CREATE INDEX mytable_column_btrsort_idx ON mytable( btrsort(column) );
this can help.
2011/12/17 Richard Klingler :
> Morning...
>
> What is the fastest way to achieve natural ordering fro
2011/11/29 Muiz :
> I write a function to execute a sql string. E.g. "update tableA set
> field1='abc' where name='123'; deletee from tableB where id=333;"
> The following is my function:
> ---
W dniu 22 września 2011 08:11 użytkownik Amar Dhole napisał:
> **
>
> Hi Filip,
>
> ** **
>
> No not sure 100% when this can happen. This approach will not be possible
> as in our application we are programmatically handling these cases and going
> in other route to add the record with increas
2011/9/22 Asli Akarsakarya
>
> I want to get the extensions of spatial table. Say that there is a spatial
> table named 'roads', and a some road geometry inside. I want to fetch the
> bounding box (envelope or extension) for that table, that means for all the
> roads that it has.
>
> Accordin
2011/9/22 Brian Sherwood
>
> select (xpath('/chassis-inventory/chassis/serial-number/text()',
>data_xml,
>ARRAY[ARRAY['junos',
> 'http://xml.juniper.net/junos/9.6R4/junos-chassis']]
> )) from xml_test;
>
> Can anyone suggest how I would go about getting the serial-number wit
Hi
There is no IGNORE_DUP_KEY equivalent in PostgreSQL.
If you are 100% sure that you want to ignore unique key violations, you can
wrap your INSERT code in PL/PgSQL block and handle the exception yourself.
I mean:
DO $$
BEGIN
INSERT INTO foo (bar,baz) SELECT 42, 666;
EXCEPTION WHEN unique_vio
2011/1/24 victor katemana :
> hi everyone, i have a problem of loosing data in my postgres database
> whenever i restart my machine what could be the possible problem help me
> out?
can you please adjust your question to this
http://wiki.postgresql.org/wiki/Guide_to_reporting_problems
How exactl
2011/1/11 Amar Dhole
> Hi,
> I need helping converting following db2 function in postgresql function.
> Any pointer will be great help in proceeding me ahead.
>
> CREATE FUNCTION in_liststring ( string CLOB(64K) )
> RETURNS TABLE ( ordinal INTEGER, index INTEGER )
> LANGUAGE SQL
> DETERMINI
2010/12/16 serviciotdf
> Hello,
>
> I have a Function in PL/pgSQL and I need to translate it to SQL92, but I'm
> stuck.
>
> ###
> CREATE OR REPLACE FUNCTION pruebas(varchar, varchar, integer)
> RETURNS SETOF personal AS
> $delimiter$
> BEGIN
> PERFORM id from documentos WHERE descripcion = $1;
>
try
select zip, count(distinct id) from customer_service_date group by zip;
2010/12/14 Lee Hachadoorian
> Hello,
>
> I'm trying to count customers who have received services by ZIP code,
> but I want to count each customer only once even though customers may
> have received services on multiple
| 0/1 | {0,1}
eth0/10 | eth | 0/10 | {0,10}
eth1 | eth | 1 | {1}
GigabitEthernet1/0/2 | GigabitEthernet | 1/0/2| {1,0,2}
GigabitEthernet1/0/20 | GigabitEthernet | 1/0/20 | {1,0,20}
irb.
ntheses.
>
> that is
> 1
> 2
> 3
>
>
> Thank You
> Nicholas I
>
>
--
Filip Rembiałkowski
JID,mailto:filip.rembialkow...@gmail.com
http://filip.rembialkowski.net/
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
_has_option opt join
role_inherits_role inh on inh.parent_role_fk = opt.role_fk where
inh.child_role_fk = 2
?
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
--
Filip Rembiałkowski
JID,mailto:filip.rembialkow...@gmail.com
http://filip.rembialkowski.net/
With plain SQL, no.
With a user defined function in PL/PgSQL, yes.
>
>
> --
> Ivan Sergio Borgonovo
> http://www.webthatworks.it
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.post
+ interval '1
> days')
> order by esid, track_time
>)
> and th.aid='someaid'
> and th.track_time between
> ('2009-12-01'::timestamp)
>and
> ('2009-12-01'::timestamp + interval '1 months
ecompress(compressed_data) LIKE 'whatever'
???
of course it will be a great penalty.
I assume we're pretty much on our own to prevent such actions (i.e. the app
> can never query against this column via sql).
certainly.
--
Filip Rembiałkowski
JID,mailto:filip.rembialkow...@gmail.com
http://filip.rembialkowski.net/
u want.
why not just something like
SELECT EXTRACT( week from statistics_date ) as week, SUM(
total_duration) as total_duration_sum
FROM statistics_daily GROUP BY 1;
?
--
Filip Rembiałkowski
JID,mailto:filip.rembialkow...@gmail.com
http://filip.rembialkowski.net/
EGATE syntax, maybe you need something fancy here
);
-- and finally:
SELECT
location,
min(lowest_temp) as lowest_overall_temp,
agg_varbit_concat(location_bit_data) as overall_location_bit_data
FROM temp;
--
Filip Rembiałkowski
:36 PG_VERSION
> drwx-- 3 postgres postgres 4096 2008-09-06 00:36 pg_xlog
> -rw--- 1 postgres postgres 15336 2008-09-06 00:36 postgresql.conf
> -rw--- 1 postgres postgres49 2008-09-08 21:44 postmaster.opts
> -rw--- 1 postgres postgres46 2008-09-08 21:44 postmaster.pid
2'];
>
select * from test where test.col <> ALL ( ARRAY['val1', 'val2'] );
see http://www.postgresql.org/docs/current/static/functions-comparisons.html
be careful with NULLs in this type of comparisons.
--
Filip Rembiałkowski
--
Sent via pgsql-sql
lation on remote databases, you have no problem.
Any changes made to remote databases, for example if you call some
dblink functions, are not transactional, and will not be rolled back.
In this case you have to rethink your design, as there is no "ON
COMMIT" trigger (yet?)
erver - replace binaries - start servar )
Detrailed upgrade procedures are described either in manual or
somewhere on the net.
cheers
--
Filip Rembiałkowski
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire t
2007/10/3, Dawid Kuroczko <[EMAIL PROTECTED]>:
> CREATE TABLE rx_check (
> rx text CHECK ('' ~ rx IN ('t','f'))
> );
wow. This is beautiful :)
---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster
);
create aggregate first ( numeric ) ( SFUNC = first, STYPE = numeric );
select
rating_group(rating),
count(*) as num_ratings,
first(item_id) as best_rated_item_id,
first(rating) as best_rating
from ( select * from rating order by rating desc ) ordered_ratings
group by rating_group
order by rating_group desc;
note: if you can, get rid of null ratings. what are they supposed to
mean? they make things a bit more complicated.
--
Filip Rembiałkowski
---(end of broadcast)---
TIP 6: explain analyze is your friend
30 matches
Mail list logo