Re: [GENERAL] moving from MySQL to pgsql

2012-10-11 Thread F. BROUARD / SQLpro
Le 10/10/2012 10:47, Vineet Deodhar a écrit : Hi ! 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data type or something else) Another way, and a good practice toot is to use SQL DOMAINs wich is a part of the ISO SQL since 1992 that MySQL don't have... CREATE DOMAIN

Re: [GENERAL] String comparision in PostgreSQL

2012-08-30 Thread F. BROUARD / SQLpro
Le 30/08/2012 12:45, Craig Ringer a écrit : That's my understanding, but I don't know which other database systems you're talking about because you've never specifically named any. In his primary post he talk about SQL Server, Sybase and MySQL wich does good jobs with collation Almost a

Re: [GENERAL] PG vs MSSQL language comparison ?

2012-05-27 Thread F. BROUARD / SQLpro
Le 26/05/2012 06:36, Grant Allen a écrit : On 26/05/2012 00:04, Andreas wrote: Hi, I'm not into comparing which DBMS is better as we all know ... kind of ... well ... I'd like to find ressources to look up how one can do X in MSSQL when one knows how it is done in PG's SQL and the other way

[GENERAL] Starnge things with big datas...

2012-04-21 Thread F. BROUARD / SQLpro
Hi there, PostgreSQL 9.1.2, compiled by Visual C++ build 1500, 64-bit catalog version : PG_9.1_201105231 -- the table : CREATE TABLE T_TEST_TAILLE (TTT_IDSERIAL NOT NULL PRIMARY KEY, TTT_DATAFIX CHAR(16), TTT_DATAVAR VARCHAR(16), TTT_DATAVARBIGVARCHAR(6000));

[GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread F. BROUARD / SQLpro
Hi, according to the documentation, the function pg_relation_filepath returns the entire file path name (relative to the database cluster's data directory PGDATA) of the relation When my table are located in the pg_default tablespace, the gievn relative path is correct When my table are

Re: [GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread F. BROUARD / SQLpro
Le 20/04/2012 12:05, Guillaume Lelarge a écrit : On Fri, 2012-04-20 at 11:35 +0200, F. BROUARD / SQLpro wrote: Hi, according to the documentation, the function pg_relation_filepath returns the entire file path name (relative to the database cluster's data directory PGDATA) of the relation

Re: [GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread F. BROUARD / SQLpro
Le 20/04/2012 16:18, Guillaume Lelarge a écrit : SELECT CASE WHEN coalesce(t.spclocation, '') = '' THEN current_setting('data_directory')||'/'||pg_relation_filepath(c.oid) ELSE replace(pg_relation_filepath(c.oid), 'pg_tblspc/'||t.oid::text,

[GENERAL] - tablespace and directory

2012-04-18 Thread F. BROUARD / SQLpro
Hi there, when creating a tablespace pointing to an existing directory, PG create a subderictory with this pattern : PG_???_! where ??? is the version (by instance 9.1) but I don't know what is !, actually 201105231 I can imagine that is a build version, but how can I

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread F. BROUARD / SQLpro
Thanks ! Le 18/04/2012 15:35, Raghavendra a écrit : On Wed, Apr 18, 2012 at 6:22 PM, F. BROUARD / SQLpro sql...@club-internet.fr mailto:sql...@club-internet.fr wrote: Hi there, when creating a tablespace pointing to an existing directory, PG create a subderictory

Re: [GENERAL] - tablespace and directory

2012-04-18 Thread F. BROUARD / SQLpro
Hi, is there anyway to have the value of Catalog version number in a query ? I do not see it in pg_settings... A + Le 18/04/2012 15:35, Raghavendra a écrit : On Wed, Apr 18, 2012 at 6:22 PM, F. BROUARD / SQLpro sql...@club-internet.fr mailto:sql...@club-internet.fr wrote: Hi

Re: [GENERAL] Referencing function value inside CASE..WHEN

2011-06-19 Thread F. BROUARD / SQLpro
Hi Le 19/06/2011 04:27, lover boi a écrit : SELECT MY_FUNCTION(...) AS my_function, CASE WHEN my_function = '...' THEN '...' ELSE '...' END ... ... WITH T AS (SELECT MY_FUNCTION(...) AS my_function, ... ) SELECT CASE WHEN my_function = '...' THEN '...' ELSE '...' END ... ... A + --

Re: [GENERAL] Search for lists

2011-06-19 Thread F. BROUARD / SQLpro
Le 18/06/2011 23:51, Daron Ryan a écrit : Hello, I need to search a table to find sets of rows that have a column matching itself for the whole set and another column matching row for row with a list I am going to supply. The result I should receive should be value of the column that matches

[GENERAL] HOW TO install or use pageinspect

2011-06-14 Thread F. BROUARD / SQLpro
Hi there, I have a 9.1 PG Server on Windows XP The pageinspect.dll is in C:\Program Files\PostgreSQL\9.1\lib I am postgresql user in the database (names DB_TEST). But I cannot use the functions like SELECT * FROM heap_page_items(get_raw_page('aTable', 0)) They does not appear in the postgreSQL

Re: [GENERAL] HOW TO install or use pageinspect

2011-06-14 Thread F. BROUARD / SQLpro
Hi Gleu, OK I run : CREATE EXTENSION pageinspect And it works. Thanks Le 14/06/2011 10:32, Guillaume Lelarge a écrit : Hi, On Tue, 2011-06-14 at 10:06 +0200, F. BROUARD / SQLpro wrote: [...] I have a 9.1 PG Server on Windows XP The pageinspect.dll is in C:\Program Files\PostgreSQL\9.1

Re: [GENERAL] query taking much longer since Postgres 8.4 upgrade

2011-03-21 Thread F. BROUARD / SQLpro
Try this : 1) rewrite your query as is : select course_id AS EXTERNAL_COURSE_KEY, user_id AS EXTERNAL_PERSON_KEY, 'Student' AS ROLE, 'Y' AS AVAILABLE_IND from course_user_link AS CUL INNER JOIN course_control AS CC ON CUL.course_id = CC.course_id where