Re: [GENERAL] count distinct and group by

2015-05-07 Thread Szymon Guz
On 7 May 2015 at 12:39, Magnus Hagander wrote: > On Thu, May 7, 2015 at 12:23 PM, Szymon Guz wrote: > >> Hi, >> I'm not sure why there is a reason for such behaviour. >> >> For this table: >> >> create table bg(id serial primary key, t text); &

[GENERAL] count distinct and group by

2015-05-07 Thread Szymon Guz
Hi, I'm not sure why there is a reason for such behaviour. For this table: create table bg(id serial primary key, t text); This works: select count(id) from bg; This works: select count(distinct id) from bg; And this doesn't: select count(distinct id) from bg order by id; ERROR: column "bg

Re: [GENERAL] Building JSON objects

2015-03-27 Thread Szymon Guz
On 27 March 2015 at 19:12, Eli Murray wrote: > I'm running psql --version 9.4.1 > > Also, it may be worth noting that rawdata.deptname and rawdata.deptcode > are both text data types. > > The errors I'm getting are: > > ERROR: syntax error at or near "json_build_object" > LINE 1: insert into jso

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-19 Thread Szymon Guz
On 19 September 2014 10:19, cowwoc wrote: > I am beginning to feel like people are putting words in my mouth :) > > I agree with most of what you said. I will only comment on the differences: > > There is nothing special in java, that's just another language like perl, > python and tcl. I don't

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-19 Thread Szymon Guz
On 18 September 2014 22:58, cowwoc wrote: Hi, I'm observing the whole discussion, and I really don't like the idea of adding everything to the core. I fully agree that the core should be small, as small as possible. The way it works now is that it provides interfaces to the external languages li

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-18 Thread Szymon Guz
On 18 September 2014 18:54, John R Pierce wrote: > On 9/18/2014 9:07 AM, cowwoc wrote: > >> You are confusing a private JRE installation with the public JRE >> installation (yes, there is such a thing). The public JRE is found in >> java/jre8. The private JRE is found in java/jdk1.8.0_20/jre. >>

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-18 Thread Szymon Guz
On 18 September 2014 17:32, John R Pierce wrote: > On 9/18/2014 6:18 AM, David G Johnston wrote: > >> What distributions of JRE are available on the Windows platform and which >> ones are allowed to be "privately distributed"? >> > > afaik, Sun/Oracle is /the/ Java for Windows, and AFAIK, it does

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread Szymon Guz
On 18 September 2014 16:06, David Rysdam wrote: > I've got a some tables with bytea fields that I want to export only the > binary data to files. (Each field has a gzipped data file.) > > I really want to avoid adding overhead to my project by writing a > special program to do this, so I'm trying

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-16 Thread Szymon Guz
On 16 September 2014 03:07, David G Johnston wrote: > cowwoc wrote > > On 15/09/2014 2:02 PM, lup [via PostgreSQL] wrote: > >> On 09/15/2014 11:49 AM, cowwoc wrote: > >>> I think developers choosing this route (myself included) are willing > >>> to pay the price in exchange for improved readabili

Re: [GENERAL] Why isn't Java support part of Postgresql core?

2014-09-15 Thread Szymon Guz
On 15 September 2014 20:13, cowwoc wrote: On 15/09/2014 2:12 PM, cowwoc wrote: > > On 15/09/2014 2:02 PM, lup [via PostgreSQL] wrote: > > On 09/15/2014 11:49 AM, cowwoc wrote: > > I think developers choosing this route (myself included) are willing to > pay the price in exchange for improved read

Re: [GENERAL] || operator

2014-09-03 Thread Szymon Guz
On 3 September 2014 15:20, Pavel Stehule wrote: > Hi > > you can define || operator for char(N) type > > postgres=# select oprname, oprleft::regtype, oprright::regtype from > pg_operator where oprname = '||' > ; > oprname | oprleft | oprright > -+-+- > ||

Re: [GENERAL] list of index

2014-08-15 Thread Szymon Guz
On 15 August 2014 16:23, FarjadFarid(ChkNet) wrote: > Hi , > > > > On a Postgresql database i like to obtain (using an sql statement) the > list of all user defined indexes and their details specially the column > "order by" sort order. e.g. ASC or DESC. Any help would be much > appreciated. > >

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Szymon Guz
And then to check the employees who have completed 5 or 10 years, you'll > just do: > >select * from vw_employee > > > This is done off the top of my head so there will likely be syntax errors, > but I hope this can give you a general idea. > > > - Rebecca >

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Szymon Guz
On 30 June 2014 12:38, Arup Rakshit wrote: > I have employee table. Where I have a column joining_date. Now I am > looking for a way to get all employee, who completed 5 years, 10 years > current month. How to do so ? I am not able to figure this out. > > Regards, > Arup Rakshit > Hi, take a loo

Re: [GENERAL] break table into portions for writing to separate files

2014-05-01 Thread Szymon Guz
On 1 May 2014 22:50, Seb wrote: > On Thu, 1 May 2014 22:31:46 +0200, > Szymon Guz wrote: > > [...] > > > Can you show us the query plan for the queries you are using, the view > > definition, and how you query that view? > > Thanks for your help with this. He

Re: [GENERAL] break table into portions for writing to separate files

2014-05-01 Thread Szymon Guz
On 1 May 2014 22:24, Seb wrote: > On Thu, 1 May 2014 22:17:24 +0200, > Szymon Guz wrote: > > > On 1 May 2014 21:01, Seb wrote: > > On Thu, 1 May 2014 20:22:26 +0200, > > Szymon Guz wrote: > > >> Hi, several Gb is about 1GB, that's not

Re: [GENERAL] break table into portions for writing to separate files

2014-05-01 Thread Szymon Guz
On 1 May 2014 21:01, Seb wrote: > On Thu, 1 May 2014 20:22:26 +0200, > Szymon Guz wrote: > > > Hi, several Gb is about 1GB, that's not too much. In case you meant > > 'several GB', that shouldn't be a problem as well. > > Sorry, I meant seve

Re: [GENERAL] break table into portions for writing to separate files

2014-05-01 Thread Szymon Guz
Hi, several Gb is about 1GB, that's not too much. In case you meant 'several GB', that shouldn't be a problem as well. The first thing I'd do would be creating an index on the column used for dividing the data. Then I'd just use the command COPY with a proper select to save the data to a file. If

Re: [GENERAL] DB Authentication Design

2014-01-12 Thread Szymon Guz
On 12 January 2014 15:30, François Beausoleil wrote: > Hi all, > > I'm thinking that all apps that connect to the database should have their > own user. For example, the web application process is one user, then a > report builder process should have another user, and a different process > that i

Re: [GENERAL] Is there a way to return "true"/"false" string for boolean type?

2014-01-07 Thread Szymon Guz
On 7 January 2014 19:11, ChoonSoo Park wrote: > Hello Gurus, > > I have several tables with lots of boolean columns. > When I run select query for the tables, I always get 't' or 'f' for > boolean types. > > Is there a way to return 'true' or 'false' string for boolean type except > using CASE WH

Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
On 11 December 2013 15:35, Peter Kroon wrote: > Perhaps creating a temporary table would be more efficient. > Then the rollback isn't necessary. > > > Yep, but only if you're sure that you don't have queries which change other parts of the database, including calling procedures which could change

Re: [GENERAL] validate synatax

2013-12-11 Thread Szymon Guz
ill make the server very active because it is > executing the SQL. > > Yes, the SQL should be tested even if the syntax is correct. > > So 2 things to look for: > - Syntax validator > - Check query logic, like does the table exist > > Best, > Peter > > > 2013/1

Re: [GENERAL] validate synatax

2013-12-10 Thread Szymon Guz
On 10 December 2013 22:40, Peter Kroon wrote: > Hi, > > How can I validate any query on PostgreSQL without executing the sql. > I was able with EXPLAIN to find some errors. However this only worked with > a SELECT statement. When i tried to create a TABLE it would not run. > I do not wish to inst

Re: [GENERAL] pg_dump of only range of tables

2013-10-28 Thread Szymon Guz
On 28 October 2013 22:27, Robert James wrote: > Is there any way to do a pg_dump (or equivalent) of only part of a > table? Say I want to send data to someone for only part of the table > (expressable with a WHERE clause). > > > > Hi, you can use COPY or \COPY for that: http://www.postgresql.org/

Re: [GENERAL] no syntax error on limit1

2013-10-09 Thread Szymon Guz
On 9 October 2013 14:24, Willy-Bas Loos wrote: > Hi, > > Postgres 9.1.9 gives me no syntax error on this, but all the records: > with a as (values > (1),(2),(3)) > select * > from a > limit1 > > Hi, that's quite OK. The "limit1" is just an alias for the table "a" Szymon

Re: [GENERAL] Failed to autoconvert '1' to text.

2013-09-06 Thread Szymon Guz
On 6 September 2013 10:33, Richard Huxton wrote: > On 06/09/13 09:13, Szymon Guz wrote: > >> Hi, >> why isn't 'aa' always treated as string? >> > > with x as ( >>select >>'1' a, >>'2' b >> )

[GENERAL] Failed to autoconvert '1' to text.

2013-09-06 Thread Szymon Guz
Hi, why isn't 'aa' always treated as string? While testing function for levenshtein distance I've noticed that: with x as ( select '1' a, '2' b ) SELECT levenshtein(a, b), length(a) FROM x; ERROR: failed to find conversion function from unknown to text with x as ( select '1'::TEXT a,

Re: [GENERAL] Levenshtein Distance with more than 255 characters

2013-09-06 Thread Szymon Guz
On 6 September 2013 08:47, Tom Lane wrote: > Szymon Guz writes: > > On 6 September 2013 01:00, Janek Sendrowski wrote: > >> I'm searching for an optimized Levenshtein Distance like Postgresql's. > My > >> problem is that I want to compare strings with a

Re: [GENERAL] Levenshtein Distance with more than 255 characters

2013-09-05 Thread Szymon Guz
On 6 September 2013 01:00, Janek Sendrowski wrote: > Hi, > > I'm searching for an optimized Levenshtein Distance like Postgresql's. My > problem is that I want to compare strings with a length over 255 characters. > Does anyone know a solution? > > Janek Sendrowski > Hi, I'm not sure there is a

Re: [GENERAL] 2 postgresql server on the same station : conflict?

2013-05-28 Thread Szymon Guz
On 28 May 2013 11:57, image wrote: > Hello, > > On the same station, i have 2 postgresql server: one for my postgis db > (v9.1) and so another installed with opener^7 (9.2). Unfortunalty, i > noticed > i'm obliged to stop service for my postgresql postgis (9.1) in order to use > openerp7 (postgre

Re: [GENERAL] Random numbers

2013-05-25 Thread Szymon Guz
On 25 May 2013 18:14, Karel Riveron Escobar wrote: > How would be if I would want to generate values among 3 and 5? > > > Hi Karel, try something like: SELECT floor(3 + random()*(5-3+1))::INT Or generally: CREATE OR REPLACE FUNCTION random_range(INTEGER, INTEGER) RETURNS INTEGER AS $$ SELEC

Re: [GENERAL] Random numbers

2013-05-25 Thread Szymon Guz
On 25 May 2013 17:56, Ian Lawrence Barwick wrote: > 2013/5/26 bricklen : > > > > On Sat, May 25, 2013 at 8:45 AM, Karel Riveron Escobar > > wrote: > >> > >> I want to generate random numbers in Pl/pgSQL. How can I do this? > >> To be more specific, I have to generate random numbers among 0 and 5

Re: [GENERAL] how to completely disable toasted table in postgresql and best practices to follow

2013-04-05 Thread Szymon Guz
On 5 April 2013 15:49, Andres Freund wrote: > On 2013-04-05 18:32:47 +0530, Zahid Quadri wrote: > > Dear admin, > > > > please help me i want to completely disable Toasted tables in postgresql > as per your suggestion i have used 9.0.13 but still toasted tables are > getting created. > > > > also

Re: [GENERAL] Oracle to PostgreSQL transition?

2013-04-05 Thread Szymon Guz
On 4 April 2013 16:16, Roy Anderson wrote: > Hey all, > > We have a very robust Oracle and SQL Server presence at work but we're > looking to farm out some of the load to PostgreSQL to limit costs. I'm > curious if there are any DBAs out there who have gone down this route > before. Any tips, tri

Re: [GENERAL] to_number, to_char inconsistency.

2013-02-10 Thread Szymon Guz
On 10 February 2013 20:50, Jeremy Lowery wrote: > I load and dump text files with currency values in it. The decimal in > these input and output formats in implied. The V format character works > great for outputing numeric data: > > # select to_char(123.45, '999V99'); > to_char > - >

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Szymon Guz
On 11 January 2013 19:32, Kirk Wythers wrote: > > On Jan 11, 2013, at 12:18 PM, Szymon Guz wrote: > > > > > On 11 January 2013 19:13, Kirk Wythers wrote: > >> Can anyone see what I'm misisng? I am trying to run a psql "copy from" >> comman

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Szymon Guz
On 11 January 2013 19:13, Kirk Wythers wrote: > Can anyone see what I'm misisng? I am trying to run a psql "copy from" > command through a bash script to load a buch of cdv files into the same > table. I'm getting an error about the file "infile" not existing? > > #!/bin/sh > > for infile in /pat

Re: [GENERAL] DROP CASCADE

2012-09-29 Thread Szymon Guz
On 29 September 2012 18:08, Andreas wrote: > Hi > I encountered something that puzzled me a bit. > Is it expected that DROP table CASCADE drops this table and just the > foreign key constraints but not the refering tables? > > PG 9.2.1 on WinXP > > > Hi Andreas, yes, it is expected, at least acco

Re: [GENERAL] Time-based trigger

2012-09-18 Thread Szymon Guz
On 18 September 2012 17:59, Robert Sosinski wrote: > We have a table, which has items that can be put on hold of 5 minutes > (this is for an online store) once they are placed into a cart. What we > need is for this hold to automatically expire after 5 minutes. Right now, > we put a time stamp

Re: [GENERAL] lowercase on columnname using view

2012-05-08 Thread Szymon Guz
On 8 May 2012 13:00, Chrishelring wrote: > Hi all, > > had some help the other day, but now I´m kinda stuck again. :/ > > I have a table ("virksomhedsdata") with the following columns: > > "MI_STYLE" character varying(254), > "MI_PRINX" integer NOT NULL DEFAULT > nextval('rk_ois."virksomhedsdata

Re: [GENERAL] Show Databases via ODBC

2012-03-07 Thread Szymon Guz
On 7 March 2012 20:36, Bret Stern wrote: > Is it possible through ODBC to connect to a PostgreSql > server and query for the available databases? > > When our application upgrades, we typically create a > new database. I want to design a form which allows > the user to select the old database, wh

Re: [GENERAL] Why this regexp matches?!

2012-02-04 Thread Szymon Guz
On 4 February 2012 09:46, hubert depesz lubaczewski wrote: > select 'depesz depeszx depesz' ~ E'^(.*)( \\1)+$'; > > what's worse: > $ select regexp_replace( 'depesz depeszx depesz', E'^(.*)( \\1)+$', E'\\1' > ); > regexp_replace > > depesz > (1 row) > > I know that Pg regexps ar

Re: [GENERAL] Let-bindings in SQL statements

2012-01-26 Thread Szymon Guz
On 26 January 2012 15:37, Jon Smark wrote: > Hi, > > Is it possible to do the equivalent of let-bindings in a pure SQL function? > I have a SELECT that invokes "now" multiple times. It would be nicer > to do it only once and reuse the value. Something like this: > > LET right_now = SELECT now (

Re: [GENERAL] log_statement variable does not admit all value

2012-01-21 Thread Szymon Guz
On 21 January 2012 22:11, Jose Carlos Martinez Llario wrote: > Hi List, > > This variable admit according to docs: mod, ddl, all values. the all value > is not accepted. > I have postgres 9.1. > > s1=# set log_statement = all; > ERROR: syntax error at or near "all" > LINE 1: set log_statement = a

[GENERAL] question about the money type

2012-01-11 Thread Szymon Guz
Hi, in the documentation for 8.2 ( http://www.postgresql.org/docs/8.2/interactive/datatype-money.html) there is info: *Note:* The money type is deprecated. Use numeric or decimal instead, in combination with theto_char function. However in later versions the info disappeared. It doesn't exist eve

Re: [GENERAL] order of (escaped) characters in regex range

2011-12-13 Thread Szymon Guz
On 13 December 2011 14:04, InterRob wrote: > Dear List, > > I found this interesting: > > SELECT regexp_matches('123-A' , E'(3[A-Z\- ])'); > ERROR: invalid regular expression: invalid character range > > whereas: > SELECT regexp_matches('123-A' , E'(3[\- A-Z])'); > regexp_matches >

Re: [GENERAL] Very slow table

2011-12-08 Thread Szymon Guz
On 8 December 2011 06:28, Richard Weiss wrote: > Hi, I am using squeryl, which is based on jdbc, and I am trying to run the > following statement: > delete from "Entry" where ("id" = 0) > but the query never seems to finish. I have tried it in both the program I > am writing, and the above stateme

Re: [GENERAL] Weird behavior: deleted row still in index?

2011-12-04 Thread Szymon Guz
On 4 December 2011 12:32, Phoenix Kiula wrote: > Hi. > > I have deleted a row from a table. Confirmed by "SELECT". All > associated children tables don't have this key value either. > > Yet, when I insert this row back again, the primary key index on this > table gives me a duplicate error. > > A

Re: [GENERAL] tricking EXPLAIN?

2011-11-28 Thread Szymon Guz
On 28 November 2011 12:55, Wim Bertels wrote: > Hallo, > > if u compare the 2 queries, then they should be equivalent: > > -- normal > -- EXPLAIN ANALYZE > SELECT amproc, amprocnum - average AS difference > FROMpg_amproc, >(SELECT avg(amprocnum) AS average >FROMpg_amproc)

Re: [GENERAL] error when defining a search configuration named "default"

2011-11-25 Thread Szymon Guz
On 25 November 2011 14:34, robert rottermann wrote: > Hi there, > I inherited the support of a database with the ancient tsearch2. > > I uses a search configuration named "default" > > Now when I try to create such a configuration using: > CREATE TEXT SEARCH CONFIGURATION default ( > PARSER = "d

Re: [GENERAL] how could duplicate pkey exist in psql?

2011-11-17 Thread Szymon Guz
On 17 November 2011 06:19, Yan Chunlu wrote: > recently I have found several tables has exactly the same pkey, here is > the definition: > "diggcontent_data_account_pkey" PRIMARY KEY, btree (thing_id, key) > > > the data is like this: > >159292 | funnypics_link_point | 41 > >

[GENERAL] PostgreSQL Naming Rules - another question

2011-10-29 Thread Szymon Guz
Hi, according to this part of documentation: http://www.postgresql.org/docs/9.1/interactive/sql-syntax-lexical.html#SQL- SYNTAX-IDENTIFIERS if I select some names from database and sort them... which collation is used? regards Szymon

Re: [GENERAL] PostgreSQL Naming Rules

2011-10-28 Thread Szymon Guz
On 28 October 2011 12:49, Robert Buckley wrote: > > Hi, > > according to this article > http://www.informit.com/articles/article.aspx?p=409471, the naming of > tables, and fields is restricted to 63 characters and must start with an > underscore or letter. Nothing is however said about in which c

Re: [GENERAL] strange java query behaviour

2011-10-25 Thread Szymon Guz
On 25 October 2011 17:04, Marti Raudsepp wrote: > On Mon, Oct 24, 2011 at 23:23, Szymon Guz wrote: > > String query1 = "SELECT * FROM information_schema.schemata WHERE > schema_name = ?"; > > > When I query the database using psql, both queries return sensibl

[GENERAL] strange java query behaviour

2011-10-24 Thread Szymon Guz
Hi, I've got a quite strange situation. Below is a simple test @Test public void test() throws SQLException { String query1 = "SELECT * FROM information_schema.schemata WHERE schema_name = ?"; String query2 = "SELECT * FROM pg_catalog.pg_namespace where nspname = ?";

Re: [GENERAL] index bloat question

2011-10-17 Thread Szymon Guz
On 17 October 2011 15:42, Merlin Moncure wrote: > On Mon, Oct 17, 2011 at 2:15 AM, Szymon Guz wrote: > > > > > > On 17 October 2011 02:01, Scott Marlowe wrote: > >> > >> On Sun, Oct 16, 2011 at 2:41 PM, Szymon Guz wrote: > >> > Hi, > &g

Re: [GENERAL] index bloat question

2011-10-17 Thread Szymon Guz
On 17 October 2011 02:01, Scott Marlowe wrote: > On Sun, Oct 16, 2011 at 2:41 PM, Szymon Guz wrote: > > Hi, > > just a couple of questions: > > will there be an index bloat if I have: > > - a serial column and only add rows to the table? > > - a text column

[GENERAL] index bloat question

2011-10-16 Thread Szymon Guz
Hi, just a couple of questions: will there be an index bloat if I have: - a serial column and only add rows to the table? - a text column and I only add rows to the table? For the serial column the numbers are only incremented, for the text column I add random strings. regards Szymon

Re: [GENERAL] why VOLATILE attribute is required?

2011-09-22 Thread Szymon Guz
On 22 September 2011 16:29, Rafal Pietrak wrote: > On Thu, 2011-09-22 at 07:50 -0500, Merlin Moncure wrote: > > On Thu, Sep 22, 2011 at 5:28 AM, Rafal Pietrak > wrote: > > > > if you change the state of the database, including (and especially) > > system catalogs, your function is volatile, peri

Re: [GENERAL] Random multiple times

2011-09-21 Thread Szymon Guz
On 21 September 2011 20:58, Merlin Moncure wrote: > On Wed, Sep 21, 2011 at 5:43 AM, Szymon Guz wrote: > > > > > > On 21 September 2011 11:18, Szymon Guz wrote: > >> > >> > >> On 21 September 2011 10:51, Oliver Kohll - Mailing Lists > >>

Re: [GENERAL] Random multiple times

2011-09-21 Thread Szymon Guz
On 21 September 2011 11:18, Szymon Guz wrote: > > > On 21 September 2011 10:51, Oliver Kohll - Mailing Lists < > oliver.li...@gtwm.co.uk> wrote: > >> Hi, >> >> I understand random() is a volatile function and runs multiple times for >> multiple rows

Re: [GENERAL] Random multiple times

2011-09-21 Thread Szymon Guz
On 21 September 2011 10:51, Oliver Kohll - Mailing Lists < oliver.li...@gtwm.co.uk> wrote: > Hi, > > I understand random() is a volatile function and runs multiple times for > multiple rows returned by a SELECT, however is there a way of getting it to > run multiple times *within* another function

[GENERAL] not enough disk space

2011-09-20 Thread Szymon Guz
Hi, If there is not enough disk space for database during loading a lot of data (under normal db load), could the data for other databases/schemas corrupt? If yes, would that be enough to run vacuum full and reindex to make sure everything is OK with the data files, or something else? regards Szym

Re: [GENERAL] postgis and pgpool

2011-09-19 Thread Szymon Guz
On 19 September 2011 16:17, Tatsuo Ishii wrote: > > Hi, > > do you know about any problems with using pgpool and postgis together? > > I personaly don't know any case study of pgpool and posgis but I > guess: > > 1) You are using pgpool-II native replication mode > 2) Some of postgis functions ar

[GENERAL] postgis and pgpool

2011-09-19 Thread Szymon Guz
Hi, do you know about any problems with using pgpool and postgis together? regards Szymon

[GENERAL] data compression in protocol?

2011-06-22 Thread Szymon Guz
Hi, I've got a lot of databases, unfortunately applications need to get a lot of data (a lot of means too much). The whole request takes about 3s, while pure explain analyze only 250ms. The amount of downloaded data cannot be changed. I'm just wondering if I can do anything about that. Maybe there

Re: [GENERAL] Index on substring

2011-06-05 Thread Szymon Guz
2011/6/5 Håvard Wahl Kongsgård > Hi, my database performance badly on substring comparison between two very > large tables. > In postgresql 8.4 is it possible to create a index on a substring, or must > I create an new field for the substring match ( and then create a new index > for that field)?

[GENERAL] Question about configuration and SSD

2011-06-02 Thread Szymon Guz
Hi, do we need some special configuration for SSD drives, or is that enough to treat those drives normally? regards Szymon

Re: [GENERAL] question about readonly instances

2011-05-19 Thread Szymon Guz
On 19 May 2011 09:05, John R Pierce wrote: > On 05/18/11 11:39 PM, Szymon Guz wrote: > >> >> thanks for the answer. It is not a problem to have 3 oracle instances, in >> fact there will be hundreds of them probably, but could also be hundreds of >> Postgres insta

Re: [GENERAL] question about readonly instances

2011-05-18 Thread Szymon Guz
On 19 May 2011 04:08, Craig Ringer wrote: > On 05/19/2011 04:33 AM, Szymon Guz wrote: > >> >> >> On 18 May 2011 22:22, Ireneusz Pluta > <mailto:ipl...@wp.pl>> wrote: >> >>W dniu 2011-05-18 13:21, Szymon Guz pisze: >> >>

Re: [GENERAL] question about readonly instances

2011-05-18 Thread Szymon Guz
On 18 May 2011 22:22, Ireneusz Pluta wrote: > W dniu 2011-05-18 13:21, Szymon Guz pisze: > > Hi, >> I've got a question about quite a strange configuration. >> I was asked if we can have one storage, with one data directory where one >> postgresql instance write

[GENERAL] question about readonly instances

2011-05-18 Thread Szymon Guz
Hi, I've got a question about quite a strange configuration. I was asked if we can have one storage, with one data directory where one postgresql instance writes data, and many other instances read those. Is that possible without any replication and copying data? regards Szymon

Re: [GENERAL] Column names getting lower-case in SELECT statements when issued via JDBC

2011-05-15 Thread Szymon Guz
On 15 May 2011 21:04, Eduardas F. wrote: > Hello everyone, today I encountered this nasty problem: > Whenever you issue an SELECT command from JDBC (prepared statement) you end > up with column X does not exist. And column X name is shown in lower-case > As I understand, PostgreSQL Server or Post

Re: [GENERAL] Converting between varchar and float when updating

2011-04-28 Thread Szymon Guz
On 28 April 2011 11:26, Thomas Larsen Wessel wrote: > I have a table with the following schema: > CREATE TABLE foo (bar VARCHAR(32)); > > Every bar value has a format like a float, e.g. "2.5". Now I want that > value multiplied by two and saved again as varchar. I was hoping to do smth > like: >

Re: [GENERAL] why autocommit mode is slow?

2011-04-08 Thread Szymon Guz
On 8 April 2011 05:06, Scott Marlowe wrote: > On Thu, Apr 7, 2011 at 2:59 PM, Szymon Guz wrote: > > Hi, > > this is maybe a stupid question, but I don't know how to explain to my > > coworkers why performing many inserts in autocommit mode is so much > slower >

[GENERAL] why autocommit mode is slow?

2011-04-07 Thread Szymon Guz
Hi, this is maybe a stupid question, but I don't know how to explain to my coworkers why performing many inserts in autocommit mode is so much slower than making all of them in one transaction. Why is that so slow? regards Szymon

Re: [GENERAL] Protecting stored procedures

2011-04-07 Thread Szymon Guz
On 7 April 2011 14:46, Michael Gould wrote: > We want to protect the intellectual property of several of our stored > procedures. If we put them in a separate schema in the database and only > allow execute on anything in that schema would that protect our stored > procedures? > > > Protect them

Re: [GENERAL] Compare an integer to now() - interval '3 days'

2011-03-11 Thread Szymon Guz
On 11 March 2011 14:14, Alexander Farber wrote: > > # select u.uid, u.name, u.created > from drupal_field_data_field_gender g, drupal_users u > where g.field_gender_value='Robot' and > u.uid=g.entity_id and u.created::timestamp > now() - interval '1 day'; > ERROR: cannot cast type integer to tim

Re: [GENERAL] pg_catalog.pg_stat_activity and current_query

2011-03-01 Thread Szymon Guz
On 1 March 2011 09:36, Alex wrote: > Good morning, > > I'm trying to make a Postgre profiler reading > pg_catalog.pg_stat_activity. > But when I read that view... I always find my query. > > Example: > > ResultSet rs = st.executeQuery("SELECT query_start,current_query FROM > pg_catalog.pg_stat_ac

Re: [GENERAL] Website code Pl/pgsql

2011-02-26 Thread Szymon Guz
On 26 February 2011 13:05, franco egizii wrote: > Hello, > do you know some website about Pl/pgsql stored procedure , function and > other resource (example, code ecc.) ? > regards and thanks > Frank > This one is great: http://www.postgresql.org/docs/9.0/interactive/plpgsql.html regards Szymo

[GENERAL] many schemas or many databases

2011-02-08 Thread Szymon Guz
Hi, is there any noticeable difference between a cluster with many databases and a database with many schemas? I've got a quite huge database on Oracle with about 400 logically disjoint schemas. I could import that into PostgreSQL as many different databases, or as one database with many schemas.

Re: [GENERAL] UUID column as pimrary key?

2011-01-05 Thread Szymon Guz
On 6 January 2011 00:32, dennis jenkins wrote: > On Wed, Jan 5, 2011 at 1:03 PM, Bill Moran > wrote: > > > > But the point (that you are trying to sidestep) is that the UUID > namespace > > is finite, so therefore you WILL hit a problem with conflicts at some > point. > > Just because that point

Re: [GENERAL] UUID column as pimrary key?

2011-01-05 Thread Szymon Guz
On 5 January 2011 15:28, Radosław Smogura wrote: > On Wed, 05 Jan 2011 21:50:11 +1100, Craig Ringer < > cr...@postnewspapers.com.au> wrote: > >> On 01/05/2011 07:31 PM, Radosław Smogura wrote: >> >> * you have your id, before executing query, (in contrast to all this >>> autoincrement) so you ma

Re: [GENERAL] How to deal with field on the database that stores variable array's?

2011-01-01 Thread Szymon Guz
On 1 January 2011 21:35, Andre Lopes wrote: > Hi, > > I need to develop a database table that will aceept a variable array field. > My doubt is how to deal with updates on the > array field. How can I store the information of the array fields? There any > examples on the Internet on how to deal w

Re: [GENERAL] Row-level permissions?

2010-12-30 Thread Szymon Guz
On 30 December 2010 16:30, gvim wrote: > Is it possible, with PostgreSQL 9.0, to restrict access to specific table > rows by `id`? I want a user to be able to INSERT new rows but not UPDATE or > DELETE rows with `id` < 1616. > > gvim > > I think the simplest way would be creating a trigger in whi

Re: [GENERAL] How to convert string to integer

2010-12-15 Thread Szymon Guz
> > Please anyone can guide me.. > > Thanks > > > select SUM(pan_1::integer) from customers1 where name='101' but this will work only if for all rows you can convert this field to integer regards Szymon Guz

Re: [GENERAL] Fatal accident :)

2010-12-13 Thread Szymon Guz
2010/12/13 pasman pasmański > 2010-12-13 11:19:35 CET FATAL: the database system is starting up > > > And the question is??? btw, this is quite normal behaviour when postgres is starting and someone wants to connect. regards Szymon Guz

Re: [GENERAL] Cannot Achieve Performance

2010-12-10 Thread Szymon Guz
On 10 December 2010 12:28, Adarsh Sharma wrote: > Dear all, > > Performance tuning is what, which all i sured to achieve in pgsql. I am > currently testing on 5 GB table with select operation that takes about > 229477 ms ( 3.82 minutes ) with simple configuration. > > I have 4 GB RAM. So I chang

Re: [GENERAL] alter table add column - specify where the column will go?

2010-11-23 Thread Szymon Guz
st_login | timestamp without time zone | default now() > last_ip| inet| > medals | smallint| default 0 > > Thank you > Alex > > no Why do you want to do anything like that? regards Szymon Guz

Re: [GENERAL] Comments on tables

2010-11-10 Thread Szymon Guz
2010/11/10 pasman pasmański > Hello. > > > How to add comment on table with calculated value ? > > COMMENT ON TABLE test IS 'Updated ' || current_date; > > not works ... > > Hi, I'd suggest something like this: do $$ begin execute 'COMMENT ON TABLE test_count is ''Updated ' || current_date ||

Re: [GENERAL] It is possible to update more than 1 table in the same update statement?

2010-11-07 Thread Szymon Guz
On 7 November 2010 16:20, Andre Lopes wrote: > Sorry for not explain well. > > I mean update more than one table at the same time with something like > this: > > update table1, table2 > set > table1.f1 = 'aaa', > table2.date = '2001-01-01' > where > table1.id = 'x1' and table2.id = 'x1' > > Somet

Re: [GENERAL] It is possible to update more than 1 table in the same update statement?

2010-11-07 Thread Szymon Guz
On 7 November 2010 15:58, Andre Lopes wrote: > Hi, > > I need to update various tables in the same update. It is possible to do > it? > > Best Regards, > > Could you describe a little bit more what you want to achieve? regards Szymon

Re: [GENERAL] Return key from query

2010-11-03 Thread Szymon Guz
On 3 November 2010 17:46, Jonathan Tripathy wrote: > > >>> Sorry, I don't get it. I usually have an application that knows if it >>> wants to write some data to database, or not. So it writes the data, and >>> just gets from database the id that was set by database. No need of >>> getting the id

Re: [GENERAL] Return key from query

2010-11-02 Thread Szymon Guz
On 2 November 2010 21:59, Rob Sargent wrote: > > > On 11/02/2010 02:43 PM, Jonathan Tripathy wrote: > > Hi everyone, > > > > When adding a new record, we run an insert query which auto-increments > > the primary key for the table. However the method (in java) which calls > > this query must retur

Re: [GENERAL] Return key from query

2010-11-02 Thread Szymon Guz
On 2 November 2010 21:43, Jonathan Tripathy wrote: > Hi everyone, > > When adding a new record, we run an insert query which auto-increments the > primary key for the table. However the method (in java) which calls this > query must return the newly created key. > > Any ideas on how to do this, p

Re: [GENERAL] Dealing with locking on batch updates.

2010-11-02 Thread Szymon Guz
On 2 November 2010 10:47, RP Khare wrote: > Hi, > > Though the following issue we are facing at present with Oracle 10g > database, but I just want to know how PostgreSQL would solve this problem. > We are planning a migration to any open-source RDBMS in future, so just > wanted to clear this iss

Re: [GENERAL] index in desc order

2010-11-02 Thread Szymon Guz
On 2 November 2010 10:36, AI Rumman wrote: > Is it possible to create an index in descending order? > yes... create index i on t(i desc); regards Szymon

Re: [GENERAL] PostGIS return multiple points

2010-10-28 Thread Szymon Guz
On 28 October 2010 10:00, trevor1940 wrote: > > Hi > > I have a PostGIS table and I wish to get the location/name of multiple > points at once the command for selecting one point is > > select PolyName from MyPolygones where st_Contains(the_geom, > GeomFromText('point($LAT $LONG)4326'); > > where

Re: [GENERAL] what can depend on index

2010-10-26 Thread Szymon Guz
On 26 October 2010 16:29, Tom Lane wrote: > Szymon Guz writes: > > today I noticed that in the documentation there is DROP INDEX CASCADE. > > I've got one question: what is that for? What can depend on index? > > Unique constraints and foreign key constraints, for

Re: [GENERAL] what can depend on index

2010-10-26 Thread Szymon Guz
On 26 October 2010 16:21, David Fetter wrote: > On Tue, Oct 26, 2010 at 10:13:04AM +0200, Szymon Guz wrote: > > Hi, > > today I noticed that in the documentation there is DROP INDEX > > CASCADE. I've got one question: what is that for? What can depend > > on inde

  1   2   >