In article <[EMAIL PROTECTED]>, Philip Rudling wrote:
> Is the an SQL statement that can be used from within a program that will
> give the output of \d command? Like the describe command in MySQL's version
> of SQL?
>
There is a flag to psql which will show you the sql from the
backslash comm
In article <3D42D7AA.27447.3EE190A0@localhost>, "Dan Langille" wrote:
> This is an extension of the problem solved by
> http://archives.postgresql.org/pgsql-sql/2002-03/msg00020.php but
> with a slightly different complication.
>
> I want to get the last 100 port commits from the database. Com
In article <000c01c21cab$c2f35ef0$6901a8c0@bethvizx>, "Beth Gatewood" wrote:
> all-
> Could somebody tell me why I would use default 0 vs default '0' in the
> following
> CREATE TABLE foo (col1 INTEGER default 0) <-- or default '0'
>
0 is an integer
'0' is a string
default '0' might work (t
On Mon, 15 Oct 2001 09:56:26 +0800, guard <[EMAIL PROTECTED]> wrote:
> thanks
>
> I have run "select substr('hi there', 3, 5)::varchar(5) as xx;"
> but get error message
> Error: ERROR: parser: parse error at or near ":"
>
Works for me on 7.1.2 and pre-7.2
What version are you using?
select v
>
> how to
> select substr('hi there',3,5) as xx -->> xx change char type
>
How about:
select substr('hi there', 3, 5)::varchar(5) as xx;
or is this not what you mean?
---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to
On Sat, 13 Oct 2001 03:32:57 + (UTC), <[EMAIL PROTECTED]> wrote:
> It's been a while since I used postgresql but today I have converted one
> of my web apps but with one small problem. I goto do a group as
> designed and executed in mysql and I get told that this and this must be
> part of th
> I was looking for a solution on how to write a constraint into a ' create
> table ' expression that would ensure that one ' TIME ' attribute value
> called arrival_time (declared as TIME) is allways constrained to have a
> value that ensures it is allways after another attribute value called
> d
>
> I run select 5/2 = 2
> who to get "2.5"
>
integer/integer = integer
float/integer = float
integer/float = float
integer/integer::float = float
test=# SELECT 5.0/2;
?column?
--
2.5
(1 row)
test=# SELECT 5/2::float;
?column?
--
2.5
On Mon, 17 Sep 2001 14:51:52 + (UTC), ke wang <[EMAIL PROTECTED]> wrote:
> Is there any command or query to see the definition of an existing table,
> like which is the primary key, which is not null etc.
>
In psql:
\d tablename
to see what the exact query is, start psql with the -E flag:
p