Is there no way I can do it with a standard select command in a
different client? I don't need the indexes, just the column
names/types.
--
Aaron Bratcher
ab DataTools
http://www.abDataTools.com
On Feb 6, 2004, at 8:12 AM, Harald Fuchs wrote:
In article <[EMAIL PROTECTED]>,
"Joshua D. Drake" <[
Aaron Bratcher wrote:
Is there no way I can do it with a standard select command in a
different client? I don't need the indexes, just the column names/types.
For PostgreSQL 7.3 and above:
SELECT
a.attname,
format_type(a.atttypid, a.atttypmod)
FROM
pg_catalog.pg_class c INNER JOIN
p
hi,
I just took over a project done by somebody else of some C extension of
Postgresql 7.1.3. And now I have to port it to pl/pgsql. The guy who
developed it said he didn't get it running under 7.2 for some reason. And I
suspect it might not run properly under 7.4.1. Since I only have one machine
this should work (don't forget to replace !!!):
SELECT
A.attname,
pg_catalog.format_type(a.atttypid, a.atttypmod) AS typeName
FROM
pg_class C,
pg_attribute A,
pg_type T
WHERE
C.relname ILIKE '' AND
(C.oid=A.attrelid) AND
(T.oid=A.atttypid) AND
(A.attnum>0) AND
(NOT A.attisd
try something like this:
select attname from pg_class, pg_attribute where
relname='your_tablename' and attrelid=relfilenode;
--
Mit freundlichem Gruß
Henrik Steffen
Geschäftsführer
top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
-
Hi wei,
it is quite easy to have two different version of postgres running on
one machine. You need 2 different directories for the data files and 2
different ports for the 2 postmasters to listen.
-first you prepare the data directories with initdb, you can use the -D
parameter to give the loca
Title: how can I select into an array?
I would like to select strings from a table and return them as an array
For example,
select new_array(name) from my_tbl
would return
String[] { name1, name2, name3, etc }
Is this possible with built-in SQL/psql functions?
If not, how hard would it
On Friday 06 February 2004 15:01, Wei Wang wrote:
> hi,
>
> I just took over a project done by somebody else of some C extension of
> Postgresql 7.1.3. And now I have to port it to pl/pgsql. The guy who
> developed it said he didn't get it running under 7.2 for some reason. And I
> suspect it might
hello,
try:
CREATE OR REPLACE FUNCTION aggregate_array(ANYARRAY,ANYELEMENT) RETURNS
ANYARRAY AS '
SELECT
CASE
WHEN $1 IS NULL
THEN ARRAY[$2]
WHEN $2 IS NULL
THEN $1
ELSE array_append($1,$2)
END;
' LANGUAGE 'SQL';
CREATE AGGREGATE aggarray (BASETYPE = ANYELEMENT,
On Friday 06 February 2004 15:00, Franco Bruno Borghesi wrote:
>
> Does anyone know if the ansi sql standard defines any way to do this?
> I've seen the DESCRIBE TABLE/INDEX/... or SHOW TABLE/INDEX/... commands
> in other databases, but I don't really know if they are extensions or
> not.
There's
Thank you for your response - I should have mention I'm using Postgres 7.2.x
ANYARRAY does not appear to exist in that version
Is there a workaround?
-Original Message-
From: Pavel Stehule [mailto:[EMAIL PROTECTED]
Sent: Friday, February 06, 2004 10:49 AM
To: Andy Kriger
Cc: Pgsql-General
Franco Bruno Borghesi <[EMAIL PROTECTED]> writes:
> Does anyone know if the ansi sql standard defines any way to do this?
> I've seen the DESCRIBE TABLE/INDEX/... or SHOW TABLE/INDEX/... commands
> in other databases, but I don't really know if they are extensions or
> not.
They are extensions (an
Dear sirs,
Does someone made PL/Ruby working on 4.7.1?
I tried alot of things. Manual install, port install and nothing happend.
Please give me the idea how to fix the problem with
plruby.c: In function `pl_tuple_put':
plruby.c:498: error: too few arguments to function `tuplestore_begin_heap'
plrub
if you can in plpgsql 7.2.x return array of known type, you can replace
anyarray and anyelement like varchar[], varchar. But I don't know if it
7.2 supported.
Pavel
On Fri, 6 Feb 2004, Andy Kriger wrote:
> Thank you for your response - I should have mention I'm using Postgres 7.2.x
> ANYARRAY
Dear All,
I'm trying to get a table containing all the user created tables, which
contains the column name and their types. Basically, I want to be able to
do "\d all_user_tables" - but I can't use the \d notation.
I tried to combine the pg_ tables, but I couldn't get what I wanted (due to
my
"Andy Kriger" <[EMAIL PROTECTED]> writes:
> I would like to select strings from a table and return them as an array
You can do that beginning in 7.4 with the ARRAY(sub-select) construct.
regression=# select f1 from text_tbl;
f1
---
doh!
hi de ho neighbor
(2 rows)
regres
I want to create a program which displays large tables and makes this possible
over a slow connection. The problem is that when i do a PQexec the entire
retultset is transfered.
I would like to make pqsql process the query but only tranfer the the rows i
ask for when i ask for them. This way i c
Mark Gibson wrote:
I'd like to do something like this:
CREATE TYPE my_type AS (id integer, title text);
SELECT *
FROM fn_returning_setof_record( ... )
AS t my_type;
or
SELECT *
FROM fn_returning_setof_record( ... )::my_type AS t;
I've not been able to find anything like this in
this query will list every table (with its attributes) in the "public" schema. You could alter the where clause to add more schemas (maybe using IN):
SELECT
N.nspname,
C.relname,
A.attname,
pg_catalog.format_type(a.atttypid, a.atttypmod) AS typeName
FROM
pg_class C,
pg_namespace N,
pg_attribut
On Fri, Feb 06, 2004 at 04:53:47PM +, C G wrote:
>
> I'm trying to get a table containing all the user created tables, which
> contains the column name and their types. Basically, I want to be able to
> do "\d all_user_tables" - but I can't use the \d notation.
>
> I tried to combine the p
"Peter Alberer" <[EMAIL PROTECTED]> writes:
> it is quite easy to have two different version of postgres running on
> one machine. You need 2 different directories for the data files and 2
> different ports for the 2 postmasters to listen.
> -first you prepare the data directories with initdb, yo
that's great, I didn't know about the information schema... guess I never read the 'what's new' document
On Fri, 2004-02-06 at 13:15, Tom Lane wrote:
Franco Bruno Borghesi <[EMAIL PROTECTED]> writes:
> Does anyone know if the ansi sql standard defines any way to do this?
> I've seen the DESC
I think you should use a cursor; you declare it, and then you fetch the rows as you need them.
On Fri, 2004-02-06 at 14:04, Christoffer Gurell wrote:
I want to create a program which displays large tables and makes this possible
over a slow connection. The problem is that when i do a PQexec t
Pavel Stehule wrote:
CREATE AGGREGATE aggarray (BASETYPE = ANYELEMENT, SFUNC = aggregate_array,
STYPE = ANYARRAY);
Or, from the docs, see:
http://www.postgresql.org/docs/current/static/xaggr.html
CREATE AGGREGATE array_accum (
sfunc = array_append,
basetype = anyelement,
stype = any
Are indexes useful for speeding up ORDER BY clauses? Example:
CREATE TABLE t
(
a INT,
b INT,
c INT,
d INT
);
SELECT * FROM t WHERE a = 1 AND b = 2 AND c = 3 ORDER BY b;
Let's say the table just has one index:
CREATE INDEX b_idx ON t (b);
In this cas
On Thu, 2004-02-05 at 22:52, Martijn van Oosterhout wrote:
> On Fri, Feb 06, 2004 at 01:11:24AM -0500, Tom Lane wrote:
> > Jenny Zhang <[EMAIL PROTECTED]> writes:
> > > ERROR: end-of-copy marker corrupt
> > > CONTEXT: COPY author, line 49: "49\aoD{\BABABABABARENG
> > > \t5p.\19840426"
> >
Thank you all for your kind help. I have set up 7.4.1 and it's up and
running perfectly.
One small question that might not belong in this mailing list:
Since all the binary commands share the same name, e.g. initdb, createdb,
psql, etc, and the
default path is already the 7.1.3 version. How do I co
On Fri, 6 Feb 2004, John Siracusa wrote:
> Are indexes useful for speeding up ORDER BY clauses? Example:
>
> CREATE TABLE t
> (
> a INT,
> b INT,
> c INT,
> d INT
> );
>
> SELECT * FROM t WHERE a = 1 AND b = 2 AND c = 3 ORDER BY b;
>
> Let's say the table j
Pavel Stehule wrote:
if you can in plpgsql 7.2.x return array of known type, you can replace
anyarray and anyelement like varchar[], varchar. But I don't know if it
7.2 supported.
PL/pgSQL array support in anything earlier than 7.4 is pretty weak. I
would strongly recommend upgrading to 7.4 if a
Anton Nikiforov wrote:
Dear sirs,
Does someone made PL/Ruby working on 4.7.1?
I tried alot of things. Manual install, port install and nothing happend.
Please give me the idea how to fix the problem with
plruby.c: In function `pl_tuple_put':
plruby.c:498: error: too few arguments to function `tuple
John Siracusa wrote:
SELECT * FROM t WHERE a = 1 AND b = 2 AND c = 3 ORDER BY b;
Let's say the table just has one index:
CREATE INDEX b_idx ON t (b);
In this case, obviously the b_idx will be used and no sorting after the fact
will be required. Now let's add an index:
CREATE INDEX k
Wei Wang wrote:
> Thank you all for your kind help. I have set up 7.4.1 and it's up and
> running perfectly.
> One small question that might not belong in this mailing list:
> Since all the binary commands share the same name, e.g. initdb, createdb,
> psql, etc, and the
> default path is already th
32 matches
Mail list logo