hi all,
i just want to know one thing that is there any function in PGSQL which gives me the total number of columns in a table.
OR
just like we are using count(*), it gives us total number or rows in a
table, just like i want to know the total number of columns present in
the table
plz help
Create view/storedproc on pg_class pg_attribute tables
2006/2/16, AKHILESH GUPTA [EMAIL PROTECTED]:
hi all,
i just want to know one thing that is there any function in PGSQL which
gives me the total number of columns in a table.
OR
just like we are using count(*), it gives us total
am 16.02.2006, um 14:43:43 +0530 mailte AKHILESH GUPTA folgendes:
hi all,
i just want to know one thing that is there any function in PGSQL which
gives me the total number of columns in a table.
select count(column_name) from information_schema.columns where
table_name='foo';
HTH, Andreas
On fim, 2006-02-16 at 14:43 +0530, AKHILESH GUPTA wrote:
i just want to know one thing that is there any function in PGSQL
which gives me the total number of columns in a table.
OR
just like we are using count(*), it gives us total number or rows in a
table, just like i want to know the total
Hi!
I found a problem with the views in PostgreSQL if I want to use
temporary tables in it. See the next case!
CREATE TABLE a(, code INT4,...);
INSERT INTO a(...,code,...) VALUES (...,23,...);
CREATE TABLE actual_code(code INT4);
If I execute the next query, the result is empty.
Antal Attila wrote:
Hi!
I found a problem with the views in PostgreSQL if I want to use
temporary tables in it. See the next case!
[snip]
The problem is that the view use the original permanent table, but the
1) query use the temporary actual_code table.
I read the temporally table
Hi, Antal,
Antal Attila wrote:
CREATE VIEW a_view AS SELECT * FROM a JOIN actual_code AC ON (a.code =
AC.code);
Here, you bind the View to the permanent table.
CREATE TEMP TABLE actual_code AS SELECT 23::INT4 AS code;
And here you create the temp table that will hide the permanent table.
-Message d'origine-
De : Tom Lane [mailto:[EMAIL PROTECTED]
Envoyé : mercredi, février 15, 2006 17:47
À : Daniel Caune
Cc : Andrew Sullivan; pgsql-sql@postgresql.org
Objet : Re: [SQL] How to force PostgreSQL using an index
Daniel Caune [EMAIL PROTECTED] writes:
SELECT
Markus Schaber [EMAIL PROTECTED] writes:
Antal Attila wrote:
Is it BUG, or FEATURE? Has anybody got good ideas for solve this problem?
It is a feature.
Right. Note that one possible answer is, after you make the temp table,
to create a temp view referencing the temp table (and hiding the
Hello,
I am looking to simplify this query (uses PostGIS, but I have encountered this
scenario with other chains of functions):
gtest=# SELECT X(
SetSRID(
Transform(
GeomFromText(
'POINT(142512 1020225)', 26910
), 4326
),
-1)
) as xcoord, Y(
SetSRID(
On February 16, 2006 11:07 am, Michael Burke wrote:
Hello,
I am looking to simplify this query (uses PostGIS, but I have encountered
this scenario with other chains of functions):
-- snip --
Immediately after sending this one, I realized I could do it with a
sub-select:
gtest=# SELECT
Wow! I didn't know you could have a (select ...) as a replacement for
a 'from' table/query. Your SQL worked as-is, except I had to add a
'limit 1' to the first subquery.
Thanks! I would have never figured that out on my own!
Mark
chester c young wrote:
--- Mark Fenbers [EMAIL PROTECTED]
Hi
all,
I am
pretty new to using Postrgres, and have been looking at the messages in this
forum for a while. I have noticed that the use of EXPLAIN-ANALYZE is recommended
quite a lot. I read the Postgres docs, but am not quite sure I understand how
this works. Is there some tutorial or
On Thu, Feb 16, 2006 at 12:07:10PM -0800, Kashmira Patel (kupatel) wrote:
Hi all,
I am pretty new to using Postrgres, and have been looking at the
messages in this forum for a while. I have noticed that the use of
EXPLAIN-ANALYZE is recommended quite a lot. I read the Postgres docs,
but am
http://www.postgresql.org/docs/7.2/static/performance-tips.html
EXPLAIN is explaied quite nicely with examples here. Hope that helps
Bests
AJ
On 2/16/06, Kashmira Patel (kupatel) [EMAIL PROTECTED] wrote:
Hi all,
I am pretty new to using Postrgres, and have been looking at the messages in this
So I would have to put in lots of rows of data in the table before using
the explain command?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sullivan
Sent: Thursday, February 16, 2006 12:39 PM
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] Using
On Thu, Feb 16, 2006 at 01:08:40PM -0800, Kashmira Patel (kupatel) wrote:
So I would have to put in lots of rows of data in the table before using
the explain command?
Well, no, but you won't get useful information without it.
PostgreSQL has a cost-based optimizer. The query plan is affected
Thanks for the explanations and the links. Will try some of this out and
come back to you guys if I still don't understand :)
-Kashmira
-Original Message-
From: Andrew Sullivan [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 16, 2006 1:14 PM
To: Kashmira Patel (kupatel)
Cc: Andrew
Hi, Mark,
Mark Fenbers schrieb:
Wow! I didn't know you could have a (select ...) as a replacement for a
'from' table/query. Your SQL worked as-is, except I had to add a 'limit
1' to the first subquery.
Thanks! I would have never figured that out on my own!
SQL has more power than most
19 matches
Mail list logo