Re: [SQL] Looking for a "show create table " equivalent

2011-07-13 Thread Wes James
On Tue, Jul 12, 2011 at 2:33 AM, B.Rathmann wrote: > Hello, > > I've been trying to find out how to find out which sql was run to create > a certain table. As I need this in a program which may access the > database remotely, using pg_dump --schema-only or psql is not an option > (the system my pr

Re: [SQL] Looking for a "show create table " equivalent

2011-07-13 Thread Wes James
On Tue, Jul 12, 2011 at 2:33 AM, B.Rathmann wrote: > Hello, > > I've been trying to find out how to find out which sql was run to create > a certain table. As I need this in a program which may access the > database remotely, using pg_dump --schema-only or psql is not an option Maybe turning on

Re: [SQL] Looking for a "show create table " equivalent

2011-07-13 Thread Guillaume Lelarge
On Tue, 2011-07-12 at 10:33 +0200, B.Rathmann wrote: > [...] > I've been trying to find out how to find out which sql was run to create > a certain table. As I need this in a program which may access the > database remotely, using pg_dump --schema-only or psql is not an option > (the system my prog

Re: [SQL] Max column number.

2011-07-13 Thread Kevin Crain
Have you tried changing the block size? http://wiki.postgresql.org/wiki/FAQ#What_is_the_maximum_size_for_a_row.2C_a_table.2C_and_a_database.3F On Wed, Jul 13, 2011 at 11:03 AM, Miguel Angel Conte wrote: > I have the metadata in the same csv. > > On Wed, Jul 13, 2011 at 3:00 PM, Kevin Crain wrote

Re: [SQL] Max column number.

2011-07-13 Thread Kevin Crain
Is there any room for improvement in the data types? On Wed, Jul 13, 2011 at 11:03 AM, Miguel Angel Conte wrote: > I have the metadata in the same csv. > > On Wed, Jul 13, 2011 at 3:00 PM, Kevin Crain wrote: >> >> How are you determining the data types for these columns? >> >> On Wed, Jul 13, 20

Re: [SQL] Max column number.

2011-07-13 Thread Miguel Angel Conte
I have the metadata in the same csv. On Wed, Jul 13, 2011 at 3:00 PM, Kevin Crain wrote: > How are you determining the data types for these columns? > > On Wed, Jul 13, 2011 at 8:45 AM, Miguel Angel Conte > wrote: > > Hi, > > Thanks for your interest. This app load scv files which change every

Re: [SQL] Max column number.

2011-07-13 Thread Kevin Crain
How are you determining the data types for these columns? On Wed, Jul 13, 2011 at 8:45 AM, Miguel Angel Conte wrote: > Hi, > Thanks for your interest. This app load scv files which change every day > (sometimes the columns too). The sizes of these files are in avg 15MB. So, > We load something li

Re: [SQL] Max column number.

2011-07-13 Thread Miguel Angel Conte
I can't drop the table. I have to add as many columns as posible and when I exceed the limit I have to create another table. I've tried normalizing but then the join's cost is too big. I always need to use all columns, so getting a all information into a single row it's the most efficient solution

Re: [SQL] Max column number.

2011-07-13 Thread Scott Marlowe
On Wed, Jul 13, 2011 at 9:45 AM, Miguel Angel Conte wrote: > Hi, > Thanks for your interest. This app load scv files which change every day > (sometimes the columns too). The sizes of these files are in avg 15MB. So, > We load something like 100MB each day. We tried to find a better solution > but

Re: [SQL] using explain output within pgsql

2011-07-13 Thread Gavin Flower
On 11/07/11 08:18, Pavel Stehule wrote: 2011/7/10 Uwe Bartels: Hi Pavel, is it posible to get this running even with dynamic sql? I didn't write that. I'm using execute to run this create table probably yes postgres=# do $$ declare x text; begin execute e'explain(format yaml) select *

[SQL] newbie question * compare integer in a "where IN" statement

2011-07-13 Thread Jose Ig Mendez
Title: Firma Correo Hi everybody, I'm trying to compare in a sentence like this (using PostGres 8.3) : select * from myTable where id_integer IN ('1,2,3,4') I want to get the records which key "id_integer" is 1 or 2 or 3 or 4. the type od my "id", of course

[SQL] Looking for a "show create table " equivalent

2011-07-13 Thread B.Rathmann
Hello, I've been trying to find out how to find out which sql was run to create a certain table. As I need this in a program which may access the database remotely, using pg_dump --schema-only or psql is not an option (the system my program runs on may not even have those tools installed). Looking

Re: [SQL] Max column number.

2011-07-13 Thread Reinoud van Leeuwen
On Wed, Jul 13, 2011 at 12:45:45PM -0300, Miguel Angel Conte wrote: > Hi, > > Thanks for your interest. This app load scv files which change every day > (sometimes the columns too). The sizes of these files are in avg 15MB. So, > We load something like 100MB each day. We tried to find a better sol

Re: [SQL] Max column number.

2011-07-13 Thread Miguel Angel Conte
Hi, Thanks for your interest. This app load scv files which change every day (sometimes the columns too). The sizes of these files are in avg 15MB. So, We load something like 100MB each day. We tried to find a better solution but we couldn't, becouse one of the our requirement is not to use a lot

Re: [SQL] combining strings to make a query

2011-07-13 Thread Wes James
Thank you for the tsvectors info! -wes On Wed, Jul 13, 2011 at 12:11 AM, Kevin Crain wrote: > You can do full-text search in postgres now using ts_vectors.  I'd > recommend going that route.  Doing like comparisons is not a good idea > if you don't know the first part of the string you are searc

Re: [SQL] Select random lines of a table using a probability distribution

2011-07-13 Thread k...@rice.edu
On Wed, Jul 13, 2011 at 03:27:10PM +0200, Jira, Marcel wrote: > Hi! > > Let's consider I have a table like this > > idqualificationgenderageincome > > I'd like to select (for example 100) lines of this table by random, but the > random mechanism has to follow a certain probabili

[SQL] Select random lines of a table using a probability distribution

2011-07-13 Thread Jira, Marcel
Hi! Let's consider I have a table like this idqualificationgenderageincome I'd like to select (for example 100) lines of this table by random, but the random mechanism has to follow a certain probability distribution. I want to use this procedure to construct a test group for a

Re: [SQL] newbie question * compare integer in a "where IN" statement

2011-07-13 Thread Jose Ig Mendez
Title: Firma Correo Hi, Thank you very much Pavel, that solves my problem Regards On 13/07/11 09:50, Pavel Stehule wrote: Hello you can try SELECT .. FROM .. WHERE id = ANY(string_to_array('1,2,3,4,5',',')) other forms

Re: [SQL] newbie question * compare integer in a "where IN" statement

2011-07-13 Thread Pavel Stehule
Hello you can try SELECT .. FROM .. WHERE id = ANY(string_to_array('1,2,3,4,5',',')) other forms are slow Regards Pavel Stehule 2011/7/13 Jose Ig Mendez > > Hi everybody, > > I'm trying to compare in a sentence like this (using PostGres 8.3) : > > select * from myTable where id_integer IN (

Re: [SQL] newbie question * compare integer in a "where IN" statement

2011-07-13 Thread Thomas Kellerer
Jose Ig Mendez, 13.07.2011 09:36: Hi everybody, I'm trying to compare in a sentence like this (using PostGres 8.3) : select * from myTable where id_integer IN ('1,2,3,4') I want to get the records which key "id_integer" is 1 or 2 or 3 or 4. the type od my "id", of course, is integer. I've t

[SQL] newbie question * compare integer in a "where IN" statement

2011-07-13 Thread Jose Ig Mendez
Title: Firma Correo Hi everybody, I'm trying to compare in a sentence like this (using PostGres 8.3) : select * from myTable where id_integer IN ('1,2,3,4') I want to get the records which key "id_integer" is 1 or 2 or 3 or 4. the type od my "id",